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:

datevisits
2026-03-01100
2026-03-02140
2026-03-03120
2026-03-04160

After. AVG of visits, window size 3, ordered by date:

datevisitsavg_visits_rolling_3
2026-03-01100100
2026-03-02140120
2026-03-03120120
2026-03-04160140

The last row averages 140, 120 and 160. The first row has only itself.

Add a moving average

  1. Type rolling in the Search transforms box, in the Pipeline panel.
  2. Select Rolling Window in the results. The panel opens below the grid.
  3. Open Function and pick AVG (moving average), SUM, MIN, MAX or COUNT.
  4. Type a number in Window size (rows). The field starts at 7.
  5. Open Choose column… and pick the column to aggregate.
  6. Open Choose ordering column… and pick your date column. This field is required.
  7. Open Partition by (optional) and pick a group column, if you need one.
  8. Type a name in Output column name (optional).
  9. 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