Hadisehweekly transactions
    Updated 2022-09-15
    with new_user as ( select min(block_timestamp) as day, tx_signer
    from near.core.fact_transactions
    group by 2)
    ,
    tb1 as ( select trunc(day,'week') as weekly,
    count(DISTINCT tx_signer) as total_transaction,
    sum(total_transaction) over (order by weekly asc) as cumulative_new
    from new_user
    group by 1)
    ,
    tb2 as ( select *
    from new_user
    where day::date >= CURRENT_DATE - 360)

    select trunc(block_timestamp,'week') as week,
    count(DISTINCT tx_hash) as count_tx,
    sum(count_tx) over (order by week asc) as cumulative_tx
    from near.core.fact_transactions
    where tx_signer in ( select tx_signer from tb2)
    group by 1
    order by 1
    Run a query to Download Data