Eman-RazDistribution of Users Based on the TXs Count
    Updated 2024-01-16
    with tab1 as (select tx_from as user, count(distinct tx_id) as tx_count, case
    when count(distinct tx_id)=1 then 'n=1'
    when count(distinct tx_id)>1 and count(distinct tx_id)<=10 then '1<n<=10'
    when count(distinct tx_id)>10 and count(distinct tx_id)<=100 then '10<n<=100'
    when count(distinct tx_id)>100 and count(distinct tx_id)<=1000 then '100<n<=1000'
    when count(distinct tx_id)>1000 and count(distinct tx_id)<=10000 then '1k<n<=10k'
    when count(distinct tx_id)>10000 and count(distinct tx_id)<=100000 then '10k<n<=100k'
    when count(distinct tx_id)>100000 and count(distinct tx_id)<=1000000 then '100k<n<=1M'
    else 'n>1M'
    END AS "Class"
    from sei.core.fact_transactions
    where TX_SUCCEEDED='true' and block_timestamp::date>=current_date-{{Time_Period}}
    group by 1)

    select "Class", count(distinct user) as "User Count"
    from tab1
    group by 1


    QueryRunArchived: QueryRun has been archived