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>, <aggregation_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", it's 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

The time window in wich the function will be computed.

NOTE: The selected range for a "window" should be set in a way that evenly divides 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:

this is a positive integer, representing the 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

YES

Min periods

Number of values ​​needed to calculate the mobile aggregation, by default it is set in 2 which is the minimum required.

min_periods = n, where n is a positive integer.

NO

Last updated