Query editor
WITH t_ AS (SELECT t.* FROM dune.kxnshwdwn.result_showdown_tournaments t LEFT JOIN dune.kxnshwdwn.dataset_showdown_games g ON g.id = t.platform_id WHERE '{{game}}' = 'All' OR ('{{game}}' = 'CS2' AND g.game = 'CS2') OR ('{{game}}' = 'Chess' AND g.game = 'LICHESS'))SELECT count(*) AS tournaments_created,count(CASE WHEN started_at IS NOT NULL THEN 1 END) AS tournaments_started,count(CASE WHEN status = 'finalized' THEN 1 END) AS tournaments_finalized,round(100.0 * count(CASE WHEN started_at IS NOT NULL THEN 1 END) / count(*), 1) AS start_rate_pct,round(100.0 * avg(fill_ratio), 1) AS avg_fill_pct,round(100.0 * count(CASE WHEN fill_ratio >= 0.5 THEN 1 END) / count(*), 1) AS half_filled_pct,round(100.0 * count(CASE WHEN fill_ratio >= 1 THEN 1 END) / count(*), 1) AS fully_filled_pct,sum(joins) AS total_joins,sum(max_participants) AS total_capacity,round(avg(max_participants), 1) AS avg_capacityFROM t_