Perform Data Sorting in Tableau

Last updated on Oct 25 2021
Anand Vishwanathan

Table of Contents

Perform Data Sorting in Tableau

In the data source, data can be stored based on the user requirement. It can be sorted using data source order such as A to Z ascending, Z to A descending, A to Z ascending per table and Z to A descending per table.
Once the data is connected with Tableau, data sorting is done using the Sort Fields option. The Sort Fields option is present in the Data Source tab.
There are two ways to sort the data in Tableau:
1. Manual sorting: Manual sorting is a sort that rearranges the order of dimension fields by dragging them next to each other in ad hoc fashion.
2. Computed sorting: The computed sorting is a sort which is directly applied on the axis using the sort dialog button.

Page 1 Image 1 33
Sort Fields

When viewing a visualization, data can be stored using the single-click option from a header, an axis or field label.

Quick Sort from an Axis, Header and Field Label

There are many ways to sort a visualization with single click sort buttons:
• In all cases, one-click means sorts the data in ascending order, and two-click means it sorts the data in descending order, and three-click means clear the sorts.
• If the underlying data changes, the sort will update correctly.

Page 2 Image 2 31
sort visualization

Sort from an Axis

• Float over a numerical axis to get the sort icon.
• Click that icon to sort.

Page 2 Image 3 16
Sort from Axis

In the above example, the sort is applied on Color rows based on the values of Metric A. If there are hierarchical dimensions shown in above example, that type of sort is used on the inner dimension. Here, it means that Color rows will sort inside Hue. Dark magenta cannot be sorted at the top of the viz because it should stay inside the Purple Hue.

Sort from a Header

• Float over a header to get the sort icon.
• Click that icon to sort.

Page 3 Image 4 16
Sort from a Header

In the above example, the sort is applied to a Material column such as Paint, Paper and Fabric based on the values of Green since the header is used for the sort.

Sort from a Field Label

1. Float over a field label to get the sort icon.
• For a field label, the sort icon is slightly different from an axis or a header. Alphabetical sorting is the default option, but there is also a menu for choosing to sort by a field in the view.

Page 3 Image 5 11
Sort from Field Label

2. Click on the A-Z icon to sort alphabetically, or open the menu to see a list of fields which is possible to sort according to the field. Then, click on sort after the icon switches to the bar icon.

Page 4 Image 6 10
bar icon

In the above example, the sort is applied to the outermost dimension such as Hue is based on Metric B. (Metric B is aggregated for all the colors inside each Hue, and Hue is sorted as first is Purple, then Green, then Blue.)

Missing Sort Icons in Tableau

• If the sort icons do not appear, then this functionality may be turned off, or it cannot be possible to sort the view.
For example, Scatter plots cannot be sorted by a numerical axis because the data entirely determine the position of the marks. No sort icon will appear on the axis in scatter plots.

Sort Options While Authoring in Tableau

In an authoring environment, there are some additional sorting options, such as:

Sort from the Toolbar

1. Select the dimension which you want to sort.
• The default behavior has to sort the deepest dimension If you do not select a field before sorting,
2. Choose the appropriate sort button such as ascending or descending order in the toolbar.

Page 5 Image 7 5
Sort fromToolbar

In the above example, the sort is applied on Hue unless the Material field is selected before sorting. In the case of Metric B, the toolbar sort applies to the leftmost measure.
And to sort by Metric A, it would be necessary to use another method of sorting or reverse their order on the Columns shelf. (To see the effect of sorting by Material, Hue is removed from the view. this makes it easy to see how the sort is computed.)

Sort by Drag and Drop

To sort manually, select a header in Viz or on a legend and drag it to the current location shown below:

Page 5 Image 8 8
Sort by Drag and Drop

Tableau Replacing Data Source

