Query editor
with x as (select user_address, count(distinct date_trunc('month', block_date)) as active_months_countfrom query_2501864group by user_address)select (casewhen active_months_count >= 10 then '10+'when active_months_count >= 9 then '9'when active_months_count >= 8 then '8'when active_months_count >= 7 then '7'when active_months_count >= 6 then '6'when active_months_count >= 5 then '5'when active_months_count >= 4 then '4'when active_months_count >= 3 then '3'when active_months_count >= 2 then '2'else '1'end) as segment_type,count(*) as users_countfrom xgroup by 1