Tableau Sort Data

Data present in the worksheet can be sorted based on the requirement. It can sort the data based on the data source such as ascending, descending order, or depend on any measured value.

The procedure for sorting the data is given below, step by step:

For example, consider a data source such as sample-superstore, and you want to sort the dimensions and the measures fields as follows.

Step1: Add the sample-superstore data source with Tableau and drag the Order table to the pane shown in the below screenshot.

Tableau Sort Data

Step2: Go to the worksheet and drag the dimension Category to the row shelf and the measure Sales to the column shelf.

Tableau Sort Data

It creates a horizontal bar chart. Category field present in the visual order, and it is sorted based on data source by default. We can change the order of sorting by following the below procedure.

Step3: Right-click on the Category field and select Sort option.

Tableau Sort Data

After that, it opens the Sort window. All options present inside the sort window is shown below as follows:

Tableau Sort Data
Tableau Sort Data

Sort Order

  • Ascending: It sorts the order of selected dimensions and measures in ascending order.
  • Descending: It sorts the order of selected dimensions and measures in descending order.

Sort By

The field can be sorted in different types of methods that are explained below as follows.

  • Data source order: It sorts the field based on data source order.
  • Alphabetic: It sorts the dimensions and measures in alphabetical order.
  • Field: It sorts the field based on the other measure or dimension values.
  • Manual: It can manually sort the data.

For example, suppose the Category field is sorted based on another field such as 'Sales'.

Step1: Click on 'Field' radio button.

Step2: Select the field on which the Category is to be filtered.

Step3: Select the aggregation type.

Step4: Click on Clear button.

Tableau Sort Data

In the above example, it filters the Category field based on the sum of sales in ascending order. And it sorts the data which is shown in below screenshot.

Tableau Sort Data




Latest Courses