Tableau can connect multiple data sources within a single workbook. The different data sources can be used to create various dashboards and sheets in Tableau. In some cases, the data source is needed to replace with the updated file.
Tableau has the data source replacing feature which can replace the data source. This feature does not affect the already built visualizations using the old data source. It is important to keep or replace all the used dimensions and measures while replacing the data source.
The data source connected in Tableau can be replaced with another data source. The procedure for replacing data source is shown in the below screenshot:

Page 6 Image 9 1
Replacing

Step1: Go to the connected data source or multi connection in Tableau.
Step2: Then,
• Select the data source which you want to replace.
• Right click on the data source.
• Select the “Replace Data Source” option.

Page 7 Image 10 3
Replace Data Source

Step3: It opens the “Data Source Replacement” window.
• Fill the Current option.
• Then fill the Data Source Replacement option.
• Click on OK button to replace the data source.

Page 7 Image 11 2
Data Source Replacement

So, this brings us to the end of blog. This Tecklearn ‘Perform Data Sorting in Tableau’ blog helps you with commonly asked questions if you are looking out for a job in Tableau Desktop. If you wish to learn Tableau Desktop and build a career in Business Intelligence domain, then check out our interactive, Tableau Desktop Training, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

Tableau Desktop

 

Tableau Desktop Training

About the Course

Tecklearn’s Tableau Desktop Training teach you how to transform raw data into interactive and shareable dashboards using Tableau. Our Tableau Course covers the necessary analytical skills to Advanced data visualizations by incorporating real-world use-case scenarios, labs, and exercises. Some of the topics included are Data Blending, Data Mapping, Graphs, creation of charts, and LOD expression by using different versions of Tableau, such as Tableau Desktop, Tableau Reader, and Tableau Public.

Why Should you take Tableau Desktop Training?

• The average salary of a Tableau Professional ranges between $108,697 to $158,000 per annum -Indeed.com.
• Tableau has been positioned as a Leader in the Gartner Magic Quadrant for Analytics and Business Intelligence Platforms – Gartner.com.
• Fidelity Investments, Capgemini, EY, Deloitte, EY, JP Morgan, Verizon, Facebook, Dell, General Motors, KPMG, Bank of America and 40,000 other MNCs worldwide across industries use Tableau.

What you will Learn in this Course?

Understanding Tableau

• Why Tableau
• Tableau Product Platforms
• Tableau Architecture
• Tableau Interface

Data Connection with Tableau Desktop

• Features of Tableau Desktop
• Connect to data from File and Database
• Types of Connections
• Data Blending
• Joins and Unions
• Tableau Desktop User Interface
• Basic project: Create a workbook and publish it on Tableau Online

Basic Visual Analytics

• Visual Analytics
• Basic Charts: Bar Chart, Line Chart, and Pie Chart
• Hierarchies
• Data Granularity
• Highlighting
• Sorting
• Filtering
• Grouping
• Sets

Advanced Visual Analytics

• Parameters
• Tool tips
• Trend lines
• Reference lines
• Forecasting
• Clustering

Calculations in Tableau

• Calculated Fields
• Numeric, String, Data, Logical, Addressing and Partitioning
• Table Calculations

Level of Detail (LOD’s) Calculations

Advanced Charts in Tableau

• Box and Whisker’s Plot
• Bullet Chart
• Bar in Bar Chart
• Gantt Chart
• Waterfall Chart
• Pareto Chart
• Control Chart
• Funnel Chart
• Bump Chart

Parameters

• What If Scenarios
• Parameter in CF (KPI control)
• Parameter in Filter (Top N)
• Parameter in reference line

Dashboards and Stories

• Introduction to Dashboards
• The Dashboard Interface
• Dashboard Objects
• Building a Dashboard
• Dashboard Layouts and Formatting
• Interactive Dashboards with actions
• Designing Dashboards for devices
• Story Points

Data Security in Tableau

Optimizations tips and tricks

Interacting with Tableau Server

Working with Tableau JavaScript API

Got a question for us? Please mention it in the comments section and we will get back to you.

0 responses on "Perform Data Sorting in Tableau"

Leave a Message

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