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.

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)
Sample rows from app_events
event_iduser_idevent_typeevent_date
11visit2025-06-01
22visit2025-06-01
33visit2025-06-01
44visit2025-06-02
55visit2025-06-02

  • TEXT · YYYY-MM
  • TEXT
  • INTEGER · rupees
Sample rows (10 total)
Sample rows from monthly_revenue
monthregionrevenue
2025-01North100000
2025-02North110000
2025-03North105000
2025-04North120000
2025-05North130000

Next: Running total per customer →

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)
Expected output
event_typeuserspct_of_visitors
visit10100.0
signup770.0
purchase440.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.