SUBSET

Description

Extracts a subset of elements from a given Vector.

SUBSET(Vector<Any>, Scalar<Number>)

Extract the first or last x entries.

SUBSET(vector: Vector<Any>, x: Scalar<Number>): Vector<Any>

Parameters

ParameterDescription

vector

A vector of type any.

x

A positive or negative number. When x is a positive number it starts to extract the number of entries stated in param2 from the beginning, when param2 is a negative number it starts to extract the number of entries stated in param2 from the end of the vector.

Returns

Returns a Vector of type any.


SUBSET(Vector<any>, Scalar<Number>, Scalar<Number>)

SUBSET(vector: Vector<Any>, x: Scalar<Number>, y: Scalar<Number>): Vector<Any>

Parameters

ParameterDescription

vector

A vector of type any.

x

Position from which to start extracting elements. If negative, then position is counted from the end of the vector.

y

Position until which to extract elements. If negative, then position is counted from the end of the vector.

SUBSET(Vector<Event>, Scalar<Time>)

SUBSET(vector: Vector<Event>, start: Scalar<Time>): Vector<Event>

Extract entries from time start until the latest event (left argument is excluding, right is including)

Parameters

ParameterDescription

vector

A vector of type Event.

start

The start time from which to start extracting entries until the latest.

Returns

A Vector of type Event.


SUBSET(Vector<Event>, Scalar<Time>, Scalar<Time>)

SUBSET(vector: Vector<Event>, start: Scalar<Time>, end: Scalar<Time>): Vector<Event>

Extract entries from time start until time end (left argument is excluding, right is including the time border)

Parameters

ParameterDescription

vector

A vector of type Event

start

The start time from which to start extracting entries. (Excluded)

end

The end time until which to extract entries. (Included)

Returns

A Vector of type Event.

Examples

Extract the last entry from the vector GridPowerConsumption.

SUBSET($GridPowerConsumption, -1)

Extract all events from zero hour (midnight) until now.

SUBSET($GridPowerConsumption, lastZeroHour)

Extract all events 2 days ago until 1 day ago.

SUBSET($GridPowerConsumption, now-2d, now-1d)

Last updated

© 2023 MOOST AG