Monday, January 28, 2013

Table Calculations in Tableau

Today, we'll look at what is arguably Tableau's most important feature, table calculations.  First, let's go through the steps of making a simple Table Calculation.  As usual, we will use the Superstore Sales sample data set from Tableau.

Step 1: 
  • Create a Worksheet.
Profit by Region
Step 2: 
  • Right-Click SUM(Profit) in the Text Pane
  • Select "Quick Table Calculation -> Percent of Total"
Percent of Total Profit by Region
Congratulations, you've created your first table calculation.  Now, you can see which regions are the most profitable at a glance.  This is only the tip of the iceberg though.  There is much more that can be done here.  First, you can edit your table calculations to be more complex.  Let's revise our percent of total be able to handle a 2-dimensional table.

Step 3: 
  • Add Another Dimension to the Worksheet
Percent of Total Profit (?) by Region and Category
Looking at this, we see that something isn't right, our percent of total is by column (Notice how each column adds up to 100%, but each row does not).  We want it to be for the entire table.

Step 4: 
  • Right-Click the Table Calculation
  • Select "Compute Using -> Table (Across then Down)"
Percent of Total Profit by Region and Category

There is so much more that can be done with Table Calculations.  Alas, we'll have to save that for another post.  Thanks for reading.

Brad Llewellyn
Associate Consultant
Mariner, LLC
llewellyn.wb@gmail.com
https://www.linkedin.com/in/bradllewellyn

No comments:

Post a Comment