Operations

Every operation is of form: OP argument1 , or argument1 OP argument2 and returns a value.

In the following section, each operation is listed, including the data structure and data type of each argument, and the return value. This is done by using form DataStructure<DataType>.

Plus (+)

Adding or concat two values with each other.

Signatures

#scalar-less-than-number-event-greater-than-+-scalar-less-than-number-event-greater-than

#scalar-less-than-time-greater-than-+-scalar-less-than-timestamp-greater-than

#scalar-less-than-timespan-greater-than-+-scalar-less-than-timestamp-greater-than

#scalar-vector-less-than-text-greater-than-+-scalar-vector-less-than-any-greater-than

Scalar<Number/Event> + Scalar<Number/Event>

Scalar<Number/Event> + Scalar<Number/Event> : Scalar<Number>

Two arguments of type Scalar<Numbers> added to each other result in a Scalar<Number> which is the sum of both arguments.


Scalar<Time> + Scalar<Timestamp>

Scalar<Time> + Scalar<Timestamp> : Scalar<Time>

Adding a Scalar<Time> with a Scalar<Timestamp> results in a Scalar<Time> which is a point in time after the Scalar<Time>.


Scalar<Timespan> + Scalar<Timestamp>

Scalar<Timespan> + Scalar<Timestamp> : Scalar<Time>

Adding a Scalar<Timestamp> to a Scalar<Timespan results in a Scalar<Time> which is far more in the future as stated by the Scalar<Timestamp>


Scalar/Vector<Text> + Scalar/Vector<any>

Scalar<Text> + Scalar<any> : Scalar<Text>
Scalar<Text> + Vector<any> : Scalar<Text>
Vector<Text> + Scalar<any> : Scalar<Text>
Vector<Text> + Vector<any> : Scalar<Text>

Adding a scalar or vector of type Boolean, Number, Time, Timespan, Text to a scalar or vector of type Text results in a new Scalar<Text with concatenated text elements. Non-text elements are implicitly formatted (see Format (|)). Vector elements are joined with commas.

Examples

Calculating 1 + 2 equals 3

1+2

Adding 8 hours to the last full hour results in 13:00 o'clock, when the lastZeroHour was 5:00 o'clock.

lastZeroHour + 8h

Adding 30min to 1h results in 1h30m

1h + 30min

Concat Text with the result of a function

'Consumption' + SUM($PowerConsumption) + ' W'

Minus (-)

Subtracting two values from each other.

Signatures

Scalar<Number/Event> - Scalar<Number/Event>

Scalar<Time> - Scalar<Time>

Scalar<Time> - Scalar<Timestamp>

Scalar<Timespan> - Scalar<Timestamp>

Scalar<Number/Event> - Scalar<Number/Event>

Scalar<Number/Event> - Scalar<Number/Event> : Scalar<Number>

Two arguments of type Scalar<Numbers> subtracted from each other result in a Scalar<Number> which is the result of the division.


Scalar<Time> - Scalar<Time>

Scalar<Time> - Scalar<Time> : Scalar<Time>

Subtracting a Scalar<Time> from another Scalar<Time> results in a Scalar<Time> which is a point in time before the first operator.


Scalar<Time> - Scalar<Timestamp>

Scalar<Time> - Scalar<Timestamp> : Scalar<Time>

Subtracting a Scalar<Timestamp> from a Scalar<Time> results in a Scalar<Time> which is a point in time before the Scalar<Time>.


Scalar<Timespan> - Scalar<Timestamp>

Scalar<Timespan> - Scalar<Timestamp> : Scalar<Time>

Subtracting a Scalar<Timestamp> from a Scalar<Timespan> results in a Scalar<Time> which is further in the past as stated by the Scalar<Timestamp>

Examples

Calculating 1 - 2 equals -1

1-2

Subtracting 8 hours to the last full hour results in 00:00 o'clock, when the lastZeroHour was 8:00 o'clock.

lastZeroHour - 8h

Subtracting 30min from 1h results in 30m.

1h - 30min

Multiply (*)

Multiply two values with each other.

Signatures

Scalar<Number/Event> * Scalar<Number/Event>

Scalar<Number/Event> * Scalar<Number/Event>

Scalar<Number/Event> * Scalar<Number/Event> : Scalar<Number>

