RamaharCategory User involved
Updated 2022-11-08Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
›
⌄
With
fnl as ( select date(block_timestamp) as dayz, origin_from_address as from_address, origin_to_address, tx_hash, event_name
from optimism.core.fact_event_logs
where block_timestamp::date >= '2022-05-01'
)
select
dayz,
LABEL_TYPE,
count(DISTINCT from_address) as daily_user,
count(DISTINCT(tx_hash)) as daily_total,
sum(daily_user) over (partition by LABEL_TYPE) as user,
sum(daily_total) over (partition by LABEL_TYPE) as total,
sum(daily_user) over (partition by LABEL_TYPE order by dayz asc rows between unbounded preceding and current row) as cumu_users,
sum(daily_total) over (partition by LABEL_TYPE order by dayz asc rows between unbounded preceding and current row) as cumu_total
from fnl a join optimism.core.dim_labels b on a.origin_to_address = b.address
group by 1, 2
order by 6 desc
Run a query to Download Data