IFS Function

Selects elements from two dynamic arrays, depending on the logical values of elements in a third array.

Syntax

IFS(dynArray, trueArray, falseArray)

Syntax Elements

dynArray, trueArray, falseArray
DataBasic expressions that evaluate to dynamic arrays.

Return Value

A dynamic array with the same structure as dynArray, formed by combining elements from trueArray and falseArray. Each element in the new array contains the corresponding element from either trueArray or falseArray, depending on the logical (true or false) value of that element in dynArray. If there is no corresponding element in trueArray or falseArray (as appropriate), the element concerned is set to null.

Comments

For details of the logical values of different types of element, refer to Logical Expressions.

Missing elements (those that appear in one array, but not in the other) are treated as null.

Example

ARY = @TRUE:@VM:@FALSE
TARY = "John":@VM:"Paul"
FARY = "George":@VM:"Ringo"
NEWARY = IFS(ARY, TARY, FARY)

Sets NEWARY to "JohnVMRingo".