Subscription Commerce Analytics Path · Mission 10 of 25Medium

Skip rate by plan family

First conditional aggregation. Practice SUM(CASE WHEN ...) per category, computing a ratio between two conditional sums, and using NULLIF as a divide-by-zero guard. The skip rate is a key replenishment-brand health metric.

The Brief

Naya BrennanRetention Managersubscription-ops

Replenishment health review — I need the trailing-90-day skip rate by plan family. Skip rate = skipped events / (skipped + renewed events) per family, in the window 2026-01-01 to 2026-03-31. Four columns: plan_family, skipped, renewed, skip_rate_pct (rounded to 1 decimal). Sort skip_rate_pct descending, plan_family ascending. Skip rate above 12% is the early warning that customers are stockpiling product or losing engagement — Recovery Reds is the family I'm most worried about.

You'll practice

Conditional aggregationRatioGROUP BY

Tables & columns available

fact_subscription_eventsfact12 columns
ColumnTypeKey
event_idINTPK
subscription_idINTFK → fact_subscriptions
customer_idINTFK → dim_customers
event_typeTEXT
event_tsTEXT
posted_atTEXT
plan_idINTFK → dim_plans
from_plan_idINTFK → dim_plans
to_plan_idINTFK → dim_plans
mrr_deltaREAL
reason_codeTEXT
paused_untilTEXT
dim_plansdim5 columns
ColumnTypeKey
plan_idINTPK
plan_familyTEXT
cadenceTEXT
monthly_priceREAL
display_nameTEXT

Hints (4)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

Conditional aggregation: SUM(CASE WHEN event_type = 'skipped' THEN 1 ELSE 0 END) AS skipped, similar for renewed.

Hint 2

Filter event_ts BETWEEN '2026-01-01' AND '2026-03-31' AND event_type IN ('skipped', 'renewed') in the WHERE — narrowing in WHERE is faster than CASE-only filtering.

Hint 3

JOIN dim_plans on plan_id to get plan_family.

Hint 4

skip_rate_pct = ROUND(100.0 * skipped / NULLIF(skipped + renewed, 0), 1). The NULLIF avoids div-by-zero on a hypothetical empty plan family.