Rolling
Compute a rolling value over a time window or number of values using mean, sum, min, max, or count.
The rolling function has the following syntax:
rolling(<variable>, <aggregation_method>, <type_of_range>, <range>, min_periods = 2)
Variable
Represents the measurements of a sensor as a time series of data points that vary over time. Also known as "dots", it is identified by a variable label.
Variable label
YES
Aggregation method
Computes the elements of a time series to return a single summary value.
mean, sum, min, max, count
YES
Type of range
Indicates whether a date range or a fixed number of elements is used to sample the time series.
window or values
YES
Range
The time window in which the function is computed.
Note: Set the selected range for a "window" so it evenly divides the next range. For example, if you use minutes ("T"), the number n must evenly divide an hour ("H"). Available minute values are 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, and 30. Other values may produce unexpected results. The same applies to other ranges.
Available data ranges:
This is a positive integer that represents the number of observations used for each window, or a time range specified as follows:
"nT": Every n minutes
"nH": Every n hours
"nD": Every n days
YES
Min periods
Number of values needed to calculate the rolling aggregation. By default, it is set to 2, which is the minimum required.
min_periods = n, where n is a positive integer.
NO
Last updated
Was this helpful?