To make more sense of the data, we need to slice and dice the data in various ways and also look at it from various angles.
Being able to sort the data in ascending, descending or even in a custom manual order will help us put the data into a certain specific order and categorize it better.
Let's say we have around 1,000 customers in our data. Just showing the customers in a random order may not be of much use to us. However, if we sort the customers in descending order by profit, we can see the most profitable customers at the top and the lowest profitable customers at the bottom. However, sorting these customers in ascending order by profit will give us lowest profitable customers at the top followed by the most profitable customers at the bottom.
An example of a manual sort could be sorting the regions in a specific way so that it reads NEWS (North, East, West, and South).
There are various ways of sorting the data in Tableau. Let us look at the steps in the following recipe.
We will continue working in the same workbook, My first Tableau Workbook
, and will use the already connected Orders data from our Sample - Superstore.xlsx
Excel file. Let us follow the steps in the following recipe to learn how we can sort the data in Tableau.
Sorting
.Orders (Sample - Superstore)
to enable the Dimensions and Measures of that dataset. Once we do that, drag Sub-Category from the Dimensions pane and drop it into the Rows shelf, followed by dragging Sales from the Measures pane and dropping it into the Columns shelf. This will result in a bar chart as shown in the following screenshot:The preceding view may not look sorted if we look at the length of the bars. However, if we look at the color of the bars, we will see that the bars are sorted by color which is Profit. So, the bar with highest Profit is dark blue in color which is right on the top. This is followed by bars that have lighter and lighter shades of blue which are then followed by shades of orange to indicate losses.
Another option to sort is from the Dimensions pane. If we select the Default Properties option by right-clicking on the Dimensions that needs to be sorted, then we will get a Sort… option. Refer to the following image:
If we set the sort order for a field in the Dimensions pane by using the Default Properties option, then it becomes the default sort order for the entire workbook whereas if we set the sort order for a field in the view, then the sort order applies only to the specific sheet view.
18.226.170.187