rajsUntitled Query
Updated 2023-01-09
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 new_users as
(
SELECT
-- *
tx_sender,
min(block_timestamp) as date_joined
from terra.core.fact_transactions
group by 1
)
,
new_users_sum as
(
SELECT
date_trunc('week', date_joined) as date,
count(tx_sender) as no_of_new_users
from new_users
group by 1
)
,
active_users as
(
SELECT
date_trunc('week', block_timestamp) as date,
count(distinct tx_sender) as no_of_active_users
from terra.core.fact_transactions
group by 1
)
SELECT
a.*,
no_of_new_users,
sum(no_of_new_users) over (order by n.date) as cum_no_of_users
from active_users a
left join new_users_sum n
Run a query to Download Data