During my Corporate Tableau Training in Gurgaon , i get questions many time regarding Parameter in Tableau .
It is always better to add some dynamism into our visualizations through Parameters. Parameters are dynamic values that can replace constant values in calculations, filters, and reference lines. And, if I put it in my words, it is like giving the right to the user to choose the analysis that he wants to do. So, with this concept let’s develop a visualization that will help us analyze different dimensions.
Use Case: We want to do an analysis of the Customers, Sub Category, State and various Categories that we have in Sample Superstore.xls data set. We will analyze each of these dimensions against multiple measures, like, Sales, Profit and Discount with proper number formatting. So, in nutshell what exactly do we have to analyze? Well, let’s put it in bullet points:
We have to analyze few Dimensions and these are: Customer Names, State, Sub Category and Category.
We have to analyze the above mentioned dimensions against various measures, like, Sales, Profit and Discount.
We have to use a proper number formatting for each of the measures.
Setting up Tableau: We will use Sample Surstore.xls data set with only Orders Table. Now, the results may vary due to the difference in the data set but please follow the steps properly so that the analysis is exactly same.
Step- 1: Parameter to select multiple dimensions (Dimension Selected)
Let’s create a parameter that will help use to choose from the dimensions that we have to do our analysis on, and, we are going to call this parameter “Select a dimension”
After establishing the connection between Tableau and the data set we will go to the sheet and open up a Parameter window like below:
This will give us a parameter pop- up where we will put the below values:
Then we have to create a calculated field with the below formula and name:
Next, we will bring this Calculated field Dimension Selected that we will find in our Dimensions to the Rows and put Sales to Column and bring our dimension selected parameter to the sheet by Show parameter control; like below:
After this change your parameter and see how your visualization is changing depending on the dimension that you choose.
So, we have achieved the first step of our analysis.
Step- 2: So, now we have to make a parameter that will help us choose from the different Measures value: Sales, Profit and Discount.
For this again we will open a parameter and give it a name “Sort By” like below:
Next we have to create a calculated field “Sort By” that will support the parameter. So, we will open a calculated field and create it with the following name and formula:
Now, we will right click the “Sort By” parameter in by Show Parameter Control we will bring this to the sheet.
Next, we will go to the field “Dimension Selected” that is on Rows shelf and with right click open the Sort option and Sort the visualization in Ascending on Field Sort By.
Now, when we change the Sort By Parameter we will notice that our visualization is Sorted descending on that measure.
So, we have achieved step 2 of our analysis.
Step- 3: Finally, we have to create a dynamic number formatting. So, for that we have to create 3 Calculated field to format the Sales, Profit and the Discount.
After you have created the calculated fields you can go to the Default Properties of each of these 3 calculated fields on the data pane and give it the number formatting of your choice. I have given the below:
After you have set the Default properties for each of the 3 calculated fields, you can bring this to the text shelf in the Marks card.
If you notice that each of the bars in the visualization is not having a label next to it, then to fix this, open the label shelf and bring the 3 calculated field next to each other, like below image:
After this step, you will get the labels next to each of the bars.
Now, the Formatting part:
Drop the “Sort By” parameter in the color shelf and choose a different color for each of the Measures.
Bring “Sort By” parameter net to the “Sort By” calculated field already placed in the column shelf and from the axis right click to “Hide Field Labels for Columns”
Now, For the Dimension Selected put the “Dimension Selected” parameter and in the same manner do the formatting.
Finally, our visualization is complete.
Reach out to us if you are looking for Corporate Training to Build The Next Generation Analytical Workforce with an in-depth understanding of Exploratory Data Analysis , Data Visualisation, Data Analytics , AI First , Machine Learning & Deep Learning Training & Consulting helping them to take Data Informed Decision at each stage of the business.
We understand that At the present times , the Entire Industry is in a Tranformation stage with the Softwares being rebuilt with Artificial Intelligence Capabilities .
We need SMART WORKFORCE for the SMART SOFTWARES to reap the maximum return .
Whatsapp at +91-9953805788 or email at - email@example.com if you would like to know more .