Just got back from Tableau Conference 2017! I’m putting together a teach-back for work, and figured I would share it here too!
At the conference I attended these Hands On sessions:
Advanced Calculations – 8 hour paid class
Table Calcs for the advanced analyst
Tableau + Python = ❤
LOD Expressions vs. real world
You can access workbooks and other materials from the sessions for free at TClive.
All Table Calculations have three basic parts
- An aggregated field (Blue)
- Values used in the calculation
- Calculation Type (Orange)
- Calculation to Perform
- Compute Using (Green)
- Scope and Direction of Calculation
Some Calculation Types have additional options, allowing you to change the order, computation, or add a secondary calculations.
Understanding the Compute Using menu is key
Note – Compute Using Options handle Null values inconsistently. See Workbook
Calculation Assistance is super helpful! It will highlight the scope of your Table Calc, and for most marks, the order of the values. The value order might not appear if the mark type is text.
Compute Using Specific Dimensions allows more control over scope and direction.
Selecting Specific Dimensions enables a box with a checklist of dimensions from the view. Unselected dimensions act as Partitioning Fields.
The order of the selected dimensions determines the direction of the Table Calculation. Drag and drop dimensions within the box to re-order.
If you use Specific Dimension, you may need to manually update the settings when adjusting the dimensions in your view.
Using Table Calcs in Calculations
After creating a table calculation, drag it into the data pane to turn it into a calculated field. From there, you can edit the calculation and add on to the calculation.
Scope and direction will still be adjusted through the Edit Table Calculation menu.
Using Table Calculations as Filters
Once you turn a Table Calc into a Calculated Field, you can use that field as a filter. Unlike any other filter, Table Calculations must be completed before Table Calc filters affect the view. This means that Table Calc filters are uniquely suited for situations where we need a subset of the underlying values to feed into Table Calculations, but don’t want to actually see them in our view.
For example, this Table Calc is comparing quarterly sales to the previous year.
The Table Calc for 2012 is null because there’s no 2011 data to calculate off of. Filtering Order Date to remove 2012 would prevent the Table Calcs from using 2012 values to generate 2013 results. In this case, we could hide 2012 from the view, but if the view had interactivity that impacting the starting point, a Table Calc filter would be a more dynamic choice.