Query editor
WITH getHealthFactor AS (SELECT total_supplied_usd,health_factor FROM query_1890475),setGroupings as (selectcasewhen health_factor <= 1.1 then '< 1.1'when health_factor <= 1.3 then '1.1 - 1.3'when health_factor <= 1.5 then '1.3 - 1.5'when health_factor <= 1.8 then '1.5 - 1.8'when health_factor <= 1.9 then '1.8 - 1.9'when health_factor <= 2 then '1.9 - 2'end as health,casewhen health_factor <= 1.1 then 1when health_factor <= 1.3 then 2when health_factor <= 1.5 then 3when health_factor <= 1.8 then 4when health_factor <= 1.9 then 5when health_factor <= 2 then 6end as order_no,*fromgetHealthFactor)select'Health Factor' as label,order_no,health,SUM(total_supplied_usd)fromsetGroupingsWHERE health is NOT NULLgroup by1,2,3order by1 ASC;