Visit → signup → purchase funnel
MediumCTEs and funnelsSaaS / product
The problem
For each event_type, count the distinct users who did it (as users), and show that as a percentage of distinct users who visited (as pct_of_visitors), rounded to 1 decimal place.
Order by users, highest first. Some users appear more than once, so count each user once.
Learn this in the course: Funnels and conversion (video and notes)
Tables · Product usage and revenue
Click a table or column name to insert it into your query.
- INTEGER · primary key
- INTEGER
- TEXT · visit | signup | purchase
- DATE
Sample rows (24 total)
| event_id | user_id | event_type | event_date |
|---|---|---|---|
| 1 | 1 | visit | 2025-06-01 |
| 2 | 2 | visit | 2025-06-01 |
| 3 | 3 | visit | 2025-06-01 |
| 4 | 4 | visit | 2025-06-02 |
| 5 | 5 | visit | 2025-06-02 |
- TEXT · YYYY-MM
- TEXT
- INTEGER · rupees
Sample rows (10 total)
| month | region | revenue |
|---|---|---|
| 2025-01 | North | 100000 |
| 2025-02 | North | 110000 |
| 2025-03 | North | 105000 |
| 2025-04 | North | 120000 |
| 2025-05 | North | 130000 |
Ctrl/⌘ + Enter runs the query. Table and column names are suggested as you type. Press Esc then Tab to leave the editor with the keyboard.
Expected output (3 rows)
| event_type | users | pct_of_visitors |
|---|---|---|
| visit | 10 | 100.0 |
| signup | 7 | 70.0 |
| purchase | 4 | 40.0 |
Row order matters for this question. Numbers are compared with a tiny tolerance; text must match exactly.
Stuck?
Stored on this device only. Your latest query and “solved” status are remembered in this browser only. They don’t sync between devices, and clearing your browser data removes them.