# Sorting data

Inforiver provides the standard sorting options -ascending/descending or native power BI sorting. You can sort based on measures, variances, or axis values. In small multiples mode, you can also sort the panels in a specific order. The card section shows sorting based on the small multiples parameter.

## 1. Sorting data in chart mode

**1.1. Measure-based sorting:** The chart below demonstrates how we can sort the bars by the Plan measure in ascending order.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FpcYB7LjmptVRJTOS6CRA%2Fimage.png?alt=media&#x26;token=c206f77e-f903-4f9e-9ace-7f4a4b440291" alt=""><figcaption><p>Measure based sorting for charts</p></figcaption></figure>

**1.2. Axis-based sorting:** The chart below depicts how we can sort based on Axis categories.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2Fc7v7njATy4tH7kLN5xqW%2Fimage.png?alt=media&#x26;token=9c576748-a396-4bec-98bc-aae994be8026" alt=""><figcaption><p>Axis based sorting for charts</p></figcaption></figure>

**1.3. Variance-based sorting:** You can sort data based on the relative or absolute variance. In this chart, we've sorted the bars based on the relative variance.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FKlG9iT1PTF11WDnv9pCz%2Fimage.png?alt=media&#x26;token=a8ed3880-ae5c-46a5-9f9a-49fb1a782c7e" alt=""><figcaption><p>Variance based sorting for charts</p></figcaption></figure>

For breakdown waterfall charts, you can sort the breakdown categories.

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FqbLaYBzApjJOsybLPcA9%2Fimage.png?alt=media&#x26;token=7586dd40-1d28-40f1-ac93-9b5e620e0b60" alt=""><figcaption><p>Variance sorted in descending order</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F0F2FKJUFSCHqT5QE3TCF%2FSorting%20breakdown.png?alt=media&#x26;token=1ffc8576-604d-42a1-8c76-f42afeda8995" alt=""><figcaption><p>Variance sorted in ascending order</p></figcaption></figure></div>

**1.4. Panel sorting in trellis mode:** You can sort the trellis panels based on the measure values or the small multiples parameter. In this example, we've sorted the panels based on the small multiples parameter - Subregion.&#x20;

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FvqUYNvRz2pkF3PUESXVE%2Fimage.png?alt=media&#x26;token=aff3e3d0-7f18-43b8-a43a-7297b38cc9de" alt=""><figcaption><p>Sorting panels in small multiples mode</p></figcaption></figure>

**1.5. Stack sorting**: When it comes to stacked charts, you can sort by the name or values of the stack/legend field or the aggregated measure value for each group category.

* Stack value: The stacks within each bar are sorted in ascending or descending order based on the value.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FLDfUvslaNWLe7wzMRF3C%2Fimage.png?alt=media&#x26;token=654e0aba-8d1b-4d86-9747-6b49198c954f" alt=""><figcaption><p>Sorting based on stack value</p></figcaption></figure>

Group: The stacks within each bar are sorted in alphabetical order based on the category name.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F9c46vQJgmvFTd4yNNIYE%2Fimage.png?alt=media&#x26;token=f404c6db-e853-4526-a8de-46a6c0365583" alt=""><figcaption><p>Sorting based on dimension category name</p></figcaption></figure>

Measure value: The stack values are aggregated across axis categories and stacks are sorted based on the total value. Let's look at the data in the summary table to understand how this works.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FCbH0TDKB8rxoI7CzpvuM%2Fimage.png?alt=media&#x26;token=28505329-c038-4bbc-a4dc-3f4dd5b123f4" alt=""><figcaption><p>Summed-up values for each region</p></figcaption></figure>

Based on the summed-up data values, the stacks would be sorted in the order South < Central < West < East.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F6kFL2JzzSuh4Peeo1PHq%2Fimage.png?alt=media&#x26;token=6f36ee8d-fc44-49a8-be22-6c2b4bedd556" alt=""><figcaption><p>Sort based on aggregated stack value</p></figcaption></figure>

## 2. Sorting data in card mode

All the sorting options discussed in the charts section: measure/axis/variance/trellis sorting can be used in card mode.

The card mode is most often used with a small multiple parameter. When you add a small multiples parameter, the sorting interface has an additional group tab. You can sort the panels based on the measures or the dimension categories of the small multiples parameter. In the example, we have sorted the panels by the Actuals measure in ascending order.&#x20;

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FcE1UlQ4L2mrXlirI26UW%2Fimage.png?alt=media&#x26;token=eff4d0d7-1f21-47a3-a6a2-fd64a8ae1e37" alt=""><figcaption><p>Sorting panels in a trellis</p></figcaption></figure>

In the second example, we've sorted the panels by the group dimension (Subcategory) and the individual charts by Actuals.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F1ui3VA3laJwfY5CvY3v0%2Fimage.png?alt=media&#x26;token=f6d9b366-23b2-4a73-87fd-7594653b582d" alt=""><figcaption><p>Chart and panel sorting</p></figcaption></figure>

## 3. Sorting data in table mode

&#x20;**Measure-based sorting:** When you sort tables based on a measure, an arrow icon is displayed near the column used for sorting. We have sorted the table in the example by the AC measure.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FOm7wanFmMQ7rXmdZ1aUw%2Fimage.png?alt=media&#x26;token=128bd7f1-fb5e-4a48-a145-3574c299c38f" alt=""><figcaption><p>Sorting options for tables</p></figcaption></figure>

For tables, you can also sort data based on a measure directly from the column gripper.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FjSJMdgPTjWLytqO37tsK%2Fimage.png?alt=media&#x26;token=c46109a7-b886-4f30-864d-cfc123399f4a" alt=""><figcaption><p>Sorting from the column gripper menu</p></figcaption></figure>

**Axis-based sorting:** You can sort the rows in a table based on the axis values as demonstrated below.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FNsEY2PXYEW5BvekTcZDA%2Fimage.png?alt=media&#x26;token=3fc385a0-e8a0-4323-9333-718baa36e0cc" alt=""><figcaption><p>Axis based sorting for tables</p></figcaption></figure>

**Variance-based sorting:** Inforiver provides the option of sorting rows based on the absolute or relative variance. We've sorted the data based on the relative variance in this example.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FuNxCN5raarjkaWd2RgKg%2Fimage.png?alt=media&#x26;token=01b9f2e6-d181-4d94-9bbf-3eaa3f592587" alt=""><figcaption><p>Variance based sorting</p></figcaption></figure>

**Sorting trellis panels:** You can perform a multi-dimensional sort when you have row and column dimensions as small multiple parameters.

In the example, we've applied sort options for rows, columns, and data:

* **Axis**: The rows in each table are sorted based on the values in the AC column.
* **Row**: The trellis rows (Subcategory dimension) are sorted based on the row dimension categories.
* **Column:** The trellis columns are sorted based on the overall AC value for each panel.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FZyIQn4ibp58MCZ76g5Yp%2Fimage.png?alt=media&#x26;token=640637ef-3242-4466-bab8-8da1a4b0e102" alt=""><figcaption><p>Multi dimensional sorting</p></figcaption></figure>

## 4. Native sorting&#x20;

You can retain the sort order defined in Power BI by selecting the 'Native' option. The Power BI sort order will be overridden when you select a different sorting method within Analytics+.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FwOmr3VJGsn7ATLVd2AwO%2Fimage.png?alt=media&#x26;token=d6fac6e2-2084-49bb-81af-170c6c731a36" alt=""><figcaption><p>Native sort option</p></figcaption></figure>
