Delamir-6014E01-3 Number of users per week
    Updated 2022-11-17
    with user_list as (
    select
    from_address as users,
    min(block_timestamp) as min_date,
    count( tx_hash) as txs
    from ethereum_core.fact_transactions
    -- where min_date >= '2022-01-01'
    group by 1
    )
    , ts as (
    select
    date_trunc(week,min_date) as date,
    case
    when date >= '2015-01-01' and date < '2016-01-01' then '2015'
    when date >= '2016-01-01' and date < '2017-01-01' then '2016'
    when date >= '2017-01-01' and date < '2018-01-01' then '2017'
    when date >= '2018-01-01' and date < '2019-01-01' then '2018'
    when date >= '2019-01-01' and date < '2020-01-01' then '2019'
    when date >= '2020-01-01' and date < '2021-01-01' then '2020'
    when date >= '2021-01-01' and date < '2022-01-01' then '2021'
    else '2022' end as timespin ,
    count(users) as number_users
    from user_list
    -- where date >= '2022-01-01'
    group by 1,2
    order by 1
    )
    select
    date,
    sum(number_users) over (order by date) as Cumulative,
    Timespin,
    number_users
    from ts
    group by 1,3,4
    order by 1
    Run a query to Download Data