IfElseColumns / Logical Layer
Create a new column by selecting values from two columns based on a boolean condition. Similar to numpy select() or SQL CASE WHEN with column references.
Example:
Index | Condition | Column A | Column B | Result |
---|---|---|---|---|
0 | true | 100 | 50 | 100 |
1 | false | 75 | 25 | 25 |
2 | null | 80 | 30 | [*] |
3 | true | null | 40 | null |
4 | false | 90 | null | null |
[*] depends on null_value handling
Common applications:
- Merging alternate data sources
- Conditional value selection
- Fallback value handling
- Dynamic data switching
- Business rule implementation
SelectMask
columnThe boolean column used as condition mask. Determines which column's values (SelectTrue or SelectFalse) are chosen for each row.
SelectTrue
columnThe column to select values from when condition is true. If not specified, null values will be used for true conditions. Common uses:
- Primary data source
- Preferred values
- New data version
SelectFalse
columnThe column to select values from when condition is false. If not specified, null values will be used for false conditions. Common uses:
- Fallback data source
- Default values
- Old data version
NullValue
oneofIndicates that null values in any input (mask or selected columns) should propagate to the result.
ReplaceWith
stringReplace any nulls (in mask or selected values) with this specific value. Provides consistent null handling across all inputs.
FillFrom
columnUse values from this column when encountering nulls in mask or selected columns. Enables dynamic null replacement.
AsColumn
nameName for the new column. If not provided, the system generates a unique name. If AsColumn
matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.
AsDatatype
enumSpecifies the output data type for the new column. Enables type control for the conditional results.
8-bit signed integer (-128 to 127). For small-range discrete values.
16-bit signed integer (-32,768 to 32,767). For moderate-range whole numbers.
32-bit signed integer (-2^31 to 2^31-1). Common for general integer data.
64-bit signed integer (-2^63 to 2^63-1). For large whole numbers.
8-bit unsigned integer (0 to 255). For small positive numbers.
16-bit unsigned integer (0 to 65,535). For moderate positive ranges.
32-bit unsigned integer (0 to 4,294,967,295). For larger positive numbers.
64-bit unsigned integer (0 to 2^64-1). For very large positive numbers.
32-bit floating point. For decimal numbers with moderate precision.
64-bit floating point. For high-precision decimal numbers.
Text data type. Default type for flexible value representation.
Categorical string type. For efficient storage of repeated string values.
Boolean type. For true/false results.