Query editor
SELECTCASEWHEN LOWER(stage) IN ('pre seed', 'pre-seed') THEN 'Pre-Seed'WHEN LOWER(stage) LIKE 'seed%' THEN 'Seed'WHEN LOWER(stage) LIKE '%serie a%' OR LOWER(stage) LIKE '%series a%' THEN 'Serie A'ELSE 'Other'END AS unified_stage,COUNT(*) AS stage_count,ROUND(AVG(CAST(REGEXP_REPLACE(TRIM(post_money_valuation), '[$,]', '') AS DOUBLE)), 2) AS avg_post_money_valuationFROM dune.mateo_pbw.dataset_pbw_start_in_block_2025WHERE TRIM(post_money_valuation) != ''AND (((LOWER(stage) LIKE '%serie a%' OR LOWER(stage) LIKE '%series a%')AND CAST(REGEXP_REPLACE(TRIM(post_money_valuation), '[$,]', '') AS DOUBLE) >= 4000000)OR(NOT (LOWER(stage) LIKE '%serie a%' OR LOWER(stage) LIKE '%series a%')AND CAST(REGEXP_REPLACE(TRIM(post_money_valuation), '[$,]', '') AS DOUBLE) > 100))AND CAST(REGEXP_REPLACE(TRIM(post_money_valuation), '[$,]', '') AS DOUBLE) <= 500000000GROUP BYCASEWHEN LOWER(stage) IN ('pre seed', 'pre-seed') THEN 'Pre-Seed'WHEN LOWER(stage) LIKE 'seed%' THEN 'Seed'WHEN LOWER(stage) LIKE '%serie a%' OR LOWER(stage) LIKE '%series a%' THEN 'Serie A'ELSE 'Other'ENDORDER BY stage_count DESC;