The choose
construction can be used to check a multitude of conditions and return the expression that is part of the first condition that evaluates to be true.
The full construction should be created as displayed in the syntax, starting with choose
, ending with a default
expression and the end
keyword, and having 1 or more when ... then ...
expressions in between.
The Choose construct in WEM is comparable to Case or Switch statements in some programming languages. See wikipedia.
This function is SQL compatible. For more information about SQL compatibility, see our documentation.
Returns the value after the then
of the first condition that returns true.
If all conditions return false, then the value after default
is returned.
Don't forget the end
keyword.
All values after each then and default keyword must be of the same type to be returned.