Reference Updated March 25, 2026

ENUM

Category: Filtering & data shaping

Overview

Description

Iterates through the rows of the input and assigns a number to each row in ascending or descending order based on the magnitude of measures.

Use this when you need to assign sequential numbers (ranks) to rows based on their values, for example to build threshold rules or select the top/bottom N items.

Syntax

`ENUM('Node' [, "Order"])`

Parameters

  • Node: An input node with rows to be enumerated.

  • Order (optional): Whether to enumerate in ascending or descending order.

    • "ASC" - The row with the smallest measure is assigned the number 1 and increases as the measures increase. This is the default.

    • "DESC" - The row with the largest measure value is assigned number 1 and increases as the measures decrease.

Limitations

  • In case of rows having the same value, the tie breaking is done by looking at the level values.

  • The priority during tie breaking is determined by the alphabetical order of the dimension names and the hierarchy of levels within those dimensions.


Examples

Enumeration by measure value (ASC and DESC)

This example shows how ENUM ranks rows by their values, first in ascending order (default), then in descending order.

Input node: Node A

YearValue
20257
20265
20273
2028-2

Formula: ENUM('Node A')

Year→ ENUM Result
20254
20263
20272
20281

Formula: ENUM('Node A', "DESC")

Produces the enumerated result starting from the largest measure value.

Year→ ENUM Result
20251
20262
20273
20284

Tie-breaking with multiple dimensions

When rows share the same measure value, ENUM breaks ties using dimension levels in alphabetical order of dimension names and hierarchy within each dimension.

Dimensions & Levels:

Time → Year

Product Dimension → Product Family, Product

Input node: Node B

YearProduct FamilyProductValue
2025CarBig Car6
2026TruckBig Truck-5
2027CarSmall Car-5
2028TruckSmall Truck9

Formula: ENUM('Node B')

YearProduct FamilyProduct→ ENUM Result
2025CarBig Car3
2026TruckBig Truck2
2027CarSmall Car1
2028TruckSmall Truck4

In this case enumeration starts from lowest measure which is -5 which there is a tie on two rows. Function “prioritises” Product dimension over "Time" since the name is alphabetically appearing earlier. Within the product dimension "Product Family" is the upper level in hierarchy that is why this level is used to break the tie and the row with the "Car" gets the first value over "Truck". There is no other tie in the measures so enumeration continues as usual for the rest of the rows.

Input node: Node C

YearProduct FamilyProductValue
2025CarBig Car-5
2026TruckBig Truck-5
2027CarSmall Car-5
2028TruckSmall Truck-5
2029CarSmall Car-5

Formula: ENUM('Node C')

YearProduct FamilyProduct→ ENUM Result
2025CarBig Car1
2026TruckBig Truck4
2027CarSmall Car2
2028TruckSmall Truck5
2029CarSmall Car3

In this more complex case every measure is equal. As mentioned in the previous example the level "Product Family" is prioritised to break the tie however there is a another tie as rows 1, 3, and 5 are all sharing the same value "Car". In this case the function looks at the next available level in dimension which is "Product" and the row with the "Big Car" is enumerated with value 1. Row 3 and 5 still share the same value "Small Car" which in this case the function will look at the Time dimension "Year" to resolve the final conflict.


FunctionWhen to use instead
ENUM_LEVELWhen you want to enumerate by the order of level values in dimension management rather than by measure value.
FINDFIRSTWhen you want to select one value per group rather than assign ranking numbers.
Was this page helpful?