Returns after a pause over 7 days: UA/ios
Instructions
A user's pause is the time between two consecutive events of the user (by event_time). For users from the country 'UA' with platform 'ios', find all returns after a pause strictly longer than 7 days (compare the exact interval, not the difference of dates). Output user_id, break_from (the time of the last event before the pause), break_to (the time of the first event after it) and pause_days (the length of the pause in days, rounded to 1 decimal place). Sort by the exact pause length descending (not by the rounded pause_days), then user_id, then break_to ascending.
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.