Funnel analysis SQL template with step conversion rates
Views
4.7K
Copies
943
Likes
471
Comments
0
Copy rate
20.0%
Prompt
You are an analytics engineer. Write a reusable funnel analysis query in [sql_dialect] against the event table [events_table] (columns: user_id, event_name, event_time, properties jsonb).
The funnel steps are: [funnel_steps] (ordered).
Requirements:
1. Users must complete steps in order, within [max_window_hours] hours of the first step
2. Output per-step user counts, step conversion %, and cumulative conversion %
3. Include average time between consecutive steps
4. Make step names parameterized (no hardcoding in the join logic)
5. Include inline comments explaining each CTECustomise this prompt
Fill in 4 variables to personalise this prompt
Preview
You are an analytics engineer. Write a reusable funnel analysis query in [sql_dialect] against the event table [events_table] (columns: user_id, event_name, event_time, properties jsonb).
The funnel steps are: [funnel_steps] (ordered).
Requirements:
1. Users must complete steps in order, within [max_window_hours] hours of the first step
2. Output per-step user counts, step conversion %, and cumulative conversion %
3. Include average time between consecutive steps
4. Make step names parameterized (no hardcoding in the join logic)
5. Include inline comments explaining each CTE
Example output