Chapter 4 · 7 levels

Retention and churn

Cohorts by first order, retention tables and curves, churn for a store with no subscriptions, and customers who come back. Who stays, who leaves, and how to tell them apart honestly.

Start

Getting a customer to buy once is expensive. Getting them to buy again is where a store makes its money, so “are customers coming back?” is one of the first questions any leadership team asks. The honest answer takes more care than a single number.

Harbor & Pine sells sofas and lamps, not subscriptions. Nobody cancels: customers simply stop ordering, and you have to decide when silence means they are gone. In this chapter you group customers into cohorts by the quarter of their first order, build a retention table and a retention curve, learn why young cohorts make curves look worse than they are, pick a churn window from the real gaps between orders, and count the customers who came back after a long break.

Every level uses booked orders: status is completed or refunded, the orders that were paid. A customer’s first order is their first booked order, and the “as of” date is 2025-12-31, the last day in the data. Levels alternate between SQL and pandas.

Levels

  1. Cohorts by first order

    from Jordan Reyes, Head of Marketing

    cohort, first order, retention, to period, groupby

    Code Difficulty 2 of 5 Not started

  2. The cohort retention table

    from Catherine Hale, Chief Executive Officer

    cohort, retention, repeat purchase, cte, date arithmetic

    Code Difficulty 3 of 5 Not started

  3. Reading a retention curve

    from Priya Shah, Head of Data

    retention curve, cohort, right censoring, period, pooled rate

    Code Difficulty 4 of 5 Not started

  4. Churn without subscriptions

    from Angela Rivera, Head of Customer Support

    churn, recency, as of date, segment, cte

    Code Difficulty 3 of 5 Not started

  5. Picking a churn window

    from Angela Rivera, Head of Customer Support

    churn, churn window, inter purchase gap, percentiles

    Quiz Difficulty 3 of 5 Not started

  6. Customers who came back

    from Jordan Reyes, Head of Marketing

    reactivation, churn, shift, gap, net sales

    Code Difficulty 3 of 5 Not started

  7. Boss: the retention review

    from Robert Kim, Chief Operating Officer

    retention, churn, reactivation, cohort, cte, revenue mix

    Boss · 3 steps Difficulty 4 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.