Rolling
This function returns the computed value of a data series within a time window or a given number of values, using one of the following aggregation methods: "mean", "sum", "min", "max", or "count".
The rolling function has the following syntax:
rolling(<variable>, <agreggation_method> , <type_of_range>, <range> , min periods = 2)
Parameter
Description
Value
Mandatory
variable
It shows the measurements of a sensor as a time series of data points that vary over time, also known as "dots", and is identified by a variable label.
variable label
YES
aggregation_method
Function where the elements of a time series are computed to return a single summary value.
​
meanmean
,
sumsum
,
minmin
,
maxmax
,
countcount
​
YES
type of range
Indicates whether a date range or a set number of elements are used to sample the time series.
​
windowwindow
or
valuesvalues
​
YES
range
A time window or a set of elements that will be computed by the function.
NOTE: The selected range for a "window" should be set in a way that evenly divide the next range. For example, if using minutes ("T"), whatever the number n is, it has to evenly divide an hour ("H"). Available values for minutes are: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30. Other values may render unexpected results. Same applies to other ranges.
Available data ranges:
positive Integer, fixed number of observations used for each window or a time range specified as follows:
​
​
"nT""nT"
: Every n minutes
​
"nH""nH"
: Every n hours
​
"nD""nD"
: Every n days,
​
"nD""nD"
: Every n months
YES
Min periods
Number of values ​​needed to calculate the mobile aggregation, by default it is set in 2 which is the minimum requiered.
min_periods = n, where n is a positive integer.
NO
Copy link