Rolling Window
Average or total the last few rows for every row. Daily noise becomes a smooth trend.
What it does
Rolling Window looks back over a fixed number of rows. It writes one result for each row. A 7-day moving average is the common case.
Before. Daily visits to a website:
| date | visits |
|---|---|
| 2026-03-01 | 100 |
| 2026-03-02 | 140 |
| 2026-03-03 | 120 |
| 2026-03-04 | 160 |
After. AVG of visits, window size 3, ordered by date:
| date | visits | avg_visits_rolling_3 |
|---|---|---|
| 2026-03-01 | 100 | 100 |
| 2026-03-02 | 140 | 120 |
| 2026-03-03 | 120 | 120 |
| 2026-03-04 | 160 | 140 |
The last row averages 140, 120 and 160. The first row has only itself.
Add a moving average
- Type rolling in the Search transforms box, in the Pipeline panel.
- Select Rolling Window in the results. The panel opens below the grid.
- Open Function and pick AVG (moving average), SUM, MIN, MAX or COUNT.
- Type a number in Window size (rows). The field starts at 7.
- Open Choose column… and pick the column to aggregate.
- Open Choose ordering column… and pick your date column. This field is required.
- Open Partition by (optional) and pick a group column, if you need one.
- Type a name in Output column name (optional).
- Click Apply.
The grid updates at once. The step appears in your pipeline, where you can edit or delete it later.
What window size means
The window is the current row plus the rows above it. A size of 7 uses the current row and 6 earlier rows.
The first rows have fewer rows above them. They use the rows that exist. The result at row 1 equals the value at row 1.
Tips
- Order by (required) has no default. Pick the date or time column for a series.
- The step counts rows, not days. A missing date makes the window cover a longer period.
- Use Partition by (optional) for one series for each store or product. The window then restarts in each group.
- Without a partition, the values of one group flow into the next group.
- Leave Output column name (optional) empty. The app then names the column avg_visits_rolling_7 or similar.
- Fill gaps in your dates first. A missing row cannot enter the window.
For SQL users
The step runs as one OVER clause with a row frame:
SELECT *, AVG("visits") OVER (ORDER BY "date" ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS "avg_visits_rolling_7" FROM data
Try Rolling Window with sample data →
Related Operations
- Pivot - Pivot table (rows to columns)
- Window Function - Rank, row number, lead, lag
- Smallest - Get nth smallest value as a column