Rolling Window
Moving average, sum, min, or max over a sliding window of rows
What It Does
Rolling Window computes a running aggregate (AVG, SUM, MIN, MAX, COUNT) over a sliding window that includes the current row plus a configured number of preceding rows. Common uses: 7-day moving averages, trailing 30-row sums, smoothing noisy time series.
How to Use It
Opening the Panel
Click the + button in the toolbar or press the operation picker, then search for "Rolling Window". It's in the Aggregate group.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
Source column | Column select (numeric) | Yes | Column to aggregate over |
Aggregation | Select | Yes | AVG, SUM, MIN, MAX, COUNT |
Window size | Number | Yes | How many rows back from the current row to include |
Order by | Column select | Yes | Column that defines row order (often a date) |
Partition by | Column select | No | If set, the window resets per partition |
Output column | Text | Yes | Name of the new column |
SQL generated under the hood
SELECT *, AVG(revenue) OVER (PARTITION BY region ORDER BY order_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS revenue_7d_avg FROM data
Related Operations
- Pivot - Pivot table (rows to columns)
- Window Function - Rank, row number, lead, lag
- Smallest - Get nth smallest value as a column