Tableau provides basic and advanced sorting methods that are easily accessed through icons or menus. Sorting isn’t limited to fields that are visible in the chart— any field in the data source can be used for sorting. Computed sorts can be applied either directly on an axis in the view or using the sort dialog box.
Manual Sorting via Icons
The most basic way to sort is via the icons that appear in the toolbar menu. The toolbar menu sort icons in both ascending and descending sorts. The below diagram shows a bar chart in which a manual sort was applied from the toolbar icon.
Tableau also provides sorting icons near the headings and mark axis. If you don’t see an icon, hover your mouse near the area and it will appear. Notice the icon that appears in the sub-category pill on the row shelf? The light gray descending sort icon that appears in that pill provides an indication that a sort has been applied in that sub-category field. Clicking on the sort icon floating over the right-side of the sub-category heading provides ascending and descending sorts using the text of the product category headings. The sort icons that appear over
Diagram of Manual sort in tableau, applied from the toolbar icon :
It doesn’t matter how many levels of hierarchy are added to the view, you can sort on each level. The below diagram includes the category dimension and that pill has been sorted using an ascending sort.
Ascending sort by category Diagram :
In addition to sorting via the toolbar or the sort icons, you can point at and drag any one of the rows in the display and revise the sort to an arbitrary manual sort. For example, you could change the sort order by dragging computer peripherals to the top of the technology category and defining a new manual sort.
Calculated sort using the sort menu
You can easily sort your data by different dimensions when you use a parameter control. Tableau provides extensive sorting capabilities. More advanced sorting can be accessed by pointing at a dimension pill, right-clicking, and selecting the sort option. The below diagram shows the sort menu that is displayed when you right-click on a dimension pill-in this example the sub-category pill.
Diagram of Re-sorted computer peripherals and the sort menu :
Tableau’s sort menu allows you to more precisely define the default sort method and order. The sort by section includes a drop-down menu that currently displays the sales field using an aggregation of sum. However, it is possible to select any field in the data set and change the aggregation. For example, you could also apply ascending sort by average profit. Leaving the sort menu open and using the apply button at the bottom right side of the menu is useful. You can apply a variety of sort options and see the result. When you decide to keep the sort, click the OK button.
Sorting via Legends
Another useful sort feature is enabled within the legends. The below diagram shows two versions of the same bar chart. The left view orders the blue delivery truck dimension on the bottom. The chart on the right shows regular air at the bottom. Reordering the position of the colors displayed within the color legend causes the order of the colors appearing in the bars to change. Reposition the colors within the color, holding down the left mouse button, and dragging the color to the desired position.
Reordering the color in charts Diagram :
The ability to reorder colors in a stacked bar chart is important because precise comparisons are most easily made for the color that starts at the zero. Certain colors cannot as easily compared because they don’t start at the same value.
|Data Visualization and Dashboarding Fundamentals|
Get Updates on Tech posts, Interview & Certification questions and training schedules