← Retention, funnels, cohorts

Churn as of Jun 15, 2025: 21 days without events, ios

Level: Middle100 XP

Instructions

The reporting date is June 15, 2025; only events strictly before this date are counted. An active user is one who has at least one event strictly before June 15, 2025. An active user is considered churned if in the last 21 days before the reporting date, from May 25, 2025 to June 14, 2025 inclusive, they have no events at all (that is, their last event is strictly before May 25, 2025). For active users of the platform 'ios', 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