#### Switch

##### Switch(Boolean[], Array)

The elements in the two parameters corresponding with each other. This function evaluates the elements in the first parameter from left to right, and returns element associated with the first element to evaluate to True. For example,

`Switch([1, 2, 3], [a, b, c])`

if 1 is true, Switch returns a. If 2 is true, Switch returns b. If 3 is true, Switch returns c.

Parameters

- Boolean[] - A Boolean type array, which contains the elements that are to be evaluated.
- Array - An array, which contains all the available values that may be returned.

Return value

One of the elements of the parameter array. The type of the returned value is the same as the element in the array.

Example

Insert the following function into the Detail section of a report,

`Switch([@"Customers_Customer ID"< 5, @"Customers_Customer ID" > 50,true],["small", "large", "medium"])`

- if Customer ID < 5 is true, returns small.
- if Customer ID >50 is true, returns large.
- if 5 < Customer ID < 50 (true), returns medium.