FatemeTheLady02 DimensionX
    Updated 2023-03-31
    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