Problems / MAU Growth Accounting / Editorial
first_month
prev_active_month
M
M+1
churned = 0
Growth accounting mixes two fundamentally different query shapes: presence classification (window functions over the rows that exist) and absence detection (anti-joins for the rows that don't). No single pass produces both — the standard trap is trying to bolt churn onto the window CTE and discovering there is no row to hang it on. Compute them separately, at their natural grains, and join at the end. The identity new + retained + resurrected = MAU (and churned(M) = MAU(M-1) − retained(M)) makes the report self-auditing.
new + retained + resurrected = MAU
churned(M) = MAU(M-1) − retained(M)
Solve MAU Growth Accounting yourself →