> For the complete documentation index, see [llms.txt](https://docs.bdb.ai/self-service-visualization/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bdb.ai/self-service-visualization/design-workspace/order-by-and-limit.md).

# Order by and Limit

{% hint style="info" %}
*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%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2FKSKdoZA4Pfxtc57Qw5P1%2F2023-03-05-19-56-46%20(online-video-cutter.com).mp4?alt=media&token=8d7fabed-5947-4bdc-a9c7-9402a6337cec>" %}

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

<figure><img src="https://2340960528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2FWRicnAU22otSaClZypWx%2Fimage.png?alt=media&amp;token=c2e28e1a-a205-4446-98c0-7440925ca2c5" alt=""><figcaption><p>Creating a View</p></figcaption></figure>

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

<figure><img src="https://2340960528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2F8Rrhl6PvhjhGNn5J5ZKS%2Fimage.png?alt=media&amp;token=7cfcc1b1-3f25-4feb-ac71-333752a105ae" 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://2340960528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2FoR3rrkAYwrldUjI7ZfEx%2Fimage.png?alt=media\&token=a698dfed-e5de-4e2a-8ead-9ebdca9341bc)​
* 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.
* The **View** gets filtered with the provided **order by** and **limit** configurations. E.g., the following View displays 5 records on Sum of salary based on City in the ***Ascending*** manner.&#x20;

<figure><img src="https://2340960528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2F0A2LQ6jNOiho965F3K4N%2Fimage.png?alt=media&amp;token=cdd4d7a1-5d64-46c8-8f31-c107d0848f0f" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
*Please Note:*

* *This feature **does not work** for **KPI tile**, **Semi Gauge**, **Map**, **Treemap Chart**, and **Metric Summary.***
* *The view-specific **Sort By** option is provided on the storyboard.*

{% endhint %}

<figure><img src="https://2340960528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2FwzIZnDcgChPOYagCjbiK%2Fimage.png?alt=media&amp;token=5002de8a-825a-4b40-b087-cc141c7903f4" alt=""><figcaption></figcaption></figure>

## Sort based on Hidden Dimension Value <a href="#sort-based-on-non-existing-dimension" id="sort-based-on-non-existing-dimension"></a>

The Design workspace contains the ***Hidden*** category to drop a Dimension to sort the View Data. The dragged dimension to the ***Hidden*** category gets added to the ***Order By*** drop-down menu from where the user can use it to order the display of the current view.

* Create a **View** by dragging some Dimension and Measure.
* Apply some **Order** and **Sorting** using the **Order** and **Order By** fields. E.g., for the current image the Order is Descending and the View is Ordered By the Sum of monthly salary.

<figure><img src="https://2340960528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2FzolomEEWWAhu2y9BO6W0%2Fimage.png?alt=media&amp;token=d42a785f-dec8-43cc-ab23-27aaa24d5095" alt=""><figcaption></figcaption></figure>

* Drag one ***Dimension*** to the ***Hidden*** space.
* Open the ***Order By*** option from the ***Properties*** tab.
* The dragged Dimension gets listed under the ***Order By*** context menu.
* The ***View*** **gets sorted by the** ***hidden Dimension*** as well.

<figure><img src="https://2340960528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2FgpWSymI8IzssdSmmgqLF%2Fimage.png?alt=media&amp;token=9bf554fa-868f-4f7c-bdc7-5ddde04d160d" alt=""><figcaption><p>The hidden Dimension sorts the View data.</p></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark>*&#x20;

* *The hidden Dimension gets applied to the current View without even selecting it from the Order By drop-down.*
* *The user can also select the hidden Dimension from the Order By drop-down and apply it on the current View.*
  {% 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%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2FB174sxZ7xphj6sJMp4me%2FBDB_%20Decision%20Platform%20-%20Google%20Chrome%202023-03-05%2021-01-49%20(online-video-cutter.com).mp4?alt=media&token=af10d9f5-22ad-47eb-9f5a-638a1c80f08c>" %}
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://2340960528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2FDwpI8DmXrqlaoDsnb2mi%2Fimage.png?alt=media&amp;token=f0531734-1bc2-43a7-920a-a6363db364aa" 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://2340960528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2FvEO0nsnzQtW9iEWq9N0F%2Fimage.png?alt=media&amp;token=79b3c3de-e83a-449c-a6bc-2cea3c570b7c" 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.
* Click the ***Save*** ***&*** ***Apply*** option after arranging the fields in the desired order.

&#x20;      ![](https://2340960528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2FxpbTSjNV5OS6hgxX9sMZ%2Fimage.png?alt=media\&token=3aded5c7-4a60-4f05-9fd4-3a5fbc029936)

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

<figure><img src="https://2340960528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2F7HRriOnkJD9GOhQQPYtQ%2Fimage.png?alt=media&amp;token=b4e0af96-5753-4940-85b6-ce2ba6ca7cf8" 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

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

![](https://2340960528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2F7QP4JQMnzacL7IfKeNL9%2Fimage.png?alt=media\&token=d89f9bee-4e27-4745-8bf0-d363e20ac1d2)

{% 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 applies to the current view.

<figure><img src="https://2340960528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb3U3HdVsN1h9bZt2fgoH%2Fuploads%2FTb4BMaZ0cZvqrFl7ekE5%2Fimage.png?alt=media&amp;token=70eb7354-1248-4c3c-9e74-4b4980bc4dfd" alt=""><figcaption></figcaption></figure>
