> 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.

# Sort filter and control values

> Sort filter and control values in Sigma by count, alphanumeric order, or custom order when working with large lists.

You can sort values in [filter](/docs/data-element-filters) and [control elements](/docs/intro-to-control-elements) to show by count, alphanumeric values, or by a custom order. Sorting values can be especially helpful when working with large lists of values to quickly access the values you want, or to understand the distribution of values.

This document covers how to sort filter and control values. For information on customizing the sort order of tables and charts instead of a filter or control, see [Customize the sort order of data elements](/docs/configure-custom-sort).

Only [list](/docs/data-element-filters#list) and [hierarchy](/docs/data-element-filters#hierarchy) filters and controls can be sorted. Only the top 200 values are selected for list filters and controls.

## User requirements

* You must have **Can edit** or **Can explore** access to the document.

## Sort by count or alphanumeric value

1. Select the filter or control element.
2. Select the <img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/sort_desc.svg" alt="" /> **Sort by** dropdown.
3. To sort by [count](/docs/count)  or alphanumeric value, select your desired option from the dropdown:
   * **Ascending by count**
   * **Ascending by count**
   * **Ascending by alphanumeric** (A-Z and 0-9)
   * **Descending by alphanumeric** (Z-A and 9-0)

## Sort by a custom order

You can sort values in a filter or control by a custom order. For example, you may want to sort a list of outages by a column of severity ranks, or sort a list of customer IDs by an aggregation of total order quantity.

To configure sort by a custom order:

1. Select the filter or control element.
2. Select the <img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/sort_desc.svg" alt="" /> **Sort by** dropdown.
3. Select **Custom sort...**.
4. Configure your custom sort:
   * **Sort by**: Select your desired column to sort by.
   * **Aggregation**: Select your desired aggregation method. Depending on the column selected, the methods shown vary. [Linked columns](/docs/use-linked-columns-in-workbooks), columns with the variant [data type](/docs/data-types-and-formats), and columns with errors cannot be aggregated.
   * **Order**: Select the numerical or alphabetical order you want to sort by.
     Your filter/control values display in the new sort order, accompanied by row count and histogram (with the exception of columns sorted by text columns).

### Example: Sorting customers by sum of order quantity

A table, `PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA`, contains information an electronic retailer’s sales, including columns such as:

* *Customer Name*: Name of the customer who made the purchase
* *Quantity*: Number of items purchased in the transaction

When filtering customers by name, you might want to know more information about their purchasing behavior (for example, to reward higher-purchasing customers with a loyalty discount). To configure the custom sort on your filter:

1. Select the *Customer Name* list filter.
2. Select the <img src="https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/sort_desc.svg" alt="" /> **Sort by** dropdown.
3. Select **Custom sort...**.
4. Configure your custom sort:
   * **Sort by**: Select the *Quantity* column.
   * **Aggregation**: Select **Sum**.
   * **Order**: Select **Largest to smallest**.

Your *Customer Name* list filter is now sorted by the total quantity each customer has purchased, in descending order.

## Related resources

* [Filter data in data elements](/docs/data-element-filters)
* [Intro to control elements](/docs/intro-to-control-elements)