← Practice

WAU: new and returning, ios, 4 weeks from February 10, 2025

Level: MiddleTopic: Retention, funnels, cohorts100 XP

Instructions

A week starts on Monday (date_trunc('week', …)). For users of the platform 'ios', count for each week from February 10, 2025 to March 9, 2025 inclusive (by event_time): wau (the number of distinct users with at least one event in that week), new_users (how many of them signed up (users.signup_at) in that same week), returning_users (how many signed up in one of the earlier weeks) and returning_pct (returning_users / wau × 100, rounded to 1 decimal place). Output week (the date of the Monday, type date), wau, new_users, returning_users, returning_pct. Sort by week.

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