freemartianWeekly Cumulative New & Active Users
Updated 2022-12-06
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
›
⌄
with source as (
select
tx_sender,
min(block_timestamp::date) as first_day
from terra.core.fact_transactions
where TX_SUCCEEDED = 'TRUE'
group by tx_sender)
select
'New_Users' as label,
date_trunc('week', first_day) as TIME,
count(tx_sender) as count,
sum(count) over (order by TIME) as cumulative_new_users
from source
where first_day >= CURRENT_DATE - {{Past_X_Days}}
group by label, time
UNION
select
'Active_Users' as label,
date_trunc('week', block_timestamp::date) as TIME,
count(distinct tx_sender) as count,
sum(count) over (order by TIME) as cumulative_active_users
from terra.core.fact_transactions
where TX_SUCCEEDED = 'TRUE'
and block_timestamp >= CURRENT_DATE - {{Past_X_Days}}
group by label, TIME
Run a query to Download Data