Eman-RazDistribution of Users By Transaction
    Updated 2025-01-19
    with classification as (with tab1 as (select signers[0] as user, count(distinct tx_id) as txns_count, case
    when count(distinct tx_id)=1 then 'n=1 Txn'
    when count(distinct tx_id)>1 and count(distinct tx_id)<=5 then '1<n<=5 Txns'
    when count(distinct tx_id)>5 and count(distinct tx_id)<=10 then '5<n<=10 Txns'
    when count(distinct tx_id)>10 and count(distinct tx_id)<=20 then '10<n<=20 Txns'
    when count(distinct tx_id)>20 and count(distinct tx_id)<=50 then '20<n<=50 Txns'
    when count(distinct tx_id)>50 and count(distinct tx_id)<=100 then '50<n<=100 Txns'
    when count(distinct tx_id)>100 then 'n>100 Txns'
    end as "Number of Txns"
    from eclipse.core.fact_transactions
    where succeeded='TRUE'
    group by 1)

    select "Number of Txns", count(distinct user) as "Number of Users"
    from tab1
    group by 1),

    total_users as (select count(distinct signers[0]) as "Total Users"
    from eclipse.core.fact_transactions
    where succeeded='TRUE')

    select "Number of Txns", "Number of Users", round((("Number of Users"/"Total Users")*100),3) || '%' || '' as "Percentage of Users"
    from classification, total_users
    order by 2 desc
    QueryRunArchived: QueryRun has been archived