Tableau Tutorials

Tableau Group, Hierarchy, Sets & Sort Data

Learn the different techniques to implement Tableau Group, Hierarchy, Sets, Sort features to create the best data visualizations.

Sort Data

Data available in the worksheet can be sorted based on the requirement. Data can be sorted based on the data source such as ascending, descending order, or depend on any measured value. There are mainly two ways of sorting the data:

  1. Manual Sorting: It rearranges the order of dimension fields by dragging them next to each other in an ad hoc manner.
  2. Computed Sorting: This sort is directly applied on the axis using the sort dialog button.

The steps to sort data are given below:

Consider a data source named Sample – Superstore, and you want to sort the dimensions and measures fields.

Step 1: Add the data source with the Tableau and drag the Order table.

Tableau Sort Data

Step 2: Go to the worksheet and drag the Category field (dimension) to row shelf and Sales field (measures) to the column shelf.

Tableau Sort Data

It will create a horizontal bar chart by default. The Category field is present in the visual order, and it can be sorted based on data source by default. The Sort order can also be changed.

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

Tableau Sort Data

It will open a Sort window. All options available in the Sort window are given below:

Tableau Sort Data

Sort By: The different types of methods to sort a field are:

  • Data Source Order: It will sort the field based on the data source order.
  • Alphabetic: It will sort the fields in alphabetical order.
  • Field: It will sort the fields based on other measure or dimension values.
  • Manual: It will sort the data manually.
Tableau Sort Data

Sort Order 

  • Ascending: It will sort the dimensions and field in ascending order.
  • Descending: It will sort the dimensions and field in descending order.

Suppose you want to sort the Category field based on another field Sales.

Step 1: Click on the Field radio button.

Step 2: Select the name of the field on which the field Category is to be filtered.

Step 3: Select the type of aggregation.

Step 4: Click on the button Clear.

Tableau Sort Data

It will sort the Category field based on the sum of Sales in ascending order.

Tableau Sort Data

Data can also be sorted using the single-click option from a header, an axis, or field label.

One-click means will sort the data in ascending order, two-click means it will sort the data in descending order, and three-click means it will clear the sorts.

Sort on the basis of an Axis:

To sort on the basis of an axis, float over a numerical axis to get the sort icon and click on that icon.

Tableau Data Sorting

Here, the sort is applied on Color rows based on the values of Metric A. It means that Color rows will sort inside Hue.

To sort from a header, float over a header to get the sort icon and click on that icon.

Tableau Data Sorting

Here, the sort is applied to a Material column such as Paint, Paper, and Fabric based on the values of Green.

Sort on the basis of a Field Label:

To sort on the basis of a field, float over a field label. Here the sort icon will have a slight difference as compare to axis or header. Alphabetical Sorting is the default option, but you can change the sort order.

Tableau Data Sorting
Tableau Data Sorting

Here, the sort is applied to the outermost dimension, such as Hue is based on Metric B.

Create Groups

Groups are used to combine related members present in a field.

Consider a data source such as Sample – Superstore. Drag the Sales field in the column shelf and Category field in row shelf.

The aggregate values of Furniture and Office Supplies can be obtained by using the group.

The steps to create a group are given below:

Step 1: Right-click on the field Category.

Step 2: Click on the option Create.

Step 3: Select option Group.

Tableau Build Groups

Step 4: It will open a Create Window group. Enter the name of the group, select the members you want to group, and click on the Group button.

Tableau Build Groups

Step 5: It will open an Edit Group window. It will create a group of Furniture and Office Supplies. Click on the OK button.

Tableau Build Groups

It will create a group named as Category (group) and add it in dimensions list.

Tableau Build Groups

Create Hierarchy

Hierarchy is an arrangement where entities are presented at various levels. It is used to visualize the data at a granular level.

Consider a data source such as Sample – Superstore and its dimensions and measures.

The steps to create a hierarchy are:

Step 1: Go to the worksheet and select a dimension. Right-click on the dimension to create a hierarchy.

Select the option Hierarchy and then click on Create Hierarchy.

Tableau Build Hierarchy

Step 2: It will open a Create Hierarchy window. Enter the name of the hierarchy and click on OK.

Tableau Build Hierarchy

The hierarchy will be created, as shown below:

Tableau Build Hierarchy

Step 3: You can also add another field. For example, the field State can also be inserted into the Country hierarchy.

Tableau Build Hierarchy

Remove a Hierarchy

Inbuilt hierarchy can also be removed.

Step 1: Select the name of the hierarchy you want to remove.

Step 2: Right-click on the hierarchy.

Step 3: Select the option Remove Hierarchy.

Tableau Build Hierarchy

Build Sets

Sets are the custom fields, and it contains a subset of data based on some conditions. Sets are created as a set of members out of the field present in a data set.

The steps to create sets are:

Step 1: Go to the worksheet and right-click on the dimension Sub-Category. Select the option Create and then click on the option Set.

Tableau Build Sets

Step 2: It will open a Create Set window. Enter the name of the set, select the members you want to add in the set, and click on OK.

Tableau Build Sets

It will create a set of selected members.

Tableau Build Sets

Show Members in Set

After the set is created, you can also see the selected members of a set:

Step 1: Right-click on the set.

Step 2: Click on the option Show Members.

Tableau Build Sets

It will then show all the selected members of the set.

Tableau Build Sets

Edit the Set

After the creation of a set, it can also be edited to add or remove the members of a set.

Step 1: Right-click on the set.

Step 2: Click on the option Edit Set.

Tableau Build Sets

After clicking on the Edit Set option, an Edit Set window will open. You can edit the members here:

Tableau Build Sets

Facebook Comments
Tags

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button
Close
Close