Quarter | Total Users | Churned Users | |
---|---|---|---|
1 | 2019-04-01 00:00:00.000 | 495 | 189 |
2 | 2019-07-01 00:00:00.000 | 631278 | 611563 |
3 | 2019-10-01 00:00:00.000 | 4208728 | 4076834 |
4 | 2020-01-01 00:00:00.000 | 2923405 | 2786759 |
5 | 2020-04-01 00:00:00.000 | 1797313 | 1705931 |
6 | 2020-07-01 00:00:00.000 | 780787 | 701451 |
7 | 2020-10-01 00:00:00.000 | 643030 | 519061 |
8 | 2021-01-01 00:00:00.000 | 529851 | 429405 |
9 | 2021-04-01 00:00:00.000 | 615045 | 491135 |
10 | 2021-07-01 00:00:00.000 | 597934 | 292831 |
11 | 2021-10-01 00:00:00.000 | 2714597 | 1918774 |
12 | 2022-01-01 00:00:00.000 | 2317153 | 1640620 |
13 | 2022-04-01 00:00:00.000 | 2509686 | 2089977 |
14 | 2022-07-01 00:00:00.000 | 1171352 | 941462 |
15 | 2022-10-01 00:00:00.000 | 991872 | 818225 |
16 | 2023-01-01 00:00:00.000 | 1268955 | 836799 |
17 | 2023-04-01 00:00:00.000 | 4094042 | 3812260 |
18 | 2023-07-01 00:00:00.000 | 2391372 | 2162316 |
19 | 2023-10-01 00:00:00.000 | 2362845 | 2091948 |
20 | 2024-01-01 00:00:00.000 | 5274921 | 5014470 |
i_danKaia: Churn Rate
Updated 2025-02-26
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
WITH last_activity AS ( -- Get the last quarter each user was active
SELECT
from_address
, MAX(DATE_TRUNC('quarter', block_timestamp)) AS last_active_quarter
FROM kaia.core.fact_transactions
GROUP BY 1
),
all_users AS ( -- Get all users who were active in each quarter
SELECT
DATE_TRUNC('quarter', block_timestamp) AS active_quarter
, from_address
FROM kaia.core.fact_transactions
),
churned_users AS ( -- Users who were last active in a quarter and never returned
SELECT
l.last_active_quarter AS churned_quarter
, COUNT(DISTINCT l.from_address) AS churned_users
FROM last_activity l
LEFT JOIN all_users a
ON l.from_address = a.from_address
AND a.active_quarter > l.last_active_quarter -- Check if they were active later
WHERE a.from_address IS NULL -- If NULL, they never returned
GROUP BY 1
)
-- Get total users per quarter and join with churned users
SELECT
a.active_quarter AS "Quarter"
, COUNT(DISTINCT a.from_address) AS "Total Users"
, COALESCE(c.churned_users, 0) AS "Churned Users"
FROM all_users a
LEFT JOIN churned_users c
ON a.active_quarter = c.churned_quarter
WHERE a.active_quarter < DATE_TRUNC('quarter', CURRENT_DATE) -- Exclude the current quarter
GROUP BY 1, 3
ORDER BY 1
Last run: about 1 month ago
23
989B
239s