Configure Sort in Query

You can configure how your query will be sorted. In the Multi-level Sorting menu you can set one or muliple levels of sorting.

Following the steps from How to Create a Query. Here are the steps to configure sort in a query.

  1. Click Sort Data.

  2. In the Sort Data section:

    1. Click Add Level.

    2. Select the Column from the drop-down menu.

    3. Select the Order type:

      • Ascending

      • Descending

  3. Click Save.

  4. In the Save Query menu:

    1. Enter a Label.
      info Info Title used for display and translations.

    2. Enter a Name.
      info Info Mandatory and unique identifier. Changing it can break dependencies. Prefer using the Label for naming visible to users.

    3. In the Save to Folder section, select the folder where the query will be saved.

    4. Click Save.

This action will sort your data by a single column. By adding another column you can set a multi-level sorting.

Example

The following example shows table sorted by the following two levels:

  • Population (Descending)

  • Life Expectancy (Descending)

SortDataSection.png

Not Sorted Table

Shows an example of the initial, not-sorted dataset.

ConfigureSortNotSortedTable.png

Multi-level Sorted Table

Shows an example of what the sorted data would look like after applying the steps.

ConfigureSortSortedTable.png

Sort Data is an independent block. You can insert it anywhere after Source. The data passed to later blocks is already sorted at that point.