What do we use when we want to add interactivity and more control for the end user in our Tableau views? Of course, there are several correct answers here, but the first thing we have in mind, and perhaps one of the most common, is „parameters”. There are countless ways to use parameters in Tableau, but that is not the purpose of today’s post. In the following lines we will discuss about how to sort multiple sheets using different measures.
In today’s post we will create an example of analysis in Tableau, which at first glance may seem very simple and without much information to offer. Lucky us, Tableau users, is that parameters in Tableau give end users the opportunity to identify answers that they do not expect either. Regardless of the analysis or graph we create and how we chose to use parameters, they reveal information that would not normally be identifiable in a data set.
In today’s post, we chose to create a simple table, which exposes some dimensions from our data set, in our case, categories and sub-categories. Next, we want to sort these subcategories considering different measures, such as: sales, profit or quantity. Their sorting will of course be done, using a rank or a top, depending on the value of each measure. For even more control for the end user, we choose to add an additional parameter that will allow him to select the order in which he wants to display the values of the measures, respectively ascending or descending.
Sorting multiple sheets using different measures may seem simple, but at the same time complex. It all depends on how we want to build the visualization and the features we use. In this case, the best way to sort different measures is to use parameters and a single calculated field. The final view gives us the opportunity to select how we want to sort or classify certain dimensions, depending on the measures or values that interest us and that are significant to us.
Next, the video below will show you how you can sort different measures in Tableau using some parameters and a calculated field. Also, every step you must go through is mentioned below.
→ In Tableau Desktop, connect to Tableau: Sample Superstore
→ Create a Parameter: Sort by
Data type: String
Sales
Qty
Profit
→ Create a Calculated field: Measure
CASE [Measure]
WHEN ‘Sales’ THEN sum([Sales])
WHEN ‘Qty’ THEN sum([Quantity])
WHEN ‘Profit’ then sum([Profit])
END
→ Create a Parameter: Sort
Data type: String
asc
desc
→ Create a Calculated field: Rank
RANK(Measure, [Sort]
→ Drag Category on Rows
→ Drag Sub-Category on Rows
→ Drag Rank pe Rows and select discrete, Compute using: Sub-Category
By Eduard Arhire
How to Retrieve and Process JSON Data from a REST API in Talend Are you working as a Data Engineer, and have you started using Talend? Maybe in one of your projects, you need to retrieve data from a REST […]
💡 Unlock the Power of Tableau for Smarter Data Decisions Are you ready to transform the way you see and use data? Tableau is more than just a data visualisation tool, it’s your gateway to interactive, intuitive, and impactful business […]
You are working at a Data Analytics company, and in one of your projects, you need to load data from a source into a target table using Talend. However, while running the Talend Job, the data will fail to load […]