October 24, 2014

Tableau Tip: Blending data sets that have different max dates

Fun little problem at work today. Imagine you have four data sources that all have a Date field in common, but they all land in your database at different times. You want a view of the data for the latest date that they all have in common.

Here's a sample of data the represents the situation:

            

Inside Tableau, these are four different data sources.  I blend them all together onto a single worksheet like this:


What I desire is to only show the data for the latest date that all four data sources have in common, 10/17/2014 in this example. While there might be a more efficient way to perform these calculations, I want to share the approach that I took to solve the problem.

First, I created a calculated field in each data source to get the max date. Note that I've set the table calculation to calculate along Date.


I then added each of these calculations to the view to make sure I was getting the results I wanted.


Sweet! This is exactly what I was hoping for. Next I need to determine which one of these four dates is the minimum and then return the date from that data source. This is the calc I created and it's kinda messy, but it works. Note this I set the calc to compute along Date.


This calc returns 10/17/2014, which is exactly what I was expecting. One more step. I need to create a calculated field to use as a filter in my view so that I only see one row.


I add this to the Filters shelf, set the Compute using to Date and choose True. That's it!


If anyone knows a more efficient way to do this, I'm all ears! Download the workbook here.

October 23, 2014

Facebook Jeopardy: My extract has been failing for the last 3 days and I just noticed

Alex, I'll take Tipping The Scale for $200 please. The answer is:
My extract has been failing for the last 3 days and I just noticed
Anyone that uses Tableau Server can benefit from this hack. Our admin team created this awesome tool that monitors the extract refreshes on Server and sends us notifications once extracts complete or fail. Imagine a life where you have trigger kicking off your extracts and you have a service that monitors your extracts; that's what we have and it freaking awesome!

While we cannot share the code for this (it's built on our internal code stack anyway), the idea and the implementation is quite simple. A couple weeks ago, I was at Tableau HQ and did a deeper dive into this for them; here's to hoping they add this into Server as a standard feature.
Here's the demo of the hack from #DATA14 (the hack starts at 10:22 if it doesn't start there automatically):




October 20, 2014

Monday Makeover: Causes of Death in the USA

Today, Tableau's Viz of the Day team chose this visualization from John Schoen of CNBC.  Click on the image to go to the interactive version.


One of my frustrations with Viz of the Day, as I've noted on both of my appearances on the Tableau Wannabe Podcast, is that I suspect people look at these as examples of visualizations done well, even though that's not the true intent. Yes, I'm saying that anecdotally, but I base this off of a few conversations I've had with people about it.

In today's viz, there are an abundance of issues.  Here are a few:
  1. The filled map makes it impossible to see the smaller states. In fact, it's nearly impossible to trigger the action when hovering over Rhode Island. Filled maps can easily skew the data towards the larger states, so a bubble map is preferred.
  2. The temperature diverging color palette for the map is not color-blind friendly. 
  3. The colors on the map and on the packaged bubbles are too similar.  Green on the map means a low rate, while green on the bubbles means cancer.
  4. The stacked bar chart in the middle adds no value. When you hover over a state, the packed bubbles changes, so what value is the stacked bar chart adding.
  5. Packed bubbles are a very poor way to communicate ranking. A sorted bar chart is better. 
Given these problems, I decided to give it a quick makeover today. I stayed within my one hour time limit that I generally set for these makeovers, so I realize there is probably more I could have done.

In my one hour, I attempted to address all of the issues I pointed out above.

  1. I changed the map to a bubble map. Now it's easier to see all states because I've also sized the states by the number of deaths for additional context.
  2. I'm using a blue-red color palette consistently throughout to represent the death rate.
  3. I removed the individual colors for the diseases and colored them by the death rate instead.
  4. I killed the stacked bar chart. I also included an action from the bar chart to the map (in addition to the existing map to bar chart action).
  5. I changed the packed bubbles to a ranked bar chart.
Simple changes that take very little time can often make for a much more pleasing visualization.

What else would you have done? Download the workbook here and give it a shot.

October 17, 2014

Facebook Jeopardy: Create a Single Sheet Waterfall Chart in Tableau

Alex, I'll take No Assembly Required for $200 please. The answer is:
I want to build a waterfall chart, but it's taking 9 minutes for my 37 sheet dashboard to render. 
Waterfall charts are a great way to show system or process flow, but the typical method to do this in Tableau requires you to create lots of sheets and then strategically place them on a dashboard. Jonathan Wehrer on our team created a way to shape his data using the scaffolding technique that Joe Mako talks about often to come up with a method for viewing an entire waterfall chart in a single worksheet.

Here's the demo of the hack from #DATA14 (the hack starts at 17:14 if it doesn't start there automatically):


The final viz looks like this:


Download the Tableau workbook here.

October 15, 2014

Tableau Wannabe Podcast: Episode 10 - Viz of the Day, Arsenal & Willard Brinton

Thank you Matt Francis and Emily Kund for inviting me back to the amazing Tableau Wannabe Podcast! You can download the podcast on iTunes and on SoundCloud or listen to it below. I learned a ton from their feedback!

This week, Matt, Emily and I:
  1. Reviewed the Maharashtra Election dashboard from Viz of the Day
  2. Conducted a live discussion and made updates to my Arsenal Injury Crisis viz
  3. Discussed Andy Cotgreave's amazing talk from #DATA14 - 100 Years of Visualization Best Practices—It's Time to Stop Making the Same Mistakes

October 13, 2014

Facebook Jeopardy: Maintain Context by Creating Pop-up Charts in Tableau

Alex, I'll take No Assembly Required for $100 please. The answer is:
I like drilling down, but I hate losing context by switching tabs. 
One of our internal dashboarding tools is really good at pop-up charts, so Rob Koste on our team came up with this nifty trick for creating pop-up charts in Tableau. In the end, it's pretty simple:
  1. Create a dashboard
  2. Create a worksheet that you want to "pop-up"
  3. Add this worksheet to the dashboard as a floating object
  4. Create an action to trigger this worksheet to display. The action should exclude all value in order to hide the sheet when the action is deselected.
Here's the demo of the hack from #DATA14 (the hack starts at 14:32 if it doesn't start there automatically):



Give it a whirl in the viz below. Click on a Customer Segment on the upper right chart and see the pop-up in action.

Download the Tableau workbook here.

October 12, 2014

Makeover Monday: Arsenal's Injury Crisis - A Story

ESPNFC recently published an article providing some details about Arsenal's nearly 900 injuries since the start of the 2002-2003 English Premier League season. Last year, Arsenal crossed the 100 injury mark, suffering 111 injuries in total. This year they are picking up where they left off, with 26 so far this season. In particular, Arsenal continues to be without Theo Walcott and has suffered major, long-term injuries to key players like Aaron Ramsey, Mathieu Debuchy and, most recently, Mesut Ozil.

I found this story fascinating because it finally put numbers to Arsenal's perceived injury crisis.  They do indeed suffer way more injuries than any other EPL team. But what bothered me about the ESPN story was that they basically just listed off a few key facts (quoted from ESPN):
  1. Arsenal players have sustained 889 injuries since August 2002, according to a report by PhysioRoom.com.
  2. The Gunners' 889 injuries over the 12-year period compare to 792 for Manchester United, 620 for Chelsea and 551 for Liverpool.
  3. Abou Diaby, who has recently returned to fitness, has endured 40 separate injuries, according to the study, while Theo Walcott, who is currently recovering from a serious knee problem, features 42 times.
  4. PhysioRoom.com claims 120 of the injuries were of the hamstring variety while six anterior cruciate ligament (ACL) have been suffered.
These all seems like interesting stats, but they're missing something incredibly critical...context.

Without comparing Arsenal to their rivals, how do I know how bad their injury crisis really is? If they're suffering injuries at the same rate as their rivals, then maybe there isn't a crisis after all. But if their rate of injury is higher, then perhaps there is more to the story. Have Arsenal players always been injury-prone or have they increased since they moved to the Emirates Stadium with its rock hard surface?

I set out to understand more by downloading the injury reports from PhysioRoom.com for all teams that have participated in every year of the EPL since 2002-03 (plus a few others that are not included in my final story below). You can download the data in Excel format here.

So in a sense, today's makeover is not a makeover of a chart or dashboard; it's a makeover that takes a text-based story and adds charts and graphs to tell a more meaningful story.

Download the Tableau workbook used to create this story here.

October 10, 2014

Flowing with Tableau - The Tableau Wannabe Podcast Hangout with Joe Mako

Today, the wonderful hosts of the Tableau Wannabe Podcast, Matt Francis and Emily Kund, welcomed world famous Tableau legend Joe Mako for a live podcast. If you missed the session, you can watch it below.  The session starts around the 2:05 mark.

October 7, 2014

Triggering Extract Refreshes in Tableau

At #DATA14, Bryan Brandow demoed the "Trigger" service that he built for our needs at Facebook. Basically, it's a snippet of python code that listens for data to lands in a database. Once Trigger "hears" that data has landed, it kicks off a Tableau extract refresh.  Get all of the details on his blog by clicking this image.


Here's the video of Bryan presenting the Trigger Service at #DATA14 (start the video at 7:05 if it doesn't start there automatically):

September 29, 2014

Porn, Pokemon & Pop Culture - The #DATA14 Blogger Panel Video

I had the honor of presenting alongside Jewel Loree and Peter Gilks at #DATA14 in a session about data blogging. Here's the synopsis of the session:
As an analyst, it can be hard to build up a Tableau portfolio when all of your data is proprietary. Instead, why not use data that you think is fun and interesting? Tableau Public Senior Data Analyst Jewel Loree was joined by blogging veterans Andy Kriebel and Peter Gilks to discuss how to start a data blog, where to find cool data, and how to show off your data viz prowess with the world.
Click the image below to watch the video. Enjoy and let us know if you have any questions.