LogoLogo
  • Welcome to the MOOST platform user manual
  • Platform Manual
    • Login
      • Forgot Password
    • Notifications
    • Rules
      • Rule Configurator
        • Data graph
        • Datasets
        • Condition
        • Streak
        • Message
        • Settings
        • Rule Simulator
        • Early Adopter
        • Command
      • Rule Language
        • Syntax
        • Data Types
        • Data Structures
        • Functions
          • AVG
          • COUNT
          • DISTINCT
          • EVAL
          • FILTER
          • GROUP_BY_DEVICE
          • GROUP_BY_TIME
          • MAX
          • MIN
          • POSITION
          • REVERSE
          • SORT
          • SUBSET
          • SUM
        • Operations
          • Plus
          • Minus
          • Multiply
          • Divide
          • Negate
          • Less Than
          • Less or Equal
          • Equal
          • Not Equal
          • Greater or Equal
          • Greater
          • AND
          • OR
          • NOT
          • Format
          • Attribute Accessor
        • Examples
    • Events
    • Buildings
      • Household Profile
    • User Profile
    • Billing Portal
      • Payment Method
      • Update Payment Address
      • Invoices
      • Terminate Subscription
    • Context Services
      • Weather Forecast
      • Solar Production Forecast
      • Power Consumption Forecast
      • Power Generation Forecast
    • Support Center
  • Technical Integration
    • Cloud-to-Cloud Integration
      • Platform On-boarding
      • Configure Notification Settings
        • Receive Notifications
          • iOS Notification Handling
      • MOOST API Integration
        • Request Access Token
        • Synchronize Buildings and Devices
          • Device Types
        • Forward Events
          • Event Types
            • Device Status
            • Charging Modes
            • Switch State
        • Notifications and Interactions
          • Return Notification Interaction
  • Best Practices
    • FAQ
    • User Acceptance Testing
  • Policies
    • Security Policy
    • Privacy Policy
Powered by GitBook

© 2025 MOOST AG

On this page
  • Description
  • SUBSET(Vector<Any>, Scalar<Number>)
  • SUBSET(Vector<any>, Scalar<Number>, Scalar<Number>)
  • SUBSET(Vector<Event>, Scalar<Time>)
  • SUBSET(Vector<Event>, Scalar<Time>, Scalar<Time>)
  • Examples
Export as PDF
  1. Platform Manual
  2. Rules
  3. Rule Language
  4. Functions

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

Parameter
Description

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

Parameter
Description

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

Parameter
Description

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

Parameter
Description

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)
PreviousSORTNextSUM

Last updated 1 year ago