Query editor
withtmp as (selectcasewhen total_value >= 100 then 1when total_value >= 10 then 2when total_value >= 1 then 3when total_value >= 0.1 then 4when total_value >= 0.01 then 5when total_value > 0 then 6when total_value <= 0 then 7else 8 end as id, casewhen total_value >= 100 then 'x >= 100'when total_value >= 10 then 'x < 100 and x >= 10'when total_value >= 1 then 'x < 10 and x >= 1'when total_value >= 0.1 then 'x < 1 and x >= 0.1'when total_value >= 0.01 then 'x < 0.1 and x >= 0.01'when total_value > 0 then 'x < 0.01 and x > 0'when total_value <= 0 then 'x = 0'else 'Others' end as range, count(*) as cnt, cast(count(*) as double) / cast((select count(*) from query_2746398) as double) as perfrom query_2746398group by 1, 2)select*, sum(cnt) over (order by id) as cu_cnt, sum(per) over (order by id) as cu_perfrom tmporder by id