amin2234-34172.1 cat tr
    Updated 2023-02-05
    with
    base as (select DISTINCT TX_SIGNER as unique_users_total,COUNT(DISTINCT TX_HASH) as number_of_tx_total
    from near.core.fact_transactions
    where BLOCK_TIMESTAMP>= CURRENT_DATE-14
    GROUP BY 1)

    select case WHEN number_of_tx_total=1 then 'one time'
    WHEN number_of_tx_total<5 and number_of_tx_total>1 then 'between 1 and 5'
    WHEN number_of_tx_total<10 and number_of_tx_total>5 then 'between 5 and 10 '
    WHEN number_of_tx_total between 10 and 50 then 'between 10 and 50'
    WHEN number_of_tx_total between 50 and 100 then 'between 50 and 100'
    WHEN number_of_tx_total between 100 and 500 then 'between 100 and 500'
    WHEN number_of_tx_total between 500 and 1000 then 'between 500 and 1000'
    ELSE 'more than 1000' end as categ,
    COUNT(unique_users_total) as number
    from base
    GROUP BY 1
    Run a query to Download Data