CASE
Allows the user to select a value depending on a series of value tests. There is no practical limit to the number of cases; however, for numerous cases, it is beneficial to list the most frequently encountered conditions first.
Syntax
@CASE (value,test_value1,test_result1[,test_value2,test_result2] [, ...] [,default_result])
Examples
- Example 1
-
The following returns "A car" if
PRODUCT_CODEis"CAR" and "A truck" ifPRODUCT_CODEis"TRUCK". In this case, ifPRODUCT_CODEfits neither of the first two cases, aFIELD_MISSINGindication is returned.@CASE (PRODUCT_CODE, "CAR", "A car", "TRUCK", "A truck")
- Example 2
-
In this modified case, assuming
PRODUCT_CODEis neither"CAR" nor"TRUCK","A vehicle" is returned.@CASE (PRODUCT_CODE, "CAR", "A car", "TRUCK", "A truck", "A vehicle")