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
  • SORT(Scalar<any>)
  • SORT(Vector<any>)
  • SORT(GroupedScalar<any, any> [, Scalar<Text>])
  • SORT(GroupedVector<any, any> [, Scalar<Text>])
  • Examples
Export as PDF
  1. Platform Manual
  2. Rules
  3. Rule Language
  4. Functions

SORT

Description

Sorts the entries of the given parameter in ascending order.

SORT(Scalar<any>)

SORT(scalar: Scalar<any>): Scalar<any>

Sort the entries of the given Scalar<any> in ascending order.

Parameters

Parameter
Description

scalar

A scalar of type any

Returns

Returns the given scalar sorted in ascending order as type Scalar<any>.


SORT(Vector<any>)

SORT(vector: Vector<any>): Vector<any>

Sort the entries of the given Vector<any> in ascending order.

Parameters

Parameter
Description

vector

A vector of type any

Returns

Returns the given vector sorted in ascending order as type Vector<any>.


SORT(GroupedScalar<any, any> [, Scalar<Text>])

SORT(group: GroupedScalar<any, any> [, by: Scalar<Text>]): GroupedScalar<any, any>

Sort the entries of the given GroupedScalar<any, any> in ascending order by values.

Parameters

Parameter
Description

group

A GroupedScalar of type <any, any>

by

The by parameter is optional.

Specifies by which attribute of the vector it should be sorted.Allowed values are byGroupKey and byGroupValue.

Default is byGroupValue.

Returns

Returns the given group sorted by the specified property in ascending order as type GroupedScalar<any, any>.


SORT(GroupedVector<any, any> [, Scalar<Text>])

SORT(group: GroupedVector<any, any> [, by: Scalar<Text>]): GroupedVector<any, any>

Sort the entries of the given GroupedVector<any, any> in ascending order by values.

Parameters

Parameter
Description

group

A GroupedVector of type <any, any>

by

The by parameter is optional.

Specifies by which attribute of the vector it should be sorted.Allowed values are byGroupKey and byGroupValue.

Default is byGroupKey.

If sorting by value, then it does this by comparing the number of values.

Returns

Returns the given group sorted by the specified property in ascending order as type GroupedScalar<any, any>.

Examples

Sort GridPowerConsumption in ascending order.

SORT($GridPowerConsumption)

Sort GroupedByDevicePowerConsumption in ascending order by event

SORT($GroupedByDevicePowerConsumption, byGroupKey)
PreviousREVERSENextSUBSET

Last updated 4 days ago