Data Transformation Engine Functions and Expressions Reference Guide
Chapter 3 - Function Reference WHEN
Functions and Expressions Reference Guide
221
WHEN
The WHEN function evaluates a condition. Then, based on that evaluation,
evaluates another condition and returns TRUE or FALSE.
Syntax
WHEN ( single-condition-expression , single-condition-
expression [ , single-condition-expression ] )
Meaning
WHEN ( condition1 , condition2 [ , condition3 ] )
Returns
This function returns TRUE or FALSE
Returns TRUE if condition1 and condition2 both evaluate to TRUE.
Returns TRUE if condition1 evaluates to FALSE and there is no condition3 or if
condition1 evaluates to FALSE and condition3 evaluates to TRUE.
Returns FALSE if condition1 evaluates to TRUE and condition2 evaluates to
FALSE.
Returns FALSE if both condition1 and condition3 evaluate to FALSE.
The following table illustrates the evaluation of the three arguments. N/A
means the argument is not used in the evaluation.
Condition 1 Condition 2 Condition 3
WHEN returns
True True N/A True
False N/A N/A True
False N/A True True
True False N/A False
False N/A False False