The Choose() function shortens scripts even more than Match(), provided the arguments are tested against integers. The syntax is:
Suppose you have a data table with a group column of numeric values from 1 through 7. If the first cell contains the number 1, the following script returns x = "Low".
Creates the x variable.
|
|
Begins the Choose() loop.
|
|
Evaluates the value of group in the first row.
|
|
If the value of group is 1, return "Low".
|
|
If the value of group is 2, return "Medium".
|
|
If the value of group is 3, return "High".
|
|
Closes the x variable.
|
|