FatemeTheLady02 DimensionX
Updated 2023-03-31
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
›
⌄
with
tbl1 as (
select distinct a.tx_id, proposer, a.block_timestamp
from flow.core.fact_transactions a join flow.core.fact_events b on a.tx_id = b.tx_id
where
event_contract ilike '%dimension%'
and a.tx_succeeded = 'true')
,
users as (
select date_trunc('month', t.block_timestamp) as Month, count(distinct t.proposer) as count_user
from tbl1 t
group by 1)
,
new as ( select date_trunc('month',min_date) as Month, count(proposer) as new_users
from (select proposer, min(block_timestamp) as min_date from tbl1 group by 1)
group by 1)
select *,
sum("New Users") over(order by "Month" asc) as "Total Users"
from
(select
users.Month as "Month",
new_users as "New Users",
count_user as "Active Users"
from
users join new on users.Month = new.Month
order by 1 asc)
order by 1 asc
Run a query to Download Data