← Retention, funnels, cohorts

Churn as of Apr 1, 2025: 30 days without events, web

Level: Middle100 XP

Instructions

The reporting date is April 1, 2025; only events strictly before this date are counted. An active user is one who has at least one event strictly before April 1, 2025. An active user is considered churned if in the last 30 days before the reporting date, from March 2, 2025 to March 31, 2025 inclusive, they have no events at all (that is, their last event is strictly before March 2, 2025). For active users of the platform 'web', by signup month (cohort_month is the first day of the month of signup_at), output cohort_month, active_users (the number of active users), churned (the number of churned users) and churn_pct (churned / active_users × 100, rounded to 1 decimal place). Users with no events before the reporting date are not counted. Sort by cohort_month.

Hints

Each next one is more detailed and costs more

Log in to open hints

Query

Result

Click Run to see the query result, or Check to submit your solution.

Dataset schema

events.user_id (0…N) ↔ users.id (1…1)purchases.user_id (0…N) ↔ users.id (1…1)eventsPKidintegerFKuser_idintegerpurchasesPKidintegerFKuser_idintegerusersPKidinteger
Exactly oneZero or oneZero or more
Table relationships
  • N:1Many-to-oneevents.user_id → users.id
  • N:1Many-to-onepurchases.user_id → users.id

Table data

PostgreSQL

Select a table in the diagram or list to view its rows.

Dataset schema