Two arguments of type Scalar<Number> multiplied with each other result in a Scalar<Number> which is the result of the multiplication.

Examples

Calculating 1.5 multiplied by the SUM of the PowerConsumption

1.5 * SUM($PowerConsumption)

Divide (/)

Divide two values by each other.

Signatures

Scalar<Number/Event> / Scalar<Number/Event>

Scalar<Number/Event> / Scalar<Number/Event>

Scalar<Number/Event> / Scalar<Number/Event> : Scalar<Number>

Two arguments of type Scalar<Number> divded by each other result in a Scalar<Number> which is the result of the division.

Examples

Calculating 3 divided by 2 results in 1.5

3 / 2

Negate (-)

Negate a Scalar<Event>

Signatures

-Scalar<Number/Event>

-Scalar<Number/Event>

-Scalar<Number/Event> : Scalar<Number>

An argument of type Scalar<Event> prefixed by a - negates the value of the Event.

Examples

Calculating 3 divided by 2 results in 1.5

-3

Less Than (<)

Signatures

Scalar<any> < Scalar<any>

Scalar<any> < Scalar<any>

Scalar<any> < Scalar<any> : Scalar<Boolean>

Comparing if a Scalar<any> is less than another Scalar<any>. Returns a Scalar<Boolean> either true oif the first operator is less than the second otherwise false.

Examples

Check if the PowerConsumption is less than the PowerProduction

$PowerConsumption < $PowerProduction

Less or Equal (<=)

Signatures

Scalar<any> <= Scalar<any>

Scalar<any> <= Scalar<any>

Scalar<any> <= Scalar<any> : Scalar<Boolean>

Comparing if a Scalar<any> is less or equal than another Scalar<any>. Returns a Scalar<Boolean> either true if the first operator is less or equal than the second otherwise false.

Examples

Check if the PowerConsumption is less or equals than the PowerProduction

$PowerConsumption <= $PowerProduction

Equal (=)

Signatures

Scalar<any> = Scalar<any>

Scalar<any> = Scalar<any>

Scalar<any> = Scalar<any> : Scalar<Boolean>

Comparing if a Scalar<any> equal another Scalar<any>. Returns a Scalar<Boolean> either true if the first operator equals to the second otherwise false.

Examples

Check if the PowerConsumption is equals to the PowerProduction

$PowerConsumption = $PowerProduction

Greater or Equal (>=)

Signatures

Scalar<any> >= Scalar<any>

Scalar<any> >= Scalar<any>

Scalar<any> >= Scalar<any> : Scalar<Boolean>

Comparing if a Scalar<any> is greater or equal another Scalar<any>. Returns a Scalar<Boolean> either true if the first operator is greater or equals to the second otherwise false.

Examples

Check if the PowerConsumption is greater or equal than the PowerProduction

$PowerConsumption >= $PowerProduction

Greater (>)

Signatures

Scalar<any> > Scalar<any>

Scalar<any> > Scalar<any>

Scalar<any> > Scalar<any> : Scalar<Boolean>

Comparing if a Scalar<any> is greater another Scalar<any>. Returns a Scalar<Boolean> either true if the first operator is greater as the second otherwise false.

Examples

Check if the PowerConsumption is greater than the PowerProduction

$PowerConsumption > $PowerProduction

AND

Signatures

Scalar<Boolean> AND Scalar<Boolean>

Scalar<Boolean> AND Scalar<Boolean>

Scalar<Boolean> AND Scalar<Boolean> : Scalar<Boolean>

Comparing if a Scalar<Boolean> and Scalar<Boolean> are both true. Returns a Scalar<Boolean> with true when both terms result in true otherwise false.

Examples

Check if the PowerConsumption is greater 0 AND the PowerProduction is > 0. Only returns true if both are valid.

$PowerConsumption > 0 AND $PowerProduction > 0

OR

Signatures

Scalar<Boolean> OR Scalar<Boolean>

Scalar<Boolean> OR Scalar<Boolean>

Scalar<Boolean> OR Scalar<Boolean> : Scalar<Boolean>

Comparing if one of Scalar<Boolean> OR Scalar<Boolean> is true. Returns a Scalar<Boolean> with true when one of the terms result in true. Returns false when both terms are false.

Examples

Check if the PowerConsumption is greater 0 OR the PowerProduction is > 0. Only returns false if both are false.

$Consumption > 0 OR $Production > 0

NOT

Signatures

Scalar<Boolean>

Scalar<Boolean>

NOT Scalar<Boolean> : Scalar<Boolean>

Negate the Scalar<Boolean> after the NOT keyword. This means a Scalar<Boolean> with value true will return false and vise versa.

Examples

Check if the PowerConsumption is NOT greater than the PowerProduction.

NOT ($PowerConsumption > $PowerProduction)

Format (|)

Signatures

Scalar <Number/Event> | Scalar<Text>

Scalar <Time> | Scalar<Text>

Scalar <Timespan> | Scalar<Text>

Scalar <Timespan> | '(ADAPTIVE|SECONDS|MINUTES|HOURS|DAYS):(WORD|SYMBOL)'

Scalar <Number/Event> | Scalar<Text>

Scalar<Number/Event> | Scalar<Text>Scalar<Text>

Format pattern semantic, see Java's DecimalFormat


Scalar <Time> | Scalar<Text>

Scalar<Time> | Scalar<Text>Scalar<Text>

Format pattern semantic, see Java's SimpleDateFormat


Scalar <Timespan> | Scalar<Text>

Scalar<Time> | Scalar<Text>Scalar<Text>

Format pattern semantic, see Java's SimpleDateFormat


Scalar <Timespan> | '(ADAPTIVE|SECONDS|MINUTES|HOURS|DAYS):(WORD|SYMBOL)'

Scalar<Time> | '(ADAPTIVE|SECONDS|MINUTES|HOURS|DAYS):(WORD|SYMBOL)'Scalar<Text>

Format pattern semantic

ValueDescription

ADAPATIVE

Means that it chooses the time unit automatically depending on the value size

SECONDS

Redners the value in seconds.

MINUTES

Renders the value in minutes.

HOURS

Renders the value in hours.

DAYS

Renders the value days.

WORD

Is in the word form (e.g. Hours)

SYMBOL

Is in the abbreviation of the unit (e.g. h)

Examples

Format the Result of the AVG($Consumption) function (which is a Scalar<Number) in format '#,##0'.

AVG($Consumption) | '#,##0'

Format the Timestamp of the $Event (which is Scalar<Event>) as hours and minutes.

$Event::Timestamp | 'HH:mm'

Fromat the resulting Timestamp as Hours suffixed with the word Hours.

(now - $Event::Timestamp) | 'HOURS:WORD'

Attribute Accessor (::)

Signatures

Scalar<Event>:: Value

Scalar<Event>::Timestamp

Scalar<Event>::DeviceName

Scalar<Event>::DeviceId

Vector<any>::Last

Vector<Event>::Value

Vector<Event>::Timestamp

Vector<Event>::DeviceName

Vector<Event>::DeviceId

GroupedScalar<any, Event>::Value

GroupedScalar<any, Event>::Timestamp

GroupedScalar<any, Event>::DeviceName

GroupedScalar<any, Event>::DeviceId

GroupedScalar<Device, any>::GroupKeyDeviceName

GroupedScalar<Device, any>::GroupKeyDeviceId

GroupedScalar<any, any>::GroupValue

Scalar<Event>:: Value

Scalar<Event>::Value : Scalar<Number>

Access the value of the event.

Returns

Returns the value as Scalar<Number>

Examples

Get the value of the event stored in the PowerConsumption Variable.

$PowerConsumption::Value

Scalar<Event>::Timestamp

Scalar<Event>::Timestamp : Scalar<Time>

Access the timestamp of the event.

Returns

Returns the timestamp as Scalar<Time>

Examples

Get the timstap of the event stored in the PowerConsumption Variable.

$PowerConsumption::Timestamp

Scalar<Event>::DeviceName

Scalar<Event>::DeviceName : Scalar<Text>

Access the DeviceName of the event.

Returns

Returns the DeviceName as Scalar<Text>

Examples

Get the DeviceName of the event stored in the PowerConsumption Variable.

$PowerConsumption::DeviceName

Scalar<Event>::DeviceId

Scalar<Event>::DeviceId : Scalar<Text>

Access the DeviceId of the event.

Returns

