0xHaM-dNew Users quarterly
    Updated 2024-11-26
    -- forked from Txs quarterly @ https://flipsidecrypto.xyz/edit/queries/a0d45cdc-4ff3-4b25-9c3d-f9853372cfc9

    -- forked from hess / Volume quarterly @ https://flipsidecrypto.xyz/hess/q/RGFJgE22kinC/volume-quarterly

    with txs as (
    select
    min(block_timestamp) as block_timestamp,
    TX_FROM,
    from axelar.core.fact_transactions
    GROUP by 2
    )
    ,
    quarter as (
    select
    case
    when block_timestamp::date >= '2022-01-01' and block_timestamp::date < '2022-04-01' then 'Q1-2022'
    when block_timestamp::date >= '2022-04-01' and block_timestamp::date < '2022-07-01' then 'Q2-2022'
    when block_timestamp::date >= '2022-07-01' and block_timestamp::date < '2022-10-01' then 'Q3-2022'
    when block_timestamp::date >= '2022-10-01' and block_timestamp::date < '2023-01-01' then 'Q4-2022'
    when block_timestamp::date >= '2023-01-01' and block_timestamp::date < '2023-04-01' then 'Q1-2023'
    when block_timestamp::date >= '2023-04-01' and block_timestamp::date < '2023-07-01' then 'Q2-2023'
    when block_timestamp::date >= '2023-07-01' and block_timestamp::date < '2023-10-01' then 'Q3-2023'
    when block_timestamp::date >= '2023-10-01' and block_timestamp::date < '2024-01-01' then 'Q4-2023'
    when block_timestamp::date >= '2024-01-01' and block_timestamp::date < '2024-04-01' then 'Q1-2024'
    when block_timestamp::date >= '2024-04-01' and block_timestamp::date < '2024-07-01' then 'Q2-2024'
    when block_timestamp::date >= '2024-07-01' and block_timestamp::date < '2024-10-01' then 'Q3-2024'
    when block_timestamp::date >= '2024-10-01' and block_timestamp::date < '2025-01-01' then 'Q4-2024' end as type,
    *
    from txs
    )

    select
    trunc(block_timestamp,'day') as daily,
    type,
    count(DISTINCT TX_FROM) as new_users,
    sum(new_users) over (partition by type order by daily asc) as Quarterly
    QueryRunArchived: QueryRun has been archived