LEVELFILTER
Basic Overview
Description | Filters the input to rows where a certain condition is met between level values of two compared levels. |
Signature | LEVELFILTER('Node', "Level1", "Level2" [, "Operation" [, "CaseSensitive"]]) |
Parameters |
|
Limitations/Notes |
|
Examples
The input node contains levels Year, Product, and OtherProduct.
Input node =
Year | Product | Other Product | Value |
---|---|---|---|
2021 | Car | Car | 10 |
2022 | Truck | Plane | 20 |
2023 | Bicycle | bicycle | 30 |
2024 | Van | Truck | 40 |
LEVELFILTER('Input node', “Product“, “Other Product“, “EQ“, “FALSE“) would produce:
Year | Product | Other Product | Value |
---|---|---|---|
2021 | Car | Car | 10 |
2023 | Bicycle | bicycle | 30 |
In this example only rows with same level values between “Product” and “Other Product“ are kept. Note that the row with “bicycle” is only kept because the operation is not performed case sensitive.
However, performing the same operation case sensitive e.g.
LEVELFILTER('Input node', “Product“, “Other Product“, “EQ“, “TRUE“) would produce:
Year | Product | Other Product | Value |
---|---|---|---|
2021 | Car | Car | 10 |
LEVELFILTER('Input node', “Product“, “Other Product“, “NEQ“, “FALSE“) would produce:
Year | Product | Other Product | Value |
---|---|---|---|
2022 | Truck | Plane | 20 |
2024 | Van | Truck | 40 |
Not equals operation only kept the rows where the values of “Product” and “Other Product” differ.
Similarly, case sensitive version e.g.
LEVELFILTER('Input node', “Product“, “Other Product“, “NEQ“, “TRUE“) would produce:
Year | Product | Other Product | Value |
---|---|---|---|
2022 | Truck | Plane | 20 |
2023 | Bicycle | bicycle | 30 |
2024 | Van | Truck | 40 |
Other examples with different operation types
Input node =
Year | Filter Year | Value |
---|---|---|
2021 | 20 | 10 |
2022 | 202 | 20 |
2023 | 02 | 30 |
2024 | 24 | 40 |
LEVELFILTER('Input node', “Year“, “Filter Year“, “STARTSWITH“) would produce:
Year | Filter Year | Value |
---|---|---|
2021 | 20 | 10 |
2022 | 202 | 20 |
In this example, only the rows with level values of “Year” which start with the level values of “Filter Year” is kept in the result. (2021, 2022)
LEVELFILTER('Input node', “Year“, “Filter Year“, “ENDSWITH“) would produce:
Year | Filter Year | Value |
---|---|---|
2024 | 24 | 40 |
In this example, only the rows with level values of “Year” which ends with the level values of “Filter Year” is kept in the result. (2024)
LEVELFILTER('Input node', “Year“, “Filter Year“, “CONTAINS“) would produce:
Year | Filter Year | Value |
---|---|---|
2021 | 20 | 10 |
2022 | 202 | 20 |
2023 | 02 | 30 |
2024 | 24 | 40 |
In this example, all the rows are kept since each row's Year value contains the value in Filter Year. (2021, 2022, 2023, 2024)