LEVELFILTER
LEVELFILTER('Node', "Level1", "Level2" [, "Operation" [, "CaseSensitive"]])
The LEVELFILTER function filters the input to rows where a certain condition is met between level values of two compared levels.
Use this function when filtering depends on comparing member values between two levels rather than filtering by a fixed value list.
Parameters
- NodeNode referenceRequired
- The input node with the values to be filtered.
- Level1Level nameRequired
- The first level whose level values are compared.
- Level2Level nameRequired
- The second level whose level values are compared.
- OperationKeywordOptional
- The filtering condition. Default:
"EQ"."EQ": Only returns rows where values ofLevel1andLevel2are equal. This is the default."NEQ": Only returns rows where values ofLevel1andLevel2are different."STARTSWITH": Only returns rows where values ofLevel1start with the values ofLevel2."ENDSWITH": Only returns rows where values ofLevel1end with the values ofLevel2."CONTAINS": Returns rows where values ofLevel1contain the values ofLevel2.
- CaseSensitiveKeywordOptional
- Whether to perform the level value check in a case-sensitive manner or not. Default:
"TRUE"."TRUE": Performs the check taking upper/lower case letters into account. This is the default."FALSE": Performs the check without taking upper/lower case letters into account.
Watch out
Nodemust contain bothLevel1andLevel2to perform the filtering.Level1andLevel2cannot be the same level.- For the operations
"STARTSWITH","ENDSWITH", and"CONTAINS", the checks are performed based on the first compared level (Level1). This means the filtering is made according to whether a level value ofLevel1matches a value ofLevel2, not the other way around. - For the operations
"STARTSWITH","ENDSWITH", and"CONTAINS", equal level values also return true values.
Examples
Compare two levels with equality and inequality
This example compares two product-related levels and shows how LEVELFILTER behaves with equality and inequality checks.
The input node contains the levels Year, Product, and Other Product.
Input node: 'Input node'
| Year | Product | Other Product | Value |
|---|---|---|---|
| 2025 | Car | Car | 10 |
| 2026 | Truck | Plane | 20 |
| 2027 | Bicycle | bicycle | 30 |
| 2028 | Van | Truck | 40 |
Formula: LEVELFILTER('Input node', "Product", "Other Product", "EQ", "FALSE")
| Year | Product | Other Product | LEVELFILTER Result |
|---|---|---|---|
| 2025 | Car | Car | 10 |
| 2027 | Bicycle | bicycle | 30 |
In this example, only rows with the same level values between "Product" and "Other Product" are kept. The row with "bicycle" is only kept because the operation is not performed case-sensitively.
Formula: LEVELFILTER('Input node', "Product", "Other Product", "EQ", "TRUE")
| Year | Product | Other Product | LEVELFILTER Result |
|---|---|---|---|
| 2025 | Car | Car | 10 |
This example performs the same equality check case-sensitively, so the row with Bicycle and bicycle is removed.
Formula: LEVELFILTER('Input node', "Product", "Other Product", "NEQ", "FALSE")
| Year | Product | Other Product | LEVELFILTER Result |
|---|---|---|---|
| 2026 | Truck | Plane | 20 |
| 2028 | Van | Truck | 40 |
The not-equals operation keeps only the rows where the values of "Product" and "Other Product" differ.
Formula: LEVELFILTER('Input node', "Product", "Other Product", "NEQ", "TRUE")
| Year | Product | Other Product | LEVELFILTER Result |
|---|---|---|---|
| 2026 | Truck | Plane | 20 |
| 2027 | Bicycle | bicycle | 30 |
| 2028 | Van | Truck | 40 |
With case-sensitive comparison enabled, Bicycle and bicycle are treated as different values and are therefore kept.
Use string comparison operations
This example shows how STARTSWITH, ENDSWITH, and CONTAINS work when comparing text-like level values.
Input node: 'Input node'
| Year | Filter Year | Value |
|---|---|---|
| 2025 | 20 | 10 |
| 2026 | 202 | 20 |
| 2027 | 02 | 30 |
| 2028 | 24 | 40 |
Formula: LEVELFILTER('Input node', "Year", "Filter Year", "STARTSWITH")
| Year | Filter Year | LEVELFILTER Result |
|---|---|---|
| 2025 | 20 | 10 |
| 2026 | 202 | 20 |
In this example, only the rows where the values of "Year" start with the values of "Filter Year" are kept. (2025, 2026)
Formula: LEVELFILTER('Input node', "Year", "Filter Year", "ENDSWITH")
| Year | Filter Year | LEVELFILTER Result |
|---|---|---|
| 2028 | 24 | 40 |
In this example, only the rows where the values of "Year" end with the values of "Filter Year" are kept. (2024)
Formula: LEVELFILTER('Input node', "Year", "Filter Year", "CONTAINS")
| Year | Filter Year | LEVELFILTER Result |
|---|---|---|
| 2025 | 20 | 10 |
| 2026 | 202 | 20 |
| 2027 | 02 | 30 |
| 2028 | 24 | 40 |
In this example, all rows are kept since each Year value contains the value in Filter Year. (2025, 2026, 2027, 2024)