Data Viz Done Right

January 15, 2019

Tableau Tip Tuesday: How to Compare Current YTD to Prior YTD

No comments
This week's tip came from a question from Andrzej Szczurko on week one's tip from Lorna:

How would you do year to date percent difference when you only have data for first 3 months in the current year? For example when you have data for the current year from January to March for 2018 and you want to compare it to January to March from 2017 and calculate percent difference then?

This is a very common business question. In this video I show you how to use level of detail expressions to calculate these two fields plus the difference.

NOTE: In the video, I have the Year over Year calculation backwards. The formula should be: SUM([CY Sales])-SUM([PY Sales])

January 14, 2019

Makeover Monday: Workers Making Minimum Wage or Less in America

No comments
For Makeover Monday week 3, the Community is making over the viz below from Business Insider. I had bookmarked this data set back in 2016 and stumbled across it again over the weekend. I was then able to get more data from the Bureau of Labor Statistics for 2002-2017. Win!

What works well?

  • Maps are easy to understand
  • Positioning of Alaska and Hawaii in the available space
  • Including notes about the data in the footer
  • Simple, effective title
  • Using a single color gradient; a diverging palette would not be appropriate

What could be improved?

  • Ranges are not the same size
  • Smaller States are nearly impossible to compare; this is a good use case for a hex or tile map
  • No context for good vs. bad

What I did

  • Looked at the data over time
  • Included a comparison to the US average for context
  • Included all States for context
  • Allowed the user to highlight the State they are interested in
  • Included labels on the ends to the lines to show change over the entire period

January 6, 2019

Makeover Monday: How Has Press Freedom Changed Around the World?

No comments
For week 2, Eva chose this visualization from Freedom House about the changing freedom of press in countries around the World.

What works well?

  • The colors contrast well and represent the values well (i.e., green = good, etc.).
  • The map zooms in nicely as you select a region across the top.
  • Good tooltips
  • The white borders around each country make them easy to distinguish.
  • Using dots to represent the small islands.

What could be improved?

  • Without using the zoom feature, small countries are very hard to see.
  • The title doesn't really tell me what the data map is about.
  • You can't see trends over time. In other words, you don't know if the press are getting more or less free.
  • There are no definitions for what the scores mean, unless you hover over a country.

What I did

  • I started by building a trellis chart that showed every country and its score over time. It was so messy and crowded so I scrapped it.
  • I wanted to see the overall trends, so I focused on the percentage of countries within each year that fall into each status.
  • I used the same color palette.
  • I wanted to show the change vs. 1993, so I included that as text on the end of each line.

I found this to be a particularly interesting, and a bit alarming data set. According to this data, the Press are becoming less free. That's not good for democracy.

December 30, 2018

Makeover Monday: Team by Team NHL Attendance

No comments
Year 4 of Makeover Monday is here! I can't believe how quickly it's gone. We've made a number of changes for this year which you can read about here. We want to have more visibility into who is participating and how often, so we're also asking people to help us track their work by filling out the simple weekly submission form here. After we get a few weeks in, we'll build a dashboard to share with everyone.

For week 1, we're making over this chart from NHL to Seattle. Granted the chart is from 2013, but it's still worth a makeover. If you want to see what John Barr has done since then, you can find a more recent visualization of NHL attendance from him here.

What works well?

  • The teams are ordered alphabetically, which makes it easy to find a specific team.
  • Axes are clearly labeled

What could be improved?

  • You should NEVER EVER truncate the axis of a bar chart.
  • You should not use a line chart for non-ordinal data (e.g., team names).
  • There's no title.
  • 3D bar charts are meh
  • Labeling each square makes the viz feel cluttered.
  • Ordering the bars from highest to lowest would make it easier to see where a team ranks.

What I did

  • I grouped the team into their respective conferences and divisions.
  • I create a couple of KPIs and repeated them for each team.
  • I started by lining up the teams horizontally, which kept me under an hour. Then I sent a screenshot to Eva and she said it would make more sense to have them vertically and geographically west to east. THAT TOOK FOREVER! Three sheets for each team, each within a "team container", which is inside a "Division" container, which is inside a horizontal container to give each division container the same space. What a pain!

It's done. So with that, here's my first Makeover Monday for 2019. Click the image for the interactive version.

December 23, 2018

Makeover Monday: Spending on Christmas Gifts in America

No comments
We've done it! Another year in the books for Makeover Monday, the most fun project I've been a part of and the largest in the Tableau community (perhaps in data viz as well??). From year one with Andy Cotgreave, to years two and three with Eva Murray, to Makeover Monday the Book, this has been an incredible journey.

I believe Charlie Hutcheson is the only community member to complete all 156 weeks, though Simona Loffredo has only a couple of weeks to catch up on before the end of the year to join Charlie (and me) in the 100% club. As of this writing, Charlie has 307 vizzes on his Tableau Public profile, while Simona has 197. That's an incredible achievement and a testament to their dedication to improve week by week.

It's nearly Christmas Day, so Eva picked a Christmas-themed data set. Let's have a look at the viz:

Original viz by Statista

What works well?

  • It's a line chart based on time, so it's easy to understand what it's telling us.
  • Using one color
  • I kind of like the banding for every other year.
  • Good axis title for the measure

What could be improved?

  • Remove all of the numbers except the first and last years.
  • Add a title
  • Add the data source; surely Statista didn't come up with the data themselves. 
  • Remove the paywall so we can see information about the source and the publisher.
  • Remove the paywall for downloading the data. All you really need to do is type the numbers into Excel anyway.
  • Is there any insight?

What I did

  • Create something simple
  • Supplement with additional data to see if it can add any context. 
  • Looked at year-over-year change
  • Compare the statistics to look for relationships

I found absolutely no relationships between the average spending data and the other metrics. You might see that as a waste of time, but for me, that's part of the analytical process. Just because you don't find something, that doesn't mean the analysis is wasted. It means you have confirmed there is no relationship.

With that, here's my final Makeover Monday for 2018, focusing on the year-over-year change to highlight the Great Recession.

December 18, 2018

Tableau Tip Tuesday: Using Discrete & Continuous Colors on One Map

No comments
One of the things I really love about teaching at The Data School is the opportunity I get to learn from them. Because really, no one learns more than the teacher.

A couple weeks ago, Andrew Lehm Brian Scally asked me how he could make one State a single color while having all of the others based on a measure. Basically, we wanted to be able to combine discrete and continuous colors on a single map.

This is quite simple if you know how to layer maps and take advantage of multiple marks cards. I show you how to do just that in this week's tip.


December 17, 2018

Makeover Monday: London Bus Safety Performance

No comments
I was hit by the 237 bus in Brentford on September 22. The driver pinned me against the curb and I nearly went under the bus. The driver was an asshole about the whole thing and now the bus companies has stopped communicating with me.

So, to get back at them, I gathered all of the bus injury data from Transport for London and gave it to all of you, the Makeover Monday Community, to help make their scorecards better. What does the scorecard look like now?

What works well?

  • The line charts are easy to understand.
  • All charts have good titles.
  • The donut chart is clear and simple.
  • The colors work well together (except the pie).

What could be improved?

  • The pie chart could be made into a bar chart.
  • The charts could use more context.
  • The data is horribly delayed (it's December 17th as I write this and the data only goes through June).

What I did

  • Give the user an opportunity to explore the data; every chart has action filters
  • Use TfL colors
  • Provide context on some of the charts, like injuries per month

With that, here's my Makeover Monday week 51.

December 9, 2018

Makeover Monday: How much land is needed to produce our food?

No comments
This week Eva chose a data set about the amount of land it takes to make one gram of protein. For example:

  1. A 9oz/251g steak contains 62g of protein. 
  2. Multiply that by 1.02m² (the amount of land needed to produce 1g of steak) 
  3. It takes 63.25m² of land to produce ONE STEAK. That's 678ft² for my American friends. 


That's like a one bedroom apartment for every 10oz steak. That's ridiculous and a major reason why I went vegetarian 18 months ago.

Let's have a look at this week's chart:

What works well?

  • Using a descending bar chart for ranking from largest to smallest
  • Labeling the ends of the lines for more precision
  • Simple title

What could be improved?

  • It took me several times to read the subtitle to make sense of it. Something simpler would be helpful.
  • Remove the gridlines
  • Remove the axis

What I did

  • Recreated the waterfall chart that I had to create for Workout Wednesday week 49
  • Used color to highlight the food types that come from animals; I used red to represent bad (my opinion)
  • Change the title into the form of a question
  • Included a BAN to summarize the findings

With that, here's my Makeover Monday week 50.

December 3, 2018

Workout Wednesday | Week 48: Profitability Bridge

No comments
I'm a bit behind again on Workout Wednesday, you know, this whole life thing. Today I had a few minutes to look at week 48. As it was a waterfall chart with a couple of other tricks thrown in, I thought it would be pretty straightforward, and it was...thank goodness.

The basic requirements:

  • Create a waterfall chart showing the top 5 sub-categories by sales. Include an other category for all other categories.
  • Show a bar on the far-left of the waterfall that shows all sub-categories. Label it all.
  • Add dashed lines that “connect” each bar.
  • Add a dashed line that connects the All bar with the Other bar.
  • Make sure each line looks as a single continuous dashed line. 
  • Label each sub-category above the bottom line of each bar.
  • Label each bar with the profit ratio below the bottom line of each bar.
  • Add a filter by region. Make sure the filter is centered on the dashboard above the chart.
  • Color the bar gray if it above zero or pink if it is below zero.

Get the full list of requirements here. Thanks for the challenge Luke!

December 2, 2018

Makeover Monday: How many New York Times crosswords have been created by women?

No comments
We've had quite a few Makeover Mondays this year focusing on gender disparities. This week, we're analyzing the gender composition of constructors of New York Times crossword puzzles. The original viz come from XWord Info:

What works well?

  • The title explains what the chart is displaying.
  • The x-axis and y-axis are easy to understand.
  • Excluding 1993 and 2018 since they are partial years.
  • The chart has the proper height-to-width ratio.

What could be improved?

  • The title could be a bit more informative. Something like "Over the last 24 years, there have been only three weekdays where women has constructed at least 50% of the crosswords."
  • There are too many colors, making the chart distracting and the lines hard to follow.

What I did

  • Separated the days into separate charts so the trends for each weekday would be easier to follow
  • Created sparklines and highlighted the high point for each weekday
  • Labeled the values for 1994 and 2017 for context
  • Included a BAN for the overall percentage for each weekday
  • Created a mobile layout
  • Shaded every other row to distinguish the weekdays and help guide the eye across the chart

November 28, 2018

Workout Wednesday: Sales for the Last N Periods vs. Prior Year

No comments
I'm going back to Workout Wednesday week 16. Why? Because I really struggled with it. I was so close for so long, but couldn't quite get my date calculations correct. After writing them down on paper and building tables in Tableau to verify I had them correct, the rest was pretty straightforward.

This use case is super useful in a business context. I like Workout Wednesday challenges that you can employ later. The most important requirements:

  1. Use a date parameter to select a select end date, limit it to all days in 2017.
  2. Use a parameter to select the period type (day, week, or month).
  3. Use a parameter to select the number of periods to go back (limit from 1 to 12).
  4. Create a bar chart that show the total sales for the last complete period. 
  5. Add sales for the same period as a label on the end of the bars.
  6. Compare the selected period to sales over the same period from the prior year.
  7. Add a blue arrow up if sales are up compared to prior year.
  8. Add a red arrow down if sales are down compared to prior year.
  9. Show the difference in sales over these time periods. Make sure to show no negative signs. The arrows will indicate the change.

Read the full requirements here. Really good challenge from Luke.

November 26, 2018

Makeover Monday: The Cost of a Night Out

No comments
For Makeover Monday week 48, Eva chose this visualization from Thrillist (created by Statista):

What works well?

  • Choosing a topic that is relatable
  • Good title and subtitle
  • Sorting the bars from most expensive to least expensive
  • Using colors that are easy to distinguish
  • Including the labels on the ends to the bars

What could be improved?

  • Lose the icons on the lower right
  • Remove the gridlines and axis labels (they're not necessary if the ends of the bars are labeled)
  • Remove the flags next to each city; First they add no value. Second, the data is about cities not countries.
  • The title is a bit misleading; this is only a selection of cities.
  • Using a stacked bar chart makes comparisons across the items difficult; maybe if this was interactive and you could choose the item to sort by, it would work better.

What I did

  • I wanted to make the comparisons easier, so I chose to create a bump chart.
  • I added a highlight selector so the user can focus on a single city, yet keep the others in the view for context.
  • I sorted the values from least expensing (top) to most expensive (bottom).

With that, here's my Makeover Monday week 48.