Return and repeat in 14 days: Apr 2025, KZ
Instructions
A user's first purchase is their earliest record in purchases (over the whole history). Take users from the country 'KZ' whose first purchase (p1) fell in April 2025 (from April 1, 2025 to April 30, 2025 inclusive). A user returned if they have an 'open' event strictly later than p1 and no later than p1 + 14 days (p1 + interval '14 days'); a user made a repeat purchase if purchases has a purchase of theirs strictly later than p1 and no later than p1 + 14 days. For each platform (users.platform), output platform, buyers (the number of such users), returned and repurchased (the number of users who returned and who made a repeat purchase; each user once), returned_pct and repurchased_pct (these numbers as a percentage of buyers, × 100, rounded to 1 decimal place). Sort by platform.
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.