Wednesday, February 19, 2020

Nested Sorting and Hierarchical Nested Sorting in Tableau


Nested sorting used to be difficult to many people. Hierarchical nested sorting is even more difficult.

What is (regular) nested sorting and what is hierarchical nested sorting?

Regular nested sorting is regarding multiple dimensions and one measure. Say we have all of them on the row and we need to sort the rightmost dimension by the measure. That is the nested sorting as shown below. Usually it is regarding a static table. This can be easily done by clicking the sort button on the tool menu.
Hierarchical nested sorting is sorting a hierarchy of dimensions. A hierarchy may have any number of dimensions. We can expand(+) or close(-) the lower-hierarchy dimensions to the right side at will. The sorting by the measure needs to be respected at every level of the hierarchy, and after every expand/close action. The table is thus dynamic as shown below.
The new version of Tableau has made hierarchical nested sorting very easy. We only need to set up the sort of the top dimension in the hierarchy as shown in the picture below. They key is selecting sort by "Nested". Then we can expand/close the hierarchy and have the same sort at all levels.
That is it. You can download the workbook here.

1 comment:

  1. Amazing! it is every good example to understand nested sorting

    ReplyDelete