Easy way to identify the Addressing and Partitioning fields of Table Calculations in Tableau
One of the topics that I found very tricky when starting out in Tableau was working with and modifying Table Calculations.
We can simplify things a bit by first identifying the Addressing and Partitioning fields of a Table Calculation.
What is a Table Calculation?
A Table Calculation is used to modify the data returned into Tableau via SQL queries. Table Calculations are a special type of calculated field that work only on the local data (data inside the Tableau Workspace).
We can consider these calculations as Post SQL since they are created directly in the view. Table Calculations transform the values in a visualization.
For any view that is created in Tableau there is an underlying virtual table that is determined by the dimensions used in the view.
NOTE: We should not confuse this table with the other standard tables that are present in the data source.
What are Addressing and Partitioning fields?
Whenever we add a table calculation to a view we must use all dimensions in the level of detail either for partitioning (scoping) or for addressing (direction).
The Addressing fields are the dimensions on which the table calculation is actually performed. These fields determine the direction of the table calculation.
The Partitioning fields are the dimensions that decide the boundary within which the table calculation is performed.
These fields determine the scope of the table calculation.
Easy way to identify the Addressing and Partitioning fields
The easy way to determine the Addressing fields and Partitioning fields is by observing the selection status of Specific Dimensions in the Edit Table Calculation dialog box.
The dimensions that are selected are the Addressing fields (determine the direction).
The remaining un-selected dimensions are the Partitioning fields (determine the scope).
To better understand this concept let us build a simple cross-tab view in Tableau using the standard Sample Superstore dataset.
Drag and drop the Sub-Category dimension on the Rows shelf.
Drag and drop the Region dimension on the Columns shelf.
Drag and drop the Sales measure into the view on Text of Marks card.
Right-click the Sales pill, Select Quick Table Calculation > Percent of Total
To better understand how the Percent of Total Table Calculation works let us add both Row and Column Grand Totals to the cross-tab view.
Analysis Menu > Totals > Show Row Grand Totals
Analysis Menu > Totals > Show Column Grand Totals
Given below is the final view with both Grand Totals added.
Right-click the Sales pill, Select Edit Table Calculation.
For this Percent of Total Table Calculation the default Compute Using option is Table (across).
In this case the Region dimension is the Addressing field as it is selected.
Sub-Category dimension is the Partitioning field as it is un-selected.
The below example is the same Percent of Total Table Calculation for which the Compute Using option is the entire Table.
In this case both Region and Sub-Category dimensions are Addressing fields as they are both selected.
There are no Partitioning fields in this case.
The below example is the same Percent of Total Table Calculation for which the Compute Using option is Cell.
In this case both Region and Sub-Category dimensions are Partitioning fields as they are both un-selected.
There are no Addressing fields in this case.
I hope this article is useful for all Tableau users especially for anyone just starting their Tableau journey!!!