Like a sports scoreboard that shows both the current score and the running total without collapsing all games.
Window functions compute across rows related to the current row without collapsing them (unlike GROUP BY). Running total: sum of all rows up to current. Moving average: average over last 7 rows.
> row: 2024-01-07, revenue=1200 > running_total: 8450 (sum so far) > moving_avg_7d: 942 (last 7 days avg) > rank_in_region: 2 (second in East)
Like a sports scoreboard that shows both the current score and the running total without collapsing all games.
Window functions compute across rows related to the current row without collapsing them (unlike GROUP BY). Running total: sum of all rows up to current. Moving average: average over last 7 rows.
> row: 2024-01-07, revenue=1200 > running_total: 8450 (sum so far) > moving_avg_7d: 942 (last 7 days avg) > rank_in_region: 2 (second in East)
Sign in to cast your vote
Sign in to share your feedback and join the discussion.