Data Structures

When having a look at some previous examples, it might not be directly obvious, but we are actually not always working just with single values, such as a number. We also had a look at examples which are actually working with a multi-value set, such as when calculating an average.

So each literal has not only a Data Type, but also a Data Structure. Here you see the full list:

Scalar

A single value is stored in a Scalar data structure.

Generally all values are Scalars, but you typically also get Scalars when evaluating boolean or arithmetic operations.

Examples

99.5

Example with $PowerConsumption with dataset of name PowerConsumption of type Single Value:

AVG($PowerConsumption)

Vector

A set of values is stored in a Vector data structure.

Generally only variables, or operations and functions on top of variables, may produce Vectors.

Examples:

Example with $PowerConsumption with dataset of name PowerConsumption of type Time Series:

SUBSET($PowerConsumption, now-24h)

GroupedScalar

A list of single values, grouped by device or time.

Generally only variables in combination with a GROUP_BY_DEVICE or GROUP_BY_TIME function may produce a GroupedScalar.

Examples

AVG(GROUP_BY_DEVICE($PowerConsumption)) with Dataset of name PowerConsumption with type Time Series

GroupedVector

A list of list of value sets, grouped by device or time.

Generally only variables in combination with a GROUP_BY_DEVICE or GROUP_BY_TIME function may produce a GroupedVector.

Examples

GROUP_BY_DEVICE($PowerConsumption) with Dataset of name PowerConsumption with type Time Series

Last updated

© 2023 MOOST AG