Query editor
WITHgetAllBetVolume as (SELECTamount_usdFROMquery_4842793WHEREuser IS NOT NULLAND CASEWHEN '{{chain}}' = 'All' THEN 1 = 1ELSE blockchain = '{{chain}}'ENDAND CASEWHEN '{{token}}' = 'All' THEN 1 = 1ELSE symbol = '{{token}}'ENDAND evt_block_time BETWEEN CAST('{{start date}}' AS TIMESTAMP) AND CAST('{{end date}}' AS TIMESTAMP)),setGroupings as (selectcasewhen amount_usd = 0 then 'Exited'when amount_usd <= 5 then '$0 - $5'when amount_usd <= 20 then '$5 - $20'when amount_usd <= 50 then '$20 - $50'when amount_usd <= 100 then '$50 - $100'when amount_usd <= 200 then '$100 - $200'when amount_usd <= 500 then '$200 - $500'when amount_usd <= 1000 then '$500 - $1000'when amount_usd <= 3000 then '$1000 - $3000'else '> $3000'end as bet_amount,casewhen amount_usd = 0 then 0when amount_usd <= 5 then 1when amount_usd <= 20 then 2when amount_usd <= 50 then 3when amount_usd <= 100 then 4when amount_usd <= 200 then 5when amount_usd <= 500 then 6when amount_usd <= 1000 then 7when amount_usd <= 3000 then 8else 9end as orderingfromgetAllBetVolume)select'Bet Size(USD)' as label,ordering,bet_amount,count(*) as transaction_countfromsetGroupingsWHEREbet_amount != 'Exited'group by1,2,3