Today prepare for the next tutorial signed btProvider, where we will teach you how to customize totals to show different values than the main table of the view. For this, you can use the function SIZE () to differentiate between different parts of the view in a calculation. For example, showing a different measure or returning a Percent of Total in the Grand Totals while showing SUM([Sales]) in the view.
Are you ready to start? Follow the next instructions, step by step:
→ In Tableau Desktop, connect to Sample – Superstore sample data provided by Tableau.
→ Create Calculated Field called “Custom GT”:
IF Size() > 1
THEN MAX([Profit])
ELSE SUM([Sales])
END
→ Place the calculated field [Custom GT] in the view
→ Right-click the calculated field [Custom GT] and select Edit Table Calculation… and select Pane (across and then down).
→ Create Calculated Field called “Size” using the following formula:
SIZE ()
→ Create Calculated Field called “Custom GT 2” using the following formula:
IF [Size] > 1
THEN SUM(Sales)
ELSE SUM(Sales)/TOTAL(SUM(Sales))
END
→ Build the view with the desired dimensions.
→ Place the calculated field [Custom GT 2] in the view.
→ Right-click on [Custom GT 2] in the Marks card and select Edit Table Calculation…
→ In the Table Calculation dialogue, set the Nested Calculations to [Size]
→ Under Compute Using choose Pane (across and then down) and click OK.
→ Right-click on [Custom GT 2] in the Marks card and select Format…
→ In the left-hand Format pane, Under Totals, in the Numbers dropdown, select Percentage
If you like video tutorials, we recorded for you the entire process as you can see in the #skillpill video below, created by our colleague Andreea Chiriac, Data Analyst.
As Tableau Software Premier Partner we are continuously advising and supporting our customers in using Tableau on a daily basis. This means analysing the data and understanding its evolution through creative and insightful dashboards. Our team of Data Analysts are qualified to explain and guide the company’s internal data teams in the journey to become more data-driven.
We hold the technical and sales certifications for all products: Tableau Desktop, Tableau Server, Tableau Prep, Tableau Data Management.
With Tableau Software you can always understand your business or your job better. Using Tableau, you will take smart and strategic decisions and you will quickly understand the data flow, numbers and results it produces.
Are you interested in learning more about Tableau or implement the solution in the entire company? Contact us!
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 […]