Description
The multiIf
function is a conditional logic function that allows you to write CASE
statement-like logic more compactly in queries. This function evaluates multiple conditions in the specified order and returns the value corresponding to the first true condition. If none of the conditions are met, it returns the value of the last else
expression.
Syntax
Parameters
cond_N
: The N-th condition to be evaluated.then_N
: The value returned when the N-th condition is true.else
: The value returned if none of the conditions are met.
Return Value
- Returns the value of any
then_N
expression, or the value of theelse
expression if none of the conditions are met.
Example Usage
Notes
- If the
multiIf
function does not include theelse
part, the function will returnNULL
when all conditions are not met.