IFBLANK
- IFBLANK(value, blank_branch)[source]
Returns a specified value if the input value is blank, otherwise returns the value.
This function checks whether value is blank (empty or null). If it is blank, the function returns blank_branch; otherwise, it returns the value of value. Both singular values and arrays are supported. This is useful for providing default values when data may be missing.
- Parameters:
- Return type:
- Returns:
Either blank_branch if value is blank, or the original value otherwise.
Supported types:
ANY
- Raises:
ValueError – If value and blank_branch have incompatible data types.
ValueError – If both value and blank_branch have data type NULL.
Examples
IFBLANK(order["discount"], order["default_discount"]) # Returns the discount if present, else default_discount