⚡️ Getting Started

Date range

Ubidots allows you to build new variables from a time series based on date range data, i. e, calculate mean, sum, median per hour, per day, etc., using a synthetic variable based on your sensor inputs

Below you can find the commonly used date range functions.

Function

Description

$max(x, range)$

Returns the maximum value of the variable x in the specified date range.

$min(x, range)$

Returns the minimum value of the variable x in the specified date range.

$mean(x, range)$

Returns the mean value of the variable x in the specified date range.

$std(x, range)$

Returns the standard deviation of the variable x in the specified date range.

$count(x, range)$

Returns the number of dots stored in the variable x for the specified date range.

$last(x, range)$

Returns the last value of the time-series variable x in the specified date range.

$first(x, range)$

Returns the first value of the time-series variable x in the specified date range.

$sum(x, range)$

Returns the sum of the dots stored in the variable x in the specified date range.

Date Range functions have the following syntax:

** aggregation_method(<variable>,<range>,<position>,<offset> )**

Parameters

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

Range

Time window the function will be computed within.

Available data ranges:

"**nH"** : Every n hours,

"**M"** : Every end of month

YES

Position

Indicates whether the output value will be timestamped at the start of the time series or at the end.

position ="start" or position = "end"

NO

Offset

Sets the hour at which our synthetic variable engine will begin to compute the variable, which is the number of hours after midnight. By default is 0 hours.

Any integer between 1 and 23

NO

Last modified 2mo ago

Copy link