Go to Contents
Previous
Page
Next
Page
Contents > Functions reference (alphabetical list) > Logical functions > Choose function

Choose function
Format

Choose(test;result0{;result1;result2...})
Parameters
test - Any integer calculation. The calculation result of test must be a number that indexes into the list that follows. Because the index is a 0 based index, the test result must be 0 to access the first result.
result - one or more results.
Parameters in curly braces { } are optional.
Data type returned
text, number, date, time, timestamp, container
Description
Returns one result value, according to the integer value of test. FileMaker Pro evaluates test to obtain an index number, which is used to choose the corresponding ordinal result.
Because the Choose function is a 0 based list, the first item on the list is indexed 0 and the second item on the list is indexed 1. For example, if test evaluates to 2, then result2 is chosen.
Example

Choose(Rating;"Not Applicable";"Good";"Fair";"Poor")
Rating is a number field that is empty or holds a value between 1 and 3. If Rating is empty, the Choose function returns nothing. If Rating is 1, the result is Good. If Rating is 2, the result is Fair, and if it is 3, the result is Poor.
Related topics
Functions reference (category list)
Functions reference (alphabetical list)
About formulas
About functions
Defining calculation fields
Using operators in formulas

Contents > Functions reference (alphabetical list) > Logical functions > Choose function
Previous
Page
Next
Page