Query editor
-- new_brands and new_contacts are per-day distinct counts (from-- COUNT(DISTINCT BRAND/EMAIL) ... GROUP BY DAY) — not true deltas. SUM()-- would overcount when the same brand/contact appears on multiple days.-- Running MAX() gives the correct cumulative snapshot and matches the-- Monthly Summary query + KPI totals.WITH latest AS (SELECT MAX(run_id) AS rid FROM dune.w3io.dealsync_network)SELECTdate,MAX(new_brands) OVER (ORDER BY date) AS cumulative_brands,MAX(new_contacts) OVER (ORDER BY date) AS cumulative_contacts,new_brands,new_contacts,deals_with_value,deal_pipeline_value_usdFROM dune.w3io.dealsync_network tJOIN latest l ON t.run_id = l.ridORDER BY date