Day-3 retention by week: 8 weeks from February 3, 2025
Instructions
A cohort is the users who signed up (users.signup_at) in one calendar week; a week starts on Monday, and cohort_week is the date of that Monday (date_trunc('week', signup_at)::date). Take the users who signed up from February 3, 2025 to March 30, 2025 inclusive. A user is retained on day 3 if they have at least one event (events) on exactly the 3rd calendar day after signup: event_time::date = signup_at::date + 3 (the signup day is day 0). For each cohort, output cohort_week, cohort_size (the number of users in the cohort, including those with no events at all), retained (the number of retained users; each is counted once) and retention_pct (retained / cohort_size × 100, rounded to 1 decimal place). Sort by cohort_week.
Hints
Each next one is more detailed and costs more
Query
Result
Click Run to see the query result, or Check to submit your solution.
Dataset schema
Table relationships
- N:1Many-to-one
events.→user_id users.id - N:1Many-to-one
purchases.→user_id users.id
Table data
Select a table in the diagram or list to view its rows.