Conditional Logic

The following table lists some additional functions that allow you to perform the "If" logic on values of various types.

IF (logicalexpression, value)This function returns the value if the logical expression is true and EMPTY otherwise.
IFELSE (logical, value1, value2)

This function returns the value1 if the logical expression is true and value2 otherwise.

Both value1 and value2 must have the same data type.

IFNULL (expressionalternative)This function checks the value of the expression. If the value is not NULL, the function returns the same value. However, if the value is NULL, it will return the value of the alternative expression.
SELECTCASE (condition1:outputvalue1, condition2:outputvalue2,...)

This function evaluates each logical condition and returns the corresponding value of the first condition it finds True.

All the output values must be of the same data type. However, if you require output values of different data types, they can be converted to the character data type to fulfill the requirement.

SELECTCASE (condition1:outputvalue1, condition2:outputvalue2,..., 

This function is similar to SELECTCASE (condition1:outputvalue1, condition2:outputvalue2,...). However in this case, if all conditions are false, the function returns "otherwisevalue."

SELECTBYVALUE (valuetocheck, checkvalue1:outputvalue1,

This function compares valuetocheck with each check value from left to right and displays the corresponding output value.

Returns EMPTY if none of the specified values match.

SELECTBYVALUE (valuetocheck, checkvalue1:outputvalue1,

This function is similar to SELECTBYVALUE (valuetocheck, checkvalue1:outputvalue1, checkvalue2:outputvalue2,...). However in this case, if none of the check values match, the function returns "otherwisevalue."