> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Choose

> Use the Sigma Choose function to return the value at an index position from a list of inputs or a column.

The **Choose** function assigns to every row the value that corresponds to the index position, based on the number of the inputs or on the column.

## Syntax

```
Choose(index, value1, ...)
```

The function has the following arguments:

<dl>
  <dt>
    index
  </dt>

  <dd>
    Required
  </dd>

  <dd>
    The index number of the returned value
  </dd>

  <dd>
    The index must be a number, a formula, or a column that is a Number data type.
  </dd>

  <dd>
    If the index is a number argument, the function returns only the value in the corresponding index position. If the argument is a column, the function returns the value that corresponds to each row's index number. 
  </dd>

  <dt>
    value1
  </dt>

  <dd>
    Required
  </dd>

  <dd />

  <dd>
    The first of values where to match the index.
  </dd>

  <dd>
    The list of values must have at least one element.
  </dd>

  <dd>
    When an index number does not have a matching value, the function returns 

    <code>Null</code>

    .
  </dd>

  <dd>
    The value argument(s) can be Number, Logical, Text, or Date data types. All value arguments must be of the same data type.
  </dd>

  <dt>
    value2 ...
  </dt>

  <dd>
    Optional
  </dd>

  <dd>
    Additional values where to match the index
  </dd>
</dl>

## Examples

```
Choose(1, "value 1", "value 2", "value 3")
```

Returns value 1.

```
Choose(Weekday([Date]), "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
```

Returns the name of the day of the week falling on the date in the *Date* column.

```
Choose([Cohort Bins], "One Week", "One Month", "Over a Month")
```

Returns the *Time to Sale* bucket each customer belongs to based on the *Days First to Second Order* column, which indicates the number of days between their first and second purchase.

![Screenshot of function results](https://files.buildwithfern.com/sigma.docs.buildwithfern.com/6c37bcff9f082ff2401d5bc14d082402a96c5e5ae8e6336bfe3f239ed81a50c6/assets/docs-images/530df68-Screen_Shot_2023-03-21_at_11.01.32_AM.png)

```
Choose(BinRange([Cost], 50, 100, 200, 500, 1000), "under $50", "$50 +", "$100 +", "$200 +", "$500 +", "over $1,000")
```

The **BinFunction** here divides the **Category** column values into six bins, while the wrapping **Choose** function applies names the bins.

## Related resources

* [Weekday](/docs/weekday)
* [BinRange](/docs/binrange)