New account activity (debit): cohorts Apr–Jun 2025, 0–3
Instructions
A cohort is the accounts of type 'debit' opened (accounts.opened_at) in one calendar month; take the accounts opened from April 1, 2025 to June 30, 2025 inclusive. The offset month_offset is the number of calendar months between the opening month and the transaction month (0 is the opening month). An account is active in a month if it has at least one transaction (transactions.tx_time) in that month. For each cohort (cohort_month is the first day of the month) and each offset from 0 to 3, output cohort_month, month_offset, active_accounts (the number of active accounts of the cohort, 0 if there are none) and active_pct (active_accounts / the number of accounts in the cohort × 100, rounded to 1 decimal place; the denominator is all accounts of the cohort, including those without transactions). Sort by cohort_month, then month_offset.
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.