September 18, 2014

The Sleeping Habits of Tableau Zen Masters

The feedback was so positive from my viz of the sleeping habits of geniuses that I had to give it another go. This time, I take a deeper look at the 2014 class of Tableau Zen Masters. Surely this group meets John Medina's requirement of 8 hours of sleep, right? Absolutely not! In fact, only 40% of them get more than 7 hours of sleep.

I blame Tableau. Clearly the Zens spend too much time playing with Tableau and helping people solve the hardest Tableau problems. Judge for yourself with the viz below.
  • Hover over a Zen and a summary of their stats will appear on the right.
  • Hover over a Zen for links to their Twitter profile and website.
  • Rank the Zens using the parameter on the right: By amount of sleep, when they go to sleep, when they wake up in the morning or look at a simple alphabetical list.
  • Use the minimum sleep parameter to determine how much you think a Zen needs to sleep and watch the viz update.

Download the data here and the workbook here.

September 15, 2014

Makeover Monday: The Sleeping Habits of Geniuses

In the Thursday opening keynote at #DATA14Dr. John Medina discussed some incredible insight about how sleep affects our brains, productivity, etc. This made me think about this visualization from New York Magazine that I use when I teach data visualization. I use this example in the constructive criticism part of the class.
There are so many problems with this display.  A few of them include:
  • The background shading of the night time and day time.
  • The curved nature of the display, which makes people on the outside appear to sleep longer than those on the inside.
  • The pictures of only some of the people aren't necessary.
  • There's no apparent order to the people.
Those are just a few of the most immediate problems. I thought I would show two examples of how I would make this over. In every class that I've taught, the class comes up with something very similar.

First up is a Gantt chart view. This view is ordered by the most sleep to the least sleep and color-coded by those that get at least eight hours of sleep (the minimum amount according to Dr. Medina).

NOTE: I added the background shading from 10pm-6am after the original post based on feedback from Steve Wexler.

If you'd prefer not to see it in a timeline view, but rather by a simple list from the most sleep to the least sleep, this bar chart would likely suffice.

If you'd like to create an alternative view of your own, you can download the Tableau workbook here and/or the data here.

September 8, 2014

Use Axis Rulers for cleaner charts in Tableau

Last week I was talking with Paul Mathewson of Interworks about a bug that he was seeing with axis borders in Tableau. I thought I was seeing the same bug, but it turns out that mine was different. On my bug, there were some charts on which the axis border would not appear. I hadn’t changed any settings and some other charts that had the same exact design worked just fine. So I turned to a feature that I’ve never used in Tableau…Axis Rulers, which is a feature I cannot find documented anywhere on Tableau's website.

While Paul and I were chatting, he showed me a neat trick he uses to make cleaner charts. He learned this trick from Gabriel Gejman, who learned it from John Abdo. This is how things work in the Tableau community; one person finds something and others spread the word. I’m writing this blog post to share as well.

By default, Tableau includes the gridlines when your date dimension is continuous. You also get that border around the whole chart. Now consider this cleaned up version.

To get this view, all you have to do is make some simple formatting changes. First, format the borders by setting the Pane to None for both the Row Divider and the Column Divider.

Next, go to the Format Lines options and set the Grid Lines to None.

Your chart should now look like this:

The last step is to go back to the Format Lines options and set the Axis Rulers to a line and make them a light gray.

That’s all there is to it! You now have a super clean line chart.

Put several of these together on a dashboard and you really see a big difference.

Download the sample workbook here.

September 3, 2014

Premier League summer spending was out of control - A Story

Tonight while I was running and listening to the 5 Live Football Daily podcast, I heard a very interesting stat: Premier League clubs spent more on summer transfers than the GDP of 14 countries. This sounded too crazy to believe, so I made a mental note to look into it after I got home. I spent the better part of the rest of the evening re-hydrating and finding data to tell the story you see below about the insanity that is Premier League transfer spending.

I created most of the charts you see on my commute into work on the shuttle and polished it up after breakfast. What was most fun about creating this story was the process itself; I went from idea to data to vizzes to story in a very short amount of time.

My advice to you: If you hear an interesting fact, look into it.  Find some data. Tell the story in your own words. It's a great way to practice and develop your craft.

September 1, 2014

Makeover Monday: Where We Donate vs. Diseases that Kill Us

One of the ways that I can tell I've made an impact on people I've interacted with is when they send me links to terrible visualizations that they want me to makeover, long after we have worked together. My friend Karyn, who I used to work with at Facebook, send me a link last week to this infographic:

Source: IFLScience

Of course the point of this infographic is to show how much money the ALS Ice Bucket Challenge has raised compared to how few die from the disease relative to other diseases. The data is from 2011, so it doesn't account for the fact that the Ice Bucket Challenge has now raised over $100M. For the purpose of this makeover, let's focus on the chart itself. I see several issues immediately:
  1. The bubble sizes were originally based on the diameter of the circles, not the area.  This is a big mistake! The author has since fixed this so the graphic above is now correct.
  2. There are too many colors. I find myself going back and forth to the legend. It shouldn't be so hard for the readers.
  3. The colors in the legend are in no particular order; not alphabetical, not by deaths, nor not by money raised. This is way too confusing.
  4. It's difficult to trace the relationship between the deaths and the money raised. 
Taking these difficulties into account, I have created this slope graph.

Some of the benefits of presenting the data with a slope graph include:
  • We can see the ranking relationship between the cause and the disease much easier. 
  • I've highlighted the Ice Bucket Challenge since it is the focus on the article.
  • I colored the remaining line by red or blue to indicate a decline or increase in rank respectively.
  • I labeled the ends of the lines directly to eliminate the need for a legend.
One additional element that would add value to the slope graph would be to include the bubble size. If you'd like to build your own infographic, you can download the data here and/or the Tableau workbook here.

August 28, 2014

Two-way Sorting in Tableau - Sorting Some of the Viz by a Measure and the Rest Alphabetically

I had an interesting requirement posed to me yesterday that I hadn't ever run into before. I'm using this Airline Delays data to demonstrate the technique. The requirements were along these lines:
  1. Given a list of airports, there are a subset that are "targets". Let's assume they are the top 15 with the most flights in 2014: ATL, DFW, ORD, LAX, DEN, IAH, SFO, PHX, LAS, MCO, CLT, EWR, BOS, SLC, LGA
  2. The airports need to be sorted by the latest delay rate.  However, only those in my top 15 list should be sorted by delay rate, the rest should be sorted alphabetically to make them easier to lookup.
  3. Include sparklines for each airport for 2010 to present.
This is the final product and here's how I went about solving this problem. There could very well be a more efficient method, but this worked for me.

August 25, 2014

Tableau Tip: Month over Month KPI Movers

Reader Brian Bieber (no relation to Justin), a Data Analyst at Vanguard, sent me this question:
I'm currently running some monthly data where a list of records is assigned a KPI indicator like G/Y/R. I've been asked to produce a follow-up piece that would show "movers" from the prior month's data, just in a simple text view. So I guess what I need to try and do is figure out how to do a lookback/compare from prior month data to see who went from Y/R to G on the positive change side and who went from G to Y/R on the negative side.
What Brian didn't realize was that answer to his question was pretty much in the question itself; he needs to use to LOOKUP() function. I sent Brian a solution, but decided to fancy it up a bit more and add some more functionality using parameters:

The steps for building a KPI movers viz like this are pretty straight forward. I'm using the Superstore Sales data set that comes with Tableau in this example.

August 22, 2014

Spreading the Gospel of Data Viz & Tableau at Facebook: The VizWiz Tour

Tuesday was the final stop on my three city tour, evangelizing the work we do at Facebook with data viz & Tableau. We're on a ninja hunt, so these types of events are fantastic for meeting new people, identifying talent and learning the various way that people are implementing data viz & Tableau.

My first stop was back at my old stomping grounds at the Atlanta Tableau User Group, where Andy Piper and John Hoover of Norfolk Southern hosted over 100 people. A few days later I was preaching again to a group of about 50 at the San Diego Tableau User Group, where Matt Shoemaker of Interactions Marketing and Ben Sullins of Pluralsight hosted the event.

Tuesday marked the culmination of the mini-tour, with 2014 IronViz contestant Jeffrey Shaffer of Unifund and Jonathan Pickard, the leader of the Cincinnati Business Intelligence & Analytics group, hosting the event at the amazing Linder College of Business at the University of Cincinnati. They really have something special going on at UofC in the business analytics space. If you're looking for great analytical talent, they definitely need to be on your list of places to visit and connect with.

There were about 100 people in attendance, all armed with Tableau Public, data about airline delays, great questions and an incredible appetite to learn.

The format of my talks during this tour generally followed this three-hour agenda:
  • Hour 1: Presentation – Building a data viz & Tableau culture; How we did it at Facebook & how you can do the same
  • Hour 2: Tableau Training - Fundamentals for analyzing an unfamiliar data set
  • Hour 3: Group exercise and viz presentations
Here is the presentation I gave in Cincinnati:

One of the things I like to do when giving these talks is to ask the audience why they are there. This way, I can customize the talk along the way to make it more suitable for them and to ensure they get the most value out of it. The drawback of this approach is that the talk tends to go on longer than one hour, which was the case Tuesday.

To accommodate for my long-windedness, we decided as a group to skip the group activity and focus on the Tableau training. The fact that every person in the audience came prepared with Tableau installed was a HUGE help and a big time-saver. When I teach, my goal is to overwhelm the class. I have always felt that when learning Tableau, you should drink from the fire hose. I move very fast in the training, yet I don't leave anyone behind. The class will often feel that I'm moving way too quickly at the start, but I do that intentionally, so that they learn how easy it is to build in Tableau.

The class of 100 was comprised of only a handful of people that had been using Tableau for more than one year, with about 80% of the class getting a taste of Tableau for the very first time. In 90 minutes, we build 17 different worksheets and one interactive dashboard. You can download the workbook here. This training session was really fun because I had to hold a mic the whole time; this meant I was teaching and building vizzes one-handed. We covered a few major areas, while using the Show Me only once (I like to teach people how to build visualizations without it):
  1. Bar charts: Ranked bars, Small multiples, Stacked bars, Side by side bars, Stacked % of Total, Bar in bar, histograms
  2. Line charts: Basic line chart, Multiple lines, Year over year, Small multiples, Forecasting, Moving avg, Area chart
  3. Maps: Dot maps, Colored dot map, Sized dot map, Sized and colored dots
No two training classes are ever alike either. The classes always asks different questions, which lead me to different ideas. This class was no exception. In the end, we built this interactive Airline Delays dashboard that uses containers and actions to show/hide other charts. This was 90 minutes of pure fun and I bet Tableau has some new zealots.

August 18, 2014

Makeover Monday: SEC Football Coaches Get Paid!

College football season is nearly upon us and for those that live in the Southeastern US, college football is king. It dominates EVERYTHING - from sports talk to newspapers to online forums to Facebook posts to coaching salaries. College football = Life to so many people. If you've never been to an SEC football game, add it to your bucket list; it's an experience unlike any other.

Saturday Down South is a website dedicated to all things SEC football. This past Thursday, they published this list of the salaries for each coach in the SEC (except for Vanderbilt who does not publish their coach's salary).

This list is simple enough, yet when I saw it, I felt like there was more of a story in there. You can clearly see, just from the table, that Nick Saban is a huge outlier. He's a winner, and he gets paid to win. Keep in mind that these are only their base salaries too. Bonuses, appearance fees, etc. are not included.

I decided to use Tableau's story points for the first time to answer a couple of key questions:
  1. How much of an outlier is Saban compared to his peers in the SEC, to other coaches in other sports and to other college football coaches?
  2. How widespread is this level of pay for college football coaches and how does the SEC stack up?
  3. Is Saban worth the money?
I also need to give a quick thank you to Emily Kund and Matt Francis for reviewing this story for me.

Some things I've learned while using Story Points for the first time:
  • If you want to tell a story, know the questions you want to answer ahead of time. This will help you plan the beginning, middle and end of the story.
  • As I answered questions, I was led to more questions, which led to finding more data, which led to a better story. Be prepared to iterate.
  • Story Points are pretty inflexible. You can't do any formatting of you viz once you're inside the Story Point. You have to go back to the original worksheet to change anything. I had expected this to work more like editing a viz on a dashboard.
  • I feel like I'm not quite using Story Points as they were intended. I feel like I'm missing their intent in this attempt because I could have done all of this same formatting with multiple dashboards and tabs. I need to learn more about the “idea” behind Story Points.
Download the data here and the Tableau workbook here.

August 12, 2014

Tableau Tip: Creating a Connected Scatterplot

Today I had the incredible honor of helping Alberto Cairo create his very first Tableau visualization. Alberto chose to create a connected scatterplot.  Shortly thereafter on Twitter, Lynn Cherny asked:
So this post is dedicated to her question.  Here you go Lynn:

Step 1: Create the scatterplot

Step 2: Change the Mark type to Line

Step 3: Add a continuous date dimension to the Path shelf

Step 4: Add Markers to the lines via the Color shelf

Step 5: On each axis, uncheck the "Include Zero" option

Step 6: Add a dimension to the Color shelf to create additional lines

That's all there is to it!  Super simple!  Download the sample workbook here.