SQL/Analytics patterns 10 min
Growth and funnels
Month-over-month change and step-by-step conversion.
growthfunnelmom
Month-over-month growth is a monthly aggregate plus LAG: compare each month to the one before and express the difference as a percentage.
sql · editable
loading editor…
Try it: Show the running total of revenue alongside the growth rate.
A funnel counts distinct users reaching each stage, in order. Conditional aggregation gives you one row with one column per step, which makes the drop-off obvious.
sql · editable
loading editor…
Funnel steps must be cumulative and ordered, otherwise a later step can show more users than an earlier one. Define each step as 'reached at least this far'.
practice this