--- title: "3. Sort Order" slug: "3-sort-order" updated: 2024-01-26T18:50:19Z published: 2024-01-26T18:50:19Z canonical: "wiki.cobblestonesoftware.com/3-sort-order" --- > ## Documentation Index > Fetch the complete documentation index at: https://wiki.cobblestonesoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # 3. Sort Order ### **3. Sort Order** **Ad-Hoc Report Wizard: Sort Order** The fourth step in the wizard allows for one or more fields selected in step 2 to be assigned as a default or starting sort order. ![Sort Order Boxes in Report Manager](https://cdn.document360.io/e3626857-1fb5-4e27-b278-2d3fc5508be4/Images/Documentation/image-1667506878694.png) **Sort Order Management** Managing the sort order consists of two multi-select boxes: 1. The **Selected Table-Fields** (the left-hand box). It shows all the fields selected in step 2 for this ad-hoc report. 2. The **Table-Field Sort Order** (the right-hand box). It shows the fields selected for the sort order. To use a field in the sort order, the field can either be clicked and dragged from the left-hand box to the right-hand box, or the field can be selected in the left-hand box and moved to the sort order (right-hand box) by clicking the **right arrow button**. ![Arrow buttons](https://cdn.document360.io/e3626857-1fb5-4e27-b278-2d3fc5508be4/Images/Documentation/3.-sort-order-image-3ypj8e3f.png) **Setting sort order parameters** Once a field is moved to the **Sort Order** (right-hand box), a parameter based area displays. ![Selected Field](https://cdn.document360.io/e3626857-1fb5-4e27-b278-2d3fc5508be4/Images/Documentation/3.-sort-order-image-i854u2hk.png) Each field can be specified as either sorting based on **Ascending** or **Descending** order. **Sort Order Hierarchy** When defining multiple fields to be part of the sort order, you are configuring a sort order hierarchy. Sort Order Hierarchies follow the following logic: - Sort the results of the report by the first field specified in the sort order - For any duplicates based on the previous field sort order, sort those duplicates based on the next field in the sort order - Repeat this step for any additional fields in the sort order (field 3 and up) With this logic in mind, the last aspect of the sort order functionality is the ordering of fields selected for the sort order. To change the order, click the field in questions and click the **up** or **down arrows** to the right of the **Sort Order** box (right-hand box). This moves the field up or down in the sort order hierarchy. ![up and down arrows](https://cdn.document360.io/e3626857-1fb5-4e27-b278-2d3fc5508be4/Images/Documentation/3.-sort-order-image-f5x7b0d4.png)