Returns the DeviceId as Scalar<Text>

Examples

Get the DeviceId of the event stored in the PowerConsumption Variable.

$PowerConsumption::DeviceId

Vector<any>::Last

Vector<any>::Last : Scalar<any>

Access the last element of the Vector.

Returns

Returns the last element of the Vector as Scalar<any>

Examples

Get the last Event from the $PowerGeneration vector.

$PowerConsumption::Last

Vector<Event>::Value

Vector<Event>::Value : Vector<Number>

Retrieve the values of all events in the vector as new Vector<Number>

Returns

Returns the values of all events as Vector<Number>

Examples

Get the values of all events in the vector $PowerConsumption as new Vector<Number>

$PowerConsumption::Value

Vector<Event>::Timestamp

Vector<Event>::Timestamp : Vector<Time>

Retrieve the timestamps of all events in the vector as new Vector<Time>.

Returns

Returns the timestamps of all events as Vector<Time>.

Examples

Get the timestamps of all events in the $PowerConsumption vector.

$PowerConsumption::Timestamp

Vector<Event>::DeviceName

Vector<Event>::DeviceName : Vector<Text>

Retrieve the device names of all events in the vector as new Vector<Text>.

Returns

Returns the device names of all events as Vector<Text>.

Examples

Get all device names from all events in the $PowerConsumption vector.

$PowerConsumption::DeviceName

Vector<Event>::DeviceId

Vector<Event>::DeviceId : Vector<Text>

Retrieve the device ids of all events in the vector as new Vector<Text>.

Returns

Returns the device ids of all events as Vector<Text>.

Examples

Get all device names from all events in the $PowerConsumption vector.

$PowerConsumption::DeviceId

GroupedScalar<any, Event>::Value

GroupedScalar<any, Event>::Value : Vector<Number>

Retrieve the values of all events in the group as new Vector<Number>

Returns

Returns the values of all events as Vector<Number>

Examples

Get the values of all events in the group $PowerConsumption as new Vector<Number>

$PowerConsumption::Value

GroupedScalar<any, Event>::Timestamp

GroupedScalar<any, Event>::Timestamp : Vector<Time>

Retrieve the timestamps of all events in the group as new Vector<Time>.

Returns

Returns the timestamps of all events as Vector<Time>.

Examples

Get the timestamps of all events in the $PowerConsumption GroupedScalar.

$PowerConsumption::Timestamp

GroupedScalar<any, Event>::DeviceName

GroupedScalar<any, Event>::DeviceName : Vector<Text>

Retrieve the device names of all events in the group as new Vector<Text>.

Returns

Returns the device names of all events as Vector<Text>.

Examples

Get all device names from all events in the $PowerConsumption group.

$PowerConsumption::DeviceName

GroupedScalar<any, Event>::DeviceId

GroupedScalar<any, Event>::DeviceId : Vector<Text>

Retrieve the device ids of all events in the group as new Vector<Text>.

Returns

Returns the device ids of all events as Vector<Text>.

Examples

Get all device names from all events in the $PowerConsumption group.

$PowerConsumption::DeviceId

GroupedScalar<Device, any>::GroupKeyDeviceName

GroupedScalar<Device, any>::GroupKeyDeviceName : Vector<Text>

Retrieve the device name of the device which is the groups key new Vector<Text>.

Returns

Returns the device name of the device which is the groups key new Vector<Text>.

Examples

Get all device names from all the devices in the $PowerConsumption group.

$PowerConsumption::GroupKeyDeviceName

GroupedScalar<Device, any>::GroupKeyDeviceId

GroupedScalar<Device, any>::GroupKeyDeviceId : Vector<Text>

Retrieve the device id of the device which is the groups key new Vector<Text>.

Returns

Returns the device id of the device which is the groups key new Vector<Text>.

Examples

Get all device ids from all the devices in the $PowerConsumption group.

$PowerConsumption::GroupKeyDeviceName

GroupedScalar<any, any>::GroupValue

GroupedScalar<Device, any>::GroupValue : Vector<Text>

Retrieve the value of the group as new Vector<any>.

Returns

Returns the value of the group as new Vector<any>.

Examples

Get all Values from the $PowerConsumption group.

$PowerConsumption::GroupValue

Last updated

© 2023 MOOST AG