# Order by and Limit

{% hint style="success" %}
*Check out the given walk-through to understand the **Order by** and **Limit** functions for a View.*
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq1Y2nC9XDrWcLwg1gpYr%2Fuploads%2FDyaV1q8QUnJLMf2XpEHp%2FOrderBy%20(New%20UI).mp4?alt=media&token=1dbe00a8-b05c-4dad-b5c9-74f49e7b0672>" %}
Order By and Limit (New UI)
{% endembed %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq1Y2nC9XDrWcLwg1gpYr%2Fuploads%2FpES6TVQJB7Ec4Z76dxZs%2FOrder%20By%20%20(Old%20UI).mp4?alt=media&token=2cb32e06-27ba-4c83-9323-e404a92fd8d8>" %}
Order By and Limit (Old UI)
{% endembed %}

## Steps to perform Order By and Limit on a View using the New UI

* Select the desired dimensions and measures from the context menu.
* Click the ***Go*** option to create an instant ***View***.&#x20;
* The ***Mixed*** chart gets selected by default to present the dragged data values.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/olIONhHfnzPb9qFDxN7O/image.png" alt=""><figcaption></figcaption></figure>

* Select the ***Order By*** option from the context menu.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/y8POjJeCvZfli8TThwLN/image.png" alt=""><figcaption></figcaption></figure>

* Select either ***Ascending*** or ***Descending*** order from the context menu by the next click.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/B1fdtlN50ISvXGDc1opN/image.png" alt=""><figcaption></figcaption></figure>

* Select a measure or dimension value that appears in the context menu on the next click.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/RstxVTIWiGjv15aOwVJ3/image.png" alt=""><figcaption></figcaption></figure>

* Based on the selected order the ***View*** will display the changes.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/s1VzMkvUCgnWBQY4xP9a/image.png" alt=""><figcaption></figcaption></figure>

## Steps to perform Order By and Limit on a View using the Old UI

* Drag and Drop the desired dimensions and measures to create an instant view.
* The Mixed chart gets selected by default to present the dragged data values.
* Click the Chart Properties icon.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/f4zFMBDnZINWN4Xgyk3u/image.png" alt=""><figcaption></figcaption></figure>

* By default, the ***None*** option gets selected for the ***Order*** field.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/Cmc7NXxO3LLJ747Qta3C/image.png" alt=""><figcaption><p>Displaying the Default order</p></figcaption></figure>

* The user gets the following options to display the selected data in a particular order.

  * None
  * Ascending
  * Descending
  * Manual Sort

  &#x20;      ![](https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/YzeNEp9zYfcBTfvrDmtQ/image.png)

  &#x20;    ​
* The ***Order By*** and ***Limit*** options get displayed if the selected Order option is either ***Ascending*** or ***Descending***.
  * **Order By**: Select an option from the drop-down list to set the order of the view (the dragged dimension and measure display in the ***Order By*** drop-down list)
  * **Limit**: Insert a number to limit the displayed dimension and measured values.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/umnabvz6zsp9ocT0hJJD/image.png" alt=""><figcaption></figcaption></figure>

* The **View** gets filtered with the provided **order by** and **limit** configurations. E.g., the following View displays 6 records of Sum of experience by Teams in the ***Ascending*** manner.&#x20;
* Click the Save icon to save the View to a Report.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/JaB2GfE3zu8gE9taNnAr/image.png" alt=""><figcaption></figcaption></figure>

* The selected View gets saved to a Report.
* *The view-specific **Sort By** option is provided on the final Report screen where a View has been saved.*

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/uiUJWMjmt9kDz2zbyltU/image.png" alt=""><figcaption></figcaption></figure>

* *The user can select any of the available options to change the order of that **View** by selecting the **Sort By** option. E.g., the Count of Skills shown in the Descending order using the **Sort By**.*

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/T1iNhaZPtrqWTMHzf9pZ/image.png" alt=""><figcaption></figcaption></figure>

* *The View displays data in the Descending manner as applied by using the Sort By option.*

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/qQiKJ78ctIrN6MgAoidl/image.png" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark>* *This feature **does not work** for **KPI tile**, **Semi Gauge**, **Map**, **Treemap Chart**, and **Metric Summary.***
{% endhint %}

## Manual Sort <a href="#toc191639" id="toc191639"></a>

{% hint style="info" %}
Check out the given illustration on the Manual Sort functionality.
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq1Y2nC9XDrWcLwg1gpYr%2Fuploads%2FPTQIKxL7ItzkKZ8vElNY%2FManual%20Sort.mp4?alt=media&token=8dc83325-1208-4628-a1ee-78194e7249a3>" %}
***Applying Manual Sorting on a View***
{% endembed %}

The users can manually sort a view by choosing the customized order they require. They can save the customized order and reuse it whenever required.

* Navigate to the ***Design workspace/ Story Canvas***.
* Choose any combination of one Dimension and Measure to get a graphical display of the View.
* By default, the ***None*** order option gets selected).

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/gLtj1zbP0in3GOUFuhDo/image.png" alt=""><figcaption></figcaption></figure>

* Select the ***Manual Sort*** option using the ***Order*** drop-down icon.
* Click the new icon that appears for ***Manual Sort**.*

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/ikEjYA6a8m9JkYyKdew1/image.png" alt=""><figcaption></figcaption></figure>

* The ***Manual Sort*** window opens.
* Select the ***Create*** ***New*** tab.
* Choose a ***Category*** from the drop-down menu. Selected Dimension appears here to be selected again.
* Enter a title for the ***Order Name***.
* Arrange the ***Values*** by dragging them up or down to arrange them in required order. Use the arrows given next to the selected Value to put them at the top or bottom of the list.
* Click the ***Save*** ***&*** ***Apply*** option after arranging the fields in the desired order.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/JiFLgMn1xjzydQdFwy6U/image.png" alt=""><figcaption></figcaption></figure>

* The ***View*** columns get displayed in the ***selected*** ***Manual Sort*** ***order***.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/By5Ggf7L5CHzWepqOSYl/image.png" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark>* *The **Saved** tab lists all the saved Orders by the user. Follow the below-given steps to* *use a saved order.*
{% endhint %}

### Applying a Saved Manual Order

* Navigate to the ***Manual Sort*** window.
* Open the ***Saved*** tab.
* The dragged ***Dimension*** appears in the drop-down menu.
* Select a saved order out of the displayed options.
* Click the ***Apply*** option.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/BVhZEsIqiy8BYjMomIFk/image.png" alt=""><figcaption><p><em><strong>Accessing a Saved Sorting Order</strong></em></p></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark> The users also have the option to edit the saved **Manual Sort** by clicking on the **Edit** option under the **Saved** tab.*
{% endhint %}

* The selected saved manual sort gets applied to the current view.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/vPWlDFlQHgK1tKHtAPbk/image.png" alt=""><figcaption><p><em><strong>View after applying the Manual Sorting order</strong></em></p></figcaption></figure>

## Hidden By

The user can apply the Order By option based on a hidden Dimension.&#x20;

### Applying Hidden By order in the Old UI

The user can use the old UI and drag a dimension value to the specified place for the Hidden dimension.&#x20;

* Navigate to the ***Design*** canvas.
* Select a combination of dimension and measure from the context menu.
* A View appears based on the selected Dimension and Measure.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/qHpT0IGEBICZ2X0B0S0D/image.png" alt=""><figcaption></figcaption></figure>

* Select a Dimension from the displayed list of dimensions and measures and drag it to the Hide.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/eLd5d4iggAcjlL2lhPJ6/image.png" alt=""><figcaption></figcaption></figure>

* Open the Chart Properties window.
* Navigate to ***General Settings*** tab.
* Open the Order By options by using the drop-down option.
* The selected ***Hidden*** dimension gets appeared in the context menu. E.g., In the following image the gender option is selected as an ***Order By*** option.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/uJ7pMBKJlXzAC6mbxY39/image.png" alt=""><figcaption></figcaption></figure>

* Select an order (Ascending or Descending)  by using the Order field. the selected option in the following image is Descending.
* Select a limit by using by ***Limit*** field.&#x20;

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/4gUNA7zJCUmHrMjT33Gj/image.png" alt=""><figcaption></figcaption></figure>

* The ***View*** gets displayed based on the applied hidden dimension in the set order and limit.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/xt30LPnCkGjI36TV3mN3/image.png" alt=""><figcaption><p><em><strong>View displaying the order and limit based on a hidden dimension</strong></em></p></figcaption></figure>

### Applying Hidden By order in the New UI

The user can use the next click after selecting a Dimension and Measure combination to create an instant View.&#x20;

* Navigate to the ***Design*** canvas.
* Select a combination of dimension and measure from the context menu.
* Click the ***GO*** option.
* A ***View*** appears based on the selected Dimension and Measure.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/dIbuJgqt7UNl4DaZ8oQM/image.png" alt=""><figcaption></figcaption></figure>

* Use next click to avail the ***hideBy*** option in the context menu.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/RrDwVNCp4HdzAIL9h1Hg/image.png" alt=""><figcaption></figcaption></figure>

* Use the next click to select the dimension that is to be used as hidden.
* Click the ***GO*** option.
* The ***View*** will get ordered by the selected Dimension.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/7RxzIP8kXYVcB69j82UV/image.png" alt=""><figcaption></figcaption></figure>

* The user needs to select few more options to apply a hidden dimension to Order By the View display (as suggested below):
  * Select the ***Order by*** option.
  * Select ***Ascending*** or ***Descending*** order.
  * For applying ***limit*** either type in the top bar or use the ***Chart Properties*** window.
* Click the ***GO*** option.
* The View gets displayed in the set order using a hidden dimension (In this case, the selected hidden dimension is ***gender**)*.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/M95vv67HobMqjalPItL0/image.png" alt=""><figcaption></figcaption></figure>

* The following image displays the View ordered by a hidden dimension in the Descending order.

<figure><img src="https://content.gitbook.com/content/vIDgRfkRB1bQpGtEDFfQ/blobs/R2M0FjD4GbQy5f1TuK0t/image.png" alt=""><figcaption></figcaption></figure>
