lil_olbee
lil_olbee

Reputation: 1

How to extract completion rate for final step in NRQL funnel query

I have an NRQL query that I’m using to analyze user journeys through a series of specific actions within the last 60 minutes on a specified page. Here’s how it looks:

SELECT funnel(
    user_id,
    WHERE actionName = 'step1',
    WHERE actionName = 'step2',
    WHERE actionName = 'step3' AND step3SomeDataCount > 0,
    WHERE actionName = 'step4'
)
FROM PageAction SINCE 60 minutes AGO
WHERE pageUrl = 'https://some-page/'

This query displays the number (and percentage) of users who successfully completed each step in the funnel, from step1 through step4, based on user_id.

Instead of seeing all the steps in the funnel, I only need the percentage of users who completed all four steps (i.e., reached step 4), based on those who started at step 1. The calculation should track users by their unique user_id to ensure we’re following the same user across all steps. Simply put, I need a query that returns the same result as the one above, but only the value (percentage) for step 4, rather than the entire funnel.

I understand I could achieve this by using nested queries, similar to this approach:

SELECT
    filter(count(user_id), WHERE actionName = 'step4' AND call_id IN (
        SELECT call_id 
        FROM PageAction 
        WHERE actionName = 'step3' AND step3SomeDataCount > 0 AND call_id IN (
            SELECT call_id FROM PageAction ...
        )
    )
FROM PageAction SINCE 60 minutes AGO
WHERE pageUrl = 'https://some-page/'

However, NRQL has a limit of max. 5,000 records that can be returned by select. Since I can have more than this number of records, this solution doesn’t reliably provide correct results for me.

Is there any way to do it?

Thank you in advance for your suggestions!

Upvotes: 0

Views: 62

Answers (0)

Related Questions