CredolayOpen specification · churn-dashboard-fix · v2

Fix the Broken Churn Dashboard

The board has been shown the wrong churn rate for months. Find out why, and fix the query.

Data AnalystEntry35 minutes6 tasks + 3-question defenceModes: Independent, AI-assisted
§ 1

The brief

You are the analyst at Tallyo, a subscription software company. The product manager has been reporting June's churn rate from the query below, and finance thinks the number is wrong.

subscriptions.csv has one row per subscription: when it started, when it was cancelled (empty if still live), its plan and its monthly fee. When a customer upgrades, their old subscription is cancelled and a new one starts the same day. customers.csv has one row per customer, and a few customers have no region on record.

The company's definitions: a subscription is active on a date D when started_on ≤ D and (cancelled_on is empty or cancelled_on > D). A customer is active at the start of June if they had an active subscription on 31 May 2025. A customer churned in June if they were active on 31 May 2025 and had no active subscription on 30 June 2025. Churn rate = churned customers ÷ customers active at the start of June.

Load the two files into any SQL engine you like (DuckDB, SQLite or Postgres all work) and run the query as written before you change it.

§ 2

The data

Every candidate gets their own copy, generated from their attempt's seed. Below is the first few rows from public example seed 20260101; a candidate's numbers will differ.

subscriptions.csv798 rows
subscription_idcustomer_idplanmonthly_feestarted_oncancelled_on
S1C00001Plus192025-06-06∅
S2C00002Basic92024-07-042025-05-25
S3C00003Basic92024-05-21∅
S4C00004Basic92024-07-102025-04-03
S5C00005Basic92024-04-102024-12-31
S6C00006Basic92024-01-312025-01-16
customers.csv700 rows
customer_idsignup_channelregion
C00001Paid searchGermany
C00002Paid searchUK
C00003Paid searchIreland
C00004OrganicNetherlands
C00005ReferralNetherlands
C00006Paid searchIreland
churn_dashboard.sql (example seed)
-- churn_dashboard.sql: "June churn rate"
SELECT
  COUNT(*) FILTER (
    WHERE s.cancelled_on BETWEEN '2025-06-01' AND '2025-06-30'
  ) * 100.0 / COUNT(*) AS churn_rate_pct
FROM subscriptions s
JOIN customers c ON c.customer_id = s.customer_id
WHERE s.started_on < '2025-06-01'
  AND c.region IS NOT NULL
  AND c.region <> '';
§ 3

The tasks

Weights are shares of the simulation score (total 9.5). Each task names the competencies it evidences and how strongly.

  1. 1. Run it as written
    A number from your data · weight 1

    Run the dashboard query exactly as written. What churn rate does it report? Give a percentage to two decimal places.

    Tolerance: ±0.02 points

    Evidences: SQL ×1

  2. 2. What is actually wrong
    Select all that apply · weight 2

    Given the company's definitions, which of these are real problems with the query?

    • ○It counts subscriptions rather than customers, so upgrades (one subscription ends and another starts) are counted as churn
    • ○The denominator includes subscriptions that had already been cancelled before June
    • ○Customers with no region on record are dropped from both the numerator and the denominator
    • ○BETWEEN excludes cancellations made on 30 June
    • ○Multiplying by 100.0 before dividing gives the wrong answer
    • ○started_on < '2025-06-01' wrongly excludes subscriptions that started on 31 May

    Evidences: SQL ×1 · Data analysis ×0.5 · Critical thinking ×0.5

  3. 3. The right number
    A number from your data · weight 2

    What was June 2025's churn rate, correctly calculated? Give a percentage to two decimal places.

    Tolerance: ±0.05 points · confidence asked before reveal

    Evidences: SQL ×1 · Data analysis ×1

  4. 4. What it cost
    A number from your data · weight 1

    How much monthly recurring revenue was lost to June churn? Sum the monthly_fee of the subscription each churned customer held on 31 May. Whole pounds.

    Tolerance: ±0.5

    Evidences: Data analysis ×1 · SQL ×0.5

  5. 5. The corrected query
    Code · weight 2

    Write the corrected query. It should return June 2025's churn rate using the company's definitions.

    Evidences: SQL ×1

    Rubric lineWeightFull marks (4/4) looks like
    Counts customers35%Works at customer level, so an upgrade (old subscription cancelled, new one active on 30 June) is not churn.
    Right denominator30%Only customers with a subscription active on 31 May count in the denominator.
    Nobody dropped20%No join or filter silently removes customers without a region.
    Readable15%Named CTEs for 'active at start' and 'active at end', or equivalent clarity.
  6. 6. Tell the product manager
    Written · weight 1.5

    The product manager has been reporting the old number to the board. Write them a short note: what was wrong, what the right number is, and what they should do about the months already reported.

    Evidences: Communication ×1 · Business analysis ×0.5

    Rubric lineWeightFull marks (4/4) looks like
    Clear about what was wrong35%Explains the errors in plain words, without blame or jargon.
    Gives the right number30%States the corrected rate and how far off the old one was.
    Recommends action35%Recommends restating earlier months with the fixed query and saying so to the board.
§ 4

The defence

After submitting, candidates answer these against the clock, typed live. Prompts quote the candidate's own submission where shown in brackets.

  1. D1. Explain your work
    5 min

    This is your corrected query: [the candidate's own answer to "The corrected query"] A customer upgraded from Basic to Plus on 12 June. Walk through how your query treats them, and why they are not counted as churned.

    Rubric lineWeightFull marks (4/4) looks like
    Traces their own query60%Follows the customer through the actual logic they submitted.
    Correct conclusion40%Correctly identifies the step that keeps an upgrade out of the churned count (or admits their query would count it).
  2. D2. Modify it
    5 min

    The board now wants churn for every month of 2025 in one result, one row per month. What would you change in your query?

    Rubric lineWeightFull marks (4/4) looks like
    Month series50%Generates or derives one row per month (generate_series, a calendar CTE, or equivalent).
    Per-month boundaries50%Replaces the fixed 31 May / 30 June with each month's previous month-end and month-end.
  3. D3. Spot the error
    3 min

    Someone suggests this simpler version of the numerator. What is wrong with it?

    SELECT COUNT(DISTINCT customer_id) AS churned
    FROM subscriptions
    WHERE cancelled_on BETWEEN '2025-06-01' AND '2025-06-30';
    • ○It still counts customers who cancelled one subscription and started another, so upgrades look like churn
    • ○COUNT(DISTINCT) counts a customer twice if they had two subscriptions
    • ○BETWEEN excludes 30 June
    • ○cancelled_on must be cast to a timestamp before comparing

How marks become a result: the method.