Spending retention 'health', premium: May–Aug 2025
Instructions
A client's transaction is any transactions record on any of the client's accounts (accounts.client_id). A client of the segment 'premium' is active in the category 'health' in a month if they have at least one transaction of this category (transactions.category) in that calendar month. For each month from May 1, 2025 to August 31, 2025 inclusive, output month (the first day of the month, type date), active (the number of clients active in the category), retained (how many of them are active in the same category in the next calendar month too) and retention_pct (retained / active × 100, rounded to 1 decimal place). Do not output months with no active clients. Sort by month.
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
accounts.→client_id clients.id - N:1Many-to-one
transactions.→account_id accounts.id
Table data
Select a table in the diagram or list to view its rows.