# 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 %}

![](/files/OzL9WYrnjLNG69sPYyv1)

The user can sort data values displayed in a chart by using this option from the chart Properties.

* 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.          &#x20;

![The Mixed chart gets created by default](/files/PuLBn4W4SpTYwvcueWTR)

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

&#x20;     ![](/files/CY1gJcHUcfal9BfXMl9k)

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

  * None
  * Ascending
  * Descending
  * Manual Sort

  &#x20; ![](/files/nk5eKtJNzvlkZ4ZuD6X2)
* 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 options.  &#x20;

![The View gets filtered with the applied Order by and Limit options](/files/zhUnMkpTnhoiWudNs3zU)

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

* *This feature <mark style="color:red;">**does not work**</mark> for **KPI tile**, **Semi Gauge**, **Map**, **Treemap Chart**, and **Metric Summar**y.*
* *The view-specific **Sort By** option is provided on the storyboard.*&#x20;

&#x20;     ![](/files/cQvcwEkIwbfxpF4Y0xUK)             &#x20;
{% endhint %}

### Sort based on Non-existing Dimension

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 Ascending and the View is Order By the Sum of monthly salary.

![](/files/q6Day4WzHvIBGKAdGqYr)

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

![Sorting the View with Hidden Dimension](/files/5ukP8hagxTTz2n951dJH)

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

![Manual Sorting ](/files/XivXCcqtC7IqhXTAYW2J)

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.
* Choose any combination of one Dimension and Measure.
* A chart gets displayed in some order (by default, the ***None*** order option gets selected).&#x20;

![Default display of a View with None as order option](/files/sVupJYUUBxrZQ6tl3Obg)

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

&#x20;     ![](/files/Rz3PlM3TrgNk4asXBLEV)

* The ***Manual Sort*** window opens.
* Select the ***New*** tab.
* Enter a title for the ***Order Name***.
* The dragged Dimension appears in the ***Select Dimension*** drop-down list.
* Arrange the fields by dragging them or using the arrows (move up, move down, move to the top, move to bottom) to arrange them in order. E.g., In the below-given image, the BU 6 is selected to ***Move to Top*** of the list.
* Click the ***APPLY*** option after arranging the fields in the desired order.

&#x20;    ![](/files/oK0xQuU7xvl57K9KxRkp)&#x20;

* The selected Dimension value moves as per the selected order.

&#x20;   ![](/files/2dSZk9wZLoPd0z5cNWhz)

* The ***View*** fields get displayed in the selected Manual Sort order.   &#x20;

![The View displayed gets changed as per the selected Manual order](/files/2VldgP5eJzYHr2sJ8HaJ)

&#x20;

{% 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 %}

* Open the ***Saved*** tab from the Manual Sort window.
* Select a saved order using the Select Order drop-down.
* Click the ***SAVE & APPLY*** option.

&#x20;  ![](/files/wPyO4BIfL3R9QwhJY2uc)

* The saved manual sort applies to the current view.    &#x20;

![The saved manual order gets applied to the View](/files/PISFrdiOm3jeRDWJbrwO)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bdb.ai/bdb-documentation/data-visualization/self-service/design/order-by-and-limit.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
