forgashflow stats: weekly active users copy
Updated 2024-05-30Copy Reference Fork
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
›
⌄
-- forked from adriaparcerisas / flow stats: weekly active users @ https://flipsidecrypto.xyz/adriaparcerisas/q/MzwH_ymY7_d2/flow-stats-weekly-active-users
with news as (
SELECT
distinct authorizers [0] as users,
min(trunc(block_timestamp, 'week')) as debut
from
flow.core.fact_transactions
group by
1
),
news2 as (
select
distinct debut,
count(distinct users) as new_users
from
news
group by
1
),
actives as (
SELECT
trunc(block_timestamp, 'week') as week,
count(distinct authorizers [0]) as active_users
from
flow.core.fact_transactions x
group by
1
order by
1 desc
),
final as (
select
week,
active_users,
new_users,
sum(new_users) over (
QueryRunArchived: QueryRun has been archived