Updated 2023-06-09
    with maintable as (
    select date,
    address,
    sum (balance/pow(10,decimal)) as Balance
    from osmosis.core.fact_daily_balances
    where currency = 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2'
    group by 1,2)

    select date,
    case when balance < 10 then 'Less Than 10 $AXL'
    when balance >= 10 and balance < 100 then '10 - 100 $AXL'
    when balance >= 100 and balance < 1000 then '100 - 1000 $AXL'
    when balance >= 1000 and balance < 10000 then '1000 - 10000 $AXL'
    else 'More Than 10000 $AXL' end as balance_type,
    count (distinct address) as Users_Count
    from maintable
    group by 1,2
    Run a query to Download Data