Sorting Hierarchies in Smart Discover
In addition to filtering your hierarchies to show custom elements or a filtered sub-set of elements, you can also sort the sequence that the elements are shown in on the discovery into an appropriate order. For example, you could filter to display only the top 25% of elements in the Products hierarchy and also sort the filtered selection in descending order of value.
Sorting your Hierarchy
Before you begin
If you created a custom list following the instructions in that topic, you can start by removing the Manufacturer chip that represented your four Manufacturer elements:
Otherwise, create a new discovery and add a Cost measure.
Step 1: Locate a Hierarchy
To make a custom selection, start by finding the required hierarchy within its dimension:
Tip: You can use the search field to enter a search term and look for required items (in this case, the Manufacturers hierarchy) on the open tab.
Step 2: Sort the Hierarchy
This example will not filter the hierarchy, but will show it in reverse alphabetical order (Sort Bottom A - Z):
- Click the hierarchy's arrow to open its sub-menu (orange arrow below).
- In the main section of the Filter panel, alongside the All option, click the Sort arrow (purple arrow below).
- To create an alphabetical sort in descending order, select Sort Bottom A - Z.
The Filter panel opens.
The Sort Options are shown in a further panel.
Note: By selecting All, we have skipped the filtering step. If you want to filter the hierarchy and then Sort the results, you should select your filter and then select its sort arrow.
For details of the options in this list, see Sort Options (below).
Result
The Manufacturer chip is added to the Select Item bar and the elements in that hierarchy are added to the discovery in descending alphabetical order (blue highlight below). Note that a Sort caption is also added to the canvas (purple highlight):
Sort Caption
Where your discovery is sorted, a Query caption will be added to the canvas that describes the sort in natural language. This provides information for the user to help them understand the underlying sorting.
Filter Caption
Where your discovery is filtered, a Query caption is also added to the canvas that describes the filter in natural language. This provides information for the user to help them understand the underlying filtering. For more information, see Filtered Selections in Smart Discover.
Query Captions
You can reposition, move, and resize the Sort or Filter captions using drag and drop. You can also remove them from the query, using the Remove option on their context menus ("ellipsis"). It is important to note that removing the caption also removes the sorting or filtering. For more information, see Layout and Captions.
Sort Selections
To sort your hierarchy selection, open the hierarchy's sub-menu, then either:
- Open the Sort menu from the All label, as described above.
- Open the Sort menu from the Filter or Custom selection sub-menu.
In all cases, the selected Sort option applies to the elements in the hierarchy as it is shown in the discovery. For All, the Sort applies to all elements. For Custom or Filtered hierarchies, the sort applies to the filtered selection. For a filtered example, see Filtered Selections in Smart Discover.
Sort Options
You can sort the hierarchy alphabetically or numerically.
Sort Alphabetically
Sort the hierarchy alphabetically, either in order (A - Z) or reverse-alphabetical order (Z - A).

Select Sort Top A - Z to sort the hierarchy alphabetically in ascending order:
Select Sort Bottom A - Z to sort the hierarchy in reverse-alphabetical order.
Note: The main example in this topic uses Sort Bottom A - Z to display the manufacturers in reverse alphabetical order. Changing the Visualization Type to Matrix Grid causes the discovery to appear as follows:
Sort Numerically
Sort the hierarchy numerically, either in ascending or descending order.

Select Sort Top Numerically to sort the hierarchy in ascending order of value:
Select Sort Bottom Numerically to sort the hierarchy in descending order of value:
Sort and Filter Selections
You can apply sorting to filtered and custom selections, by opening the next sub-menu from the required filter. This enables you to filter the elements in the given hierarchy, and then sort the resulting elements as needed.
In this example, a Top Percent filter and a Bottom Numeric sort are applied to the Manufacturer hierarchy:
The result is that the top 50% of manufacturers by sales are displayed, and sorted in descending order of value:
Note the following:
- To make the example more comprehensible, a Matrix Table visualization has been selected from the Auto Recommended items (yellow arrow above).
- Two Query captions are added to the panel, representing the Filter and the Sort (purple highlight). These captions provide context so that readers can understand what data is being displayed. You can remove these captions, and the underlying filter / sort, by clicking the "ellipsis" and selecting Remove.