experimental.window() function is subject to change at any time.
By using this function, you accept the risks of experimental functions.
experimental.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
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
import "experimental" experimental.window( every: 5m, period: 5m, offset: 12h, location: "UTC", createEmpty: false, )
Calendar months and years
offset support all valid duration units,
including calendar months (
1mo) and years (
Duration of time between windows.
Duration of the window.
Period is the length of each interval.
It can be negative, indicating the start and stop boundaries are reversed.
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
Location used to determine timezone.
Default is the
Flux uses the timezone database (commonly referred to as “tz” or “zoneinfo”) provided by the operating system.
Specifies whether empty tables should be created.
Default is piped-forward data (
Window data into 10 minute intervals
import "experimental" from(bucket:"example-bucket") |> range(start: -12h) |> experimental.window(every: 10m) // ...
Window by calendar month
import "experimental" from(bucket:"example-bucket") |> range(start: -1y) |> experimental.window(every: 1mo) // ...
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, use the following resources:
InfluxDB Cloud customers can contact InfluxData Support.