Query editor
withaddr as (SELECTDATE_TRUNC('week', evt_block_time) as week,'USDT' as contract_label,"from","to",sum(value * power(10,-6)) as value --decimal adjustmentFROM tether_tron.tether_usd_evt_transferGROUP BY 1,2,3,4)select week,case when value >0 and value <1000 then '<1K'when value >=1000 and value <10000 then '<10K'when value >=10000 and value <100000 then '<100K'when value >=100000 and value <1000000 then '<100K'when value >=1000000 and value <10000000 then '<1M'when value >=10000000 and value <100000000 then '<10M'when value >=100000000 and value <1000000000 then '<100M'when value >=1000000000 then '>=100M'end as tier,count(distinct "from") number_of_from,count(distinct "to") number_of_to,sum(value) amountfrom addrgroup by 1,2