feyikemiFlow Users % Diff
Updated 2024-08-03
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
›
⌄
WITH Users_July AS (
SELECT
DATE_TRUNC('month', block_timestamp) AS month,
COUNT(DISTINCT Authorizers[0]) AS Users
FROM
flow.core.fact_transactions
WHERE
block_timestamp::DATE >= '2024-01-01'
AND block_timestamp::DATE < '2024-08-01'
AND Tx_succeeded = 'True'
GROUP BY 1
)
SELECT
Month,
Users,
LAG(Users) OVER (ORDER BY Month) AS Previous_month_users,
IFF(
((Users - LAG(Users) OVER (ORDER BY Month)) / LAG(Users) OVER (ORDER BY Month)) * 100 < 0,
0,
((Users - LAG(Users) OVER (ORDER BY Month)) / LAG(Users) OVER (ORDER BY Month)) * 100
) AS Users_diff
FROM Users_July
ORDER BY Month DESC
QueryRunArchived: QueryRun has been archived