Why Vizioneer?

My photo
Atlanta, Georgia, United States
The "Vizioneer" comes from mashing two words that have shaped my world for most of my adult life - Engineer and [data] Visualizations (or Vizes to those who know what's up). Graduating from first from Oglethorpe University in Atlanta, followed by Georgia Tech with my Bachelors and Masters in Civil Engineering, all of which taught me to think through anything and everything - problem solving, "engineering" solutions, teaching to the "ah ha" moments - is what I love to do. In 2010 that investigative, engineering mindset intersected a job change and a plunge into the world of Data Analysis. In the search for the next great thing I stumbled on to a data visualization and dashboarding product called Tableau software and things just took off. So now I guess you could call me that engineer with the sweet data visualizations - or just "The Vizioneer" :)

In 2013, I joined the incredible team at Slalom, focusing on Tableau and it's been an amazing experience. Recently in 2014, I was honored and humbled to receive Tableau's highest recognition of being named a Tableau Zen Master. Follow along to see what happens next :)

Wednesday, April 16, 2014

Day 16: KPIs from Table Calcs

You didn't think we'd get through 30 days without talking about Table Calcs did you?  Table Calcs are like Tableau's black box - very powerful, but often misunderstood.  It's one of the quickest ways to discover trends in the data.  The list of built in capabilities and ways to look in to the data is just awesome (we'll show the full list in a minute).  Another thing we talk about all the time with clients is the ability to have the 20 second view of key metrics, often called Key Performance Indicators (KPIs).  Today we'll look at how to create a table calculation and then leverage it to create a KPI.



Before we talk about how to do this in one particular way, let's start with all the different table calc options Tableau makes available.  The way to see this is to place a date field on columns and a measure on the text shelf, right click the measure, and hover over Quick Table Calculation and you'll see all these:































All of these options are really useful in the right circumstance.  Today we're going to look at Year over Year Growth of Profit (from our favorite, Superstore Dataset).  Let's get going.  The set up is really simple - start with Order Date on columns and throw Profit on to the text shelf.  Should look like this:






















So that we don't lose track of where we are from a raw numbers perspective we're going to bring Profit back in a second time - put it on details and then right click and go down to Quick Table Calculation>>Year over Year Growth.  Now click on the white space to the left of it and add it also to the text self.  You should now have two rows of the exact same Profit data and should now see this:























We can look and do some mental math and see that this looks spot on.  The cool thing is that we can actual dig into this down to the quarter, month, week... level by simply marching down the date hierarchy. I'm going to take it down one level to quarter and see that this still works:













Not what you expected?  This is like Q1/Q1, similar to the way public companies report earning.  Not what you wanted?  You can change the way the table calc works.  Right click on that pill and hit Edit Table Calculation and you get this box:
















To get the quarter by quarter view you we expecting just change the level to Quarter of Order Date.  Change it and you get this:





Now for the trick - here's the easy way to create a KPI from this.Right click and go back to edit the table calc.  On the bottom left you see a button that says Customize - click it and it brings up the calculated field that Tableau worte in order to produce the table calculation you saw.  Here's the fun part.  Copy it and kill the window.  Create a new calculated field and paste it in there.

At the end of the calculation add ">0".  Now, write an if statement, with the formula as the boolean, followed by "then "Up" else "Down" end".  The whole thing should look like this:



























This field will now go on to the shape shelf (one you change the mark type to shapes).  Click on the shape legend and take advantage of the KPI shapes that are already in Tableau.  I went with green circles and red diamonds.

After a little formatting we get this little table:















If we hid the bottom row, we'd have the beginnings of a pretty sharp KPI dashboard.  And now you know how to make it happen.




Thanks for playing along!

Nelson



3 comments:

  1. Heads up, there's a server error and the workbook won't load. Thanks.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete