Chapter 9 · 8 levels

Analytics patterns

The queries behind every business review: running totals that reset each year, month-over-month and year-over-year growth, top N per group with ties, funnels, activation and retention grids.

Start

Most analyst requests are variations on a handful of patterns: “how are we tracking this year?”, “are we growing?”, “what sells best in each category?”, “where do visitors drop off?”, “do new customers come back?”. Each pattern has a standard query shape and, more importantly, a standard way to get the definition wrong.

This chapter builds on window functions and CTEs. You will write running totals that reset each year, month-over-month and year-over-year growth side by side, top N per group with deliberate tie handling, a conversion funnel, an activation rate by signup quarter and a cohort retention grid. The boss is a monthly business review that combines them.

Levels

  1. Year-to-date that resets every January

    from Laura Bennett, Head of Finance

    running total, partition by, sum over, year to date, cte

    Code Difficulty 3 of 5 Not started

  2. Month-over-month vs year-over-year

    from Robert Kim, Chief Operating Officer

    yoy growth, mom growth, lag, seasonality, cte

    Code Difficulty 4 of 5 Not started

  3. Top 3 per category, ties included

    from Jessica Turner, Merchandising Manager

    top n per group, rank, ties, qualify, cte

    Code Difficulty 4 of 5 Not started

  4. A conversion funnel by device

    from Daniel Foster, Mobile Product Manager

    funnel, conversion rate, conditional aggregation, filter clause

    Code Difficulty 3 of 5 Not started

  5. Activation rate by signup quarter

    from Jordan Reyes, Head of Marketing

    activation, cohort, left join, date difference, censoring

    Code Difficulty 4 of 5 Not started

  6. A cohort retention grid

    from Priya Shah, Head of Data

    cohort retention, datediff, month offset, cte, window functions

    Code Difficulty 5 of 5 Not started

  7. The partial-month trap

    from Megan Collins, Head of Sales

    period over period, month to date, seasonality, yoy growth

    Quiz Difficulty 3 of 5 Not started

  8. Boss: the annual business review

    from Catherine Hale, Chief Executive Officer

    yoy growth, share of total, top n per group, row number, repeat revenue, cte

    Boss · 3 steps Difficulty 5 of 5 Not started

Pick what may run on this site. You can change this any time from "Cookie settings" at the bottom of every page.