Data Transformation Engine Functions and Expressions Reference Guide

Chapter 3 - Function Reference EITHER
Functions and Expressions Reference Guide
98
EITHER
The EITHER function returns the result of the first argument that does not
evaluate to NONE.
Syntax
EITHER (single-general-expression { , single-general-
expression } )
Meaning
EITHER ( try_this { , if_none_try_this } )
Returns
This function returns a single-object.
Returns try_this if try_this does not evaluate to NONE. Returns
if_none_try_this if try_this evaluates to NONE. Returns the next
if_none_try_this if the first if_none_try_this evaluates to NONE, and so on.
Example
EITHER ( OrderDate Field , CURRENTDATE ( ) )
If OrderDate Field does not evaluate to NONE, it is returned. If OrderDate
Field evaluates to NONE, the current system date (using
CURRENTDATE) is
returned.
EITHER ( LOOKUP (PriorityCd:Msg , CustID:Msg = "93X" ) , 8 )
This example returns the result of the LOOKUP if that result does not evaluate
to NONE; otherwise, it returns the second argument, 8.
EITHER (IF (SomeCode = "C" , CustomerID:Input) ,
IF (SomeCode = "S" , SupplierID:Input) ,
IF (SomeCode = "O" , Reference#:Input) ,
"####" )
If SomeCode is C and CustomerID:Input has a value, EITHER returns the
value of CustomerID. Otherwise, if SomeCode is S and CustomerID:Input
has a value, EITHER returns the value of SupplierID. Otherwise, if
SomeCode is O and Reference#:Input has a value, EITHER returns the value