SQL Funnel Analysis

Start funnel analysis with distinct-user reach at each observed onboarding step.

What & Why

A funnel begins by counting how many distinct eligible entities reach each milestone. This query builds that reach table from completed product.onboarding_steps rows.

It does not calculate step-to-step conversion yet: a production funnel also needs a canonical step sequence and the eligible population for each previous stage.

See How It Works

BUSINESS QUESTION

Count unique users completing each onboarding step.

iduser_idstep_namecompleted_at
1101create_workspace2024-01-15 09:30:00+00
2101invite_teammate2024-01-16 10:15:00+00
3102create_workspace2024-02-10 11:30:00+00
4103connect_data2024-03-13 08:45:00+00
EXAMPLE QUERY
SELECT
  step_name,
  COUNT(DISTINCT user_id) AS users_completed
FROM product.onboarding_steps
WHERE completed_at IS NOT NULL
GROUP BY step_name
ORDER BY users_completed DESC, step_name;
RESULT — users completing each onboarding step
step_nameusers_completed
create_workspace2
connect_data1
invite_teammate1

The counts come directly from completed product.onboarding_steps rows.

This lesson's practice is part of Pro.

Advanced business practice

Sign up free to try it on a real business scenario