Choose

Selects a value from a given set of parameters.

Syntax

Choose(n, s1 [, s2 ...])

Parameters

Parameter

Description

n

The position of the value you want to select within the set. If this value is not a whole number, the function rounds n down to the nearest whole value.

The function returns an empty string if either of the following conditions is true:

  • n is less than 1.

  • n is greater than the number of items in the set.

If n is null, the function returns null.

s1

The first value in the set of values.

s2 (Optional)

Additional values in the set.

Examples

The following expressions are examples that use the Choose function:

Expression

Returns

Choose(3, "Taxes", "Price", "Person", "Teller")

Person

Choose(2, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)

9

Choose(Item_Num[0], Items[*])

Returns the value within the set Items that corresponds to the position defined by the first occurrence of Item_Num.

Choose(20/3, "A", "B", "C", "D", "E", "F", "G", "H")

F

// Ethnio survey code removed