Complex Sorting in the Query, Results, and Table Sections

Note:

The information discussed here also applies to sorting in the Report section.

The appearance and functionality of the Sort line is nearly identical in the Query, Results, and Table sections. In each section, the Sort line uses a drag-and-drop interface similar to the Request and Filter lines.

Image shows a sorted Results set.

Using this feature, you can drag items to the sort line and request them to be sorted in sequence to yield Nested Sorts results.

When you sort more than one data item at a time, the left to right order of data on the Sort line dictates the sort order and creates a nested effect. Data is sorted in the order you specify. The leftmost item on the Sort line is the primary sort. Items to the right are sorted in progression, each within the categories of the preceding item.

For example, if the first item is State, the second item City, and the third item Store, States are sorted alphabetically by name. Within each state, cities are sorted by name. Within each city, stores are sorted.

Nested effects are based solely on the placement of items on the Sort line. If the item order on the Request line differs from the order in the Content pane, the sort is still nested, but the visual impact is not as pronounced.

The key difference between the sections lies in where the sorting is performed:

The bottom line effect is the same whether you apply sort conditions locally in the Results or Table section or on the database server in the Query section. Depending on the situation and the needs of your business, one method or the other may be preferable.

  To use the Sort line in the Query, Results, or Table sections:

  1. If the Sort line is not already displayed, click Sort on the section titlebar.

  2. Select the desired data item that on the Request line (Query) or its corresponding report element from Elements.

  3. Click the ascending or descending Sort button on the Standard toolbar.

    You can also select the sort options from the section menu or double-click items on the Sort line to toggle between ascending and descending sort order.

  4. Review the sorted data.

    • If you are sorting in the Query section, the data is sorted by the database server when you process the query.

    • If the Sort line is displayed in the Query section, the item appears on the Sort line. If you sort in ascending order, an up arrow appears to the right of the item name on the Sort line; if you sort in descending order, a down arrow appears.

    • If you are sorting in the Results or Table section, click Sort Now.

    • After sorting, the data in the Results or Table Contents pane is ordered according to the sort criteria.