Table Calcs – TC 17 Takeaways

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.

Resources - Copy.PNG
Screenshot of the TC live Resources Page with relevant Resources saved

Table Calc Menu - Copy - Copy
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

Compute Using determines Scope and Direction
Michel Sandberg’s site datavizblog.com has a great guide for scope, including some awesome visuals that I’ve borrowed below

Scope - Copy.PNG
Source: Data Viz Blog – Tableau Calculations Scope and Direction by Michael Sandberg

Scope:

Scope2 - Copy.PNG
Source: Data Viz Blog – Tableau Calculations Scope and Direction by Michael Sandberg

Direction:

Direction - Copy.PNG
There’s also Across then Down, which looks like the inverse of Down then Across.  These directions are shown at a Table level of Scope.

Note – Compute Using Options handle Null values inconsistently. See Workbook

This slideshow requires JavaScript.

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.

Calculation Assistance - Copy

 

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.

Specific Dimensions - Copy
Source: VizWizTable Calculations Overview by Andy Kriebel

 

The order of the selected dimensions determines the direction of the Table Calculation. Drag and drop dimensions within the box to re-order.

This slideshow requires JavaScript.

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.

Calculation - Copy

Scope and direction will still be adjusted through the Edit Table Calculation menu.

Using Table Calculations as Filters

Order Of Operatons - Copy

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.

Filter - Copy

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.

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s