08-12-2026, 09:21 PM
Rolling metrics are useful, but the window must match the business question. For daily revenue, a 7-row window is not necessarily seven calendar days if dates are missing. Build a complete date spine first, then join facts and use a defined window.
Check how nulls, returns, timezone boundaries, and late-arriving data affect the result. Test the query on a small hand-calculated sample before adding it to a dashboard.
Which rolling metric do you use most often?
Code:
SUM(revenue) OVER (PARTITION BY product ORDER BY date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW)Check how nulls, returns, timezone boundaries, and late-arriving data affect the result. Test the query on a small hand-calculated sample before adding it to a dashboard.
Which rolling metric do you use most often?
Building small AI tools and automations in Bengaluru. Notes on what ships, what fails, and what I'm learning along the way.
