experimental.window() function

The experimental.window() function is subject to change at any time. By using this function, you accept the risks of experimental functions.

The window() function groups records based on a time value. New columns are added to uniquely identify each window. Those columns are added to the group key of the output tables. Input tables must have _start, _stop, and _time columns.

A single input record will be placed into zero or more output tables, depending on the specific windowing function.

By default the start boundary of a window will align with the Unix epoch (zero time) modified by the offset of the location option.

  every: 5m,
  period: 5m,
  offset: 12h,
  createEmpty: false


Calendar months and years

every, period, and offset support all valid duration units, including calendar months (1mo) and years (1y).


(Required) Duration of time between windows. Defaults to period value.

Data type: Duration


Duration of the window. Period is the length of each interval. It can be negative, indicating the start and stop boundaries are reversed. Defaults to every value.

Data type: Duration


Offset is the duration by which to shift the window boundaries. It can be negative, indicating that the offset goes backwards in time. Defaults to 0, which will align window end boundaries with the every duration.

Data type: Duration


Specifies whether empty tables should be created. Defaults to false.

Data type: Boolean


Window data into 10 minute intervals

  |> range(start: -12h)
  |> window(every: 10m)
  // ...

Window by calendar month

  |> range(start: -1y)
  |> window(every: 1mo)
  // ...

Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: