Launch, grow, and unlock your career in data

October 31, 2017

Mapping American Happiness

Nathan Yau produces some of the absolute best data visualisation and this one about American happiness was particularly pleasing to me.

Being inspired by this viz, I wanted to see if I could recreate it in Tableau. In particular, I wanted to make it interactive by allowing the user to:

  1. Hover over the legend to highlight the States in each quintile
  2. Highlight an entire region (as an alternative to Nathan's dotted lines dividing the regions)
  3. View detail in the tooltip
  4. See a custom mobile version

With this, here's my vizspiration about American happiness.

October 30, 2017

Makeover Monday: Does having a lot of public holidays lead to a happier country?

Onward we go with another week of Makeover Monday. This week Eva is asking us to review this viz from The Telegraph about public holidays around the world.

What works well?

  • People understand and like maps so this will capture their attention
  • Using a consistent color scale for all countries
  • Ensuring countries with no data are white (kind of like blanking them out)
  • Simple tooltips

What could be improved?

  • Red has a negative connotation, is this the best use for red? I'd say not.
  • It can be difficult to compare countries.
  • Using a filled map can make smaller countries impossible to find. Take Europe as an example; it's nearly impossible to see European countries without zooming in.
  • Using the search and entering a continent zooms you in way too far. This is completely broken.
  • There's no title. If you saw this independently of the article, you would have no idea what it's about.

My goals

  • Make comparing countries easier
  • Consider supplementing the viz with additional data
  • Use story points for a step-by-step makeover
  • Answer a simple question: does more public holidays mean a happier country?

October 25, 2017

Overcoming Burnout, Hexbin Maps and New York City's Urban Forest

I wrote Monday about how I'm suffering from a bit of Makeover Monday burnout. Thank you to all of you who wrote messages of concern and asked how you could help. MM takes A TON of work, many more hours than people realize, which leads to ebbs and flows where I feel either a lack of motivation or a lack of interest. I'm merely in one of those downward cycles.

How do I overcome burnout?

For me, the best way to overcome burnout isn't to stop; that would mean not doing what I love to do. What works for me is to switch to something in my backlog, to work on a project I've been putting off, to learn something new or maybe to practice a technique. This helps re-energize me. 

I can't recommend this strategy to everyone; burnout is tough. Sometimes the right decision IS to stop everything, to decompress, to get away from it all. I've done that before and it works as well. More often than not, though, I get sad when I'm not using Tableau. It's a product that has fundamentally changed my life. I'm an addict.

New York City's Urban Forest

Last night while I was preparing for Workout Wednesday, I had an idea to practice hexbin maps. Why that popped into my head I have no idea, but I went with it. I looked for a dataset that would work well as hexbins. I searched my emails and found this visualisation about trees in New York City. Fortunately NYC makes the location of every tree available here.

Why does this dataset work well with hexbin maps? According to Mapbox:
Binning is a great alternative technique for visualizing density when working with large data sets. 

Creating hexbin maps in Tableau is quite simple. All you have to do is follow this tutorial by Matt Chambers. It can prove a bit tedious to get the size of the bins just right, which is why I chose to use a parameter to speed up my development.

So, burnout temporarily overcome and I got to practice a technique I hadn't used in a while. That's a win win for me! Enjoy!

Workout Wednesday: The Seasonality of Superstore

Ben Moss has been post a series of really interesting insights that he's been finding in Superstore Sales. In particular, I liked what he found out about Binders...

This week's challenge builds upon Ben's work. First, you'll need this version of Superstore (which is different to Ben's but the same one I normally use for WW).

Here are your requirements:

  1. Create a line chart of the rolling N week cumulative products sold since the first week each product sub-category was sold. In this case, a product sold is the count of the product names.
  2. Allow the user to pick a sub-category to highlight. Make it blue and all others grey.
  3. The sub-category highlighted should also be slightly thicker than all other sub-categories.
  4. Allow the user to define the number of weeks over which to compute the smoothing. The user should only be able to enter values between 8 and 52.
  5. The title and the y-axis should update dynamically based on the number of weeks entered for the smoothing.
  6. Match the tooltip in the chart

That's it! Nothing overly complicated this week. Good practice for calculations though! Enjoy!

October 24, 2017

Tableau Tip Tuesday - The Information Lab Zen Master Webinar Series - Part 2

No comments
Today I hosted part two of my three part series of Tableau tips, covering all of the tips I demoed at TC17 plus lots more. You can sign up for future webinars here, including the upcoming sessions by fellow Zens Chris Love and Craig Bloodworth.

You can register for my final tips webinars here: 31 Oct @ 2pm BST.

Below is a workbook with all of the tips I shared today and the recording...enjoy!

October 23, 2017

Makeover Monday: How does my personality type compare to the U.S. population?

1 comment
This week for Makeover Monday we're looking at the frequency of personality types in America.

What works well?

  • It's easy to look up your own personality type.
  • Showing the distribution of each type along with the range
  • The title of the article is "How frequent is my type?" and that question can be answered.
  • Showing the distribution across the four major personality dichotomies as a total

What could be improved?

  • The most frequent types are the two left columns and two bottom rows. I don't get that. Surely there's a way to better organize this.

My goals

  • Show how my results compare to the general population
  • Make something more visual
  • Get it done quickly (I'm suffering from MM burnout)

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

October 20, 2017

43 Charts in 50 Minutes | The Information Lab Italy Zen Master Day

Today I had the pleasure of joining my colleagues at The Information Lab Italy for a Zen Master Day. In the morning there was a series of keynotes, one of which was by me speaking about my first experiences with Tableau at Coca-Cola and some analytical use cases from my roles there.

This afternoon, I wanted to do a slightly different take on what was supposed to be a tips session. Instead of tips, I decided to build as many charts as I could in 50 minutes. I got up to 43! I feel pretty good about that!

In the tweet below, you can watch Eva talk about Exasol and give a great demo. My tips start around the 40 minute mark.

Want the tips I shared? Well, here you go! Enjoy!

October 19, 2017

Workout Wednesday: Market Basket Analysis

For week 42, Emma set us a task to conduct some market basket analysis. Essentially she asked us to figure out which product sub-categories cross-sell the best. This is a very, very common question, especially in the retail sector.

Emma indicated that you would need to use a PC and I'm on a Mac. This, however, didn't pose a challenge.

STEP 1: Join the data to itself

The idea here to join the two Orders tables by Order ID. This self-join allows us to see the cross selling of each line item in each Order ID with all other line items with the same Order ID.

STEP 2: Filter out sub-categories that are the the same in both data sources

The goal of this filter is to remove any product sub-category that joins to a product sub-category with the same name. To do this, I created a simple boolean calculation, then added it to the Filters shelf and selected False.

STEP 3: Create a Total Sales calculation

This is pretty straight forward. Simply take the two sales measures and add them together.

STEP 4: Combine the sub-categories to get a list of the products that sold together

You could do this with a combined field, I merely prefer to write the calculation.

STEP 5: Create the Top N parameter and show the parameter control

STEP 6: Build a bar chart of the sub-categories purchased together sorted by Total Sales

Notice that I now have every combination of product sub-categories purchased together duplicated. I'll need a couple table calcs to fix this.

STEP 7: Check if the current row matches the previous row

With this calculation, I'm checking for duplicates. If I get "True" back as a result, then that means it's a duplicate. Notice here that I'm rounding the sales. I had to do this because Tableau wasn't matching the sales for some reason.

By excluding the "True" results with a table calc filter, I now have removed the duplicates.

STEP 8: Filter to the top N sub-categories

Again, I need a table calc filter. I need to rank the total sales, but since I have twice as many records (the previous table calc filter essentially just "hides" the other rows), I need to take twice as many rows as I indicate in the parameter.

Drag this calc to the Filters shelf and choose True and I have the results I want.

STEP 9: Build the final dashboard

October 17, 2017

Tableau Tip Tuesday - The Information Lab Zen Master Webinar Series - Part 1

Over the next three weeks, I'll be sharing all of the tips I demoed at TC17 plus lots more. You can sign up for future webinars here, including the upcoming sessions by fellow Zens Chris Love and Craig Bloodworth.

You can register for my next two tips webinars here:

This morning I went through the first 23 tips. I recon I have another two hours of content, so look for webinars over the next two weeks at 2pm UK time. Register here.

Below is a workbook with all of the tips I shared today and the recording...enjoy!

October 16, 2017

Makeover Monday: Ranking Drivers in Formula-E

This week we look at Formula-E results. I must admit, this was a bit tough. Nothing absolutely zero about the sport make it hard, yet it can make focusing easier as well...more about that in a sec.

First, let's look at the table of results.

What works well?

  • When looking at results in events, it never hurts to have the results in finishing order.
  • Including the pictures of the players helps make it more personal.
  • Showing the gap to first place helps provide context on how much the winner won by.

What could be improved?

  • There no sense of how the driver has done over time. Are they getting better or worse? You can't tell.
  • There's very little detail about what the stats mean. Definitions would be helpful for an audience to which this sport is foreign.

What were my goals?

  • Compare drivers in the most recent season
  • Only include drivers that completed every race
  • Provide season summary stats
  • See if any drivers are dominating the circuit

With those goals in mind, here's my Makeover Monday week 42. Click on the image for the interactive version.

October 11, 2017

Workout Wednesday: State to City Drill Down

This week's challenge started with a Convo challenge at The Information Lab from Chris Love. In Chris' challenge, he created a scatterplot that allows the user to click on a State and drill down to the City level. That is the starting point for this week's challenge and I've taken it to another level.

As a hint, in Chris' version, all cities were in the initial view, but for each State, all of the cities in that State would display the same value until you click on the State. The drawback of this method is that displaying mark labels (i.e., State names) only looks decent when a State only has sales in a single city. I want to show the labels for all States that have enough space to display it. In other words, the initial view should show only one dot per State, then when you drill down, you will see one dot per City in the selected State.

Before you start, I would highly encourage you to interact with the viz below to see how the drill down works.

Using this data source, here are the requirements:

  1. Create a scatterplot of sales vs. profit.
  2. In the initial view, you should see only one dot for each State. If you do this part right, you will have 48 marks in the view.
  3. Label the dots for the States in the initial view where the labels fit (using Tableau's automatic labelling).
  4. If you click on one of the States, then the view should automagically drill down to the cities for the selected State.
  5. If you choose more than one State, then the drill down should be disabled.
  6. Once you are in the City view, you should see one dot for each city. For example, if you click on Washington, then the City view should have 40 marks (one for each City).
  7. At the City level, the user should be able to click on the white space in the chart to go back to the State level.
  8. At the City level, no cities should be highlighted.
  9. You must match the tooltips. They show the State, Sales and Profit when each dot is a State. The tooltip shows the City, Sales and Profit when each dot is a City.
  10. The title and subtitle should change depending on if the view is State level or City level.
  11. Each dot should be colored by profit ratio for the State or City.
  12. The view should be 600x650.

Be sure to tweet an image of your work and a Tableau Public link and tag @EmmaWhyte and @VizWizBI. Good luck! I guarantee you'll learn a lot this week.

October 9, 2017

Makeover Monday: Adult Obesity in the United States

It's week 41 of Makeover Monday 2017, which can only mean one thing...Makeover Monday Live at TC17! This week, we're looking at adult obesity rates in the United States and this viz from The State of Obesity:

What works well?

  • Simple title that tells me what the viz is showing
  • Pulling the smaller States out separately to ensure they don't get lost due to their size
  • Creating an inlay for Alaska and Hawaii
  • Including a definite for obese
  • Great filter action on the regions
  • Everyone understands maps!
  • Nice highlight action to show the State on the line chart and vice versa
  • Great tooltips on the line chart
  • Keeping all lines on the line chart and highlighting the selected State
  • Keeping the scale on the line chart at the appropriate intervals
  • Using colors that people typically will identify with good and bad

What could be improved?

  • You lose the sense of change in the map.
  • The height and width of the line chart seem odd. It's too tall for my liking. This accentuates the vertical change.
  • There's no real story to the data. A more impactful title that has a definitive statement would help keep me there longer.

My Goals

  • Create something engaging. I'm going to see if something like Michael Mixon's tilemap birth rates chart works well with this data set.
  • If that doesn't work, make something that shows comparisons well.
  • Make sure States are easily comparable.
  • Give States even weight in the viz.
  • Keep the highlighting by obesity rate and filtering by region from the original.
  • Make nice tooltips like the original.
  • Look for stories in the different demographics.
  • Learn something new!
  • Have fun at Makeover Monday Live!

With those goals in mind, here are a series of vizzes I made for Makeover Monday week 41 for each of the demographics. Click on any of them for the interactive version.

October 5, 2017

Gun Ownership vs. Gun Control - Which do Americans prefer?

No comments
Earlier today I posted a viz from FiveThirtyEight about the growing divide in opinion about gun control and gun ownership when comparing political affiliation. I was quite inspired by the simplicity of the viz and how effectively it communicates, so I decided to use it for vizspiration.

The data used was readily available on Pew Research Center, so I used Google Sheets to import the data. Since FiveThirtyEight focused their viz on those people preferring gun rights over gun ownership, I only used that metric.

However, on the Pew Research Center website there are many other ways that the data is sliced demographically. I started by trying to create a single dashboard that contains each of the demographics displayed simultaneously and it was a mess! In the end, I went with a parameter to allow the user to choose the demographic they are interested in.

What did I find interesting?

  • Overall, there's been a steady increase in the percentage of people preferring gun rights over gun control. Sounds like the NRA's propaganda is working.
  • As stated by FiveThirtyEight, the gap between political parties is growing larger and larger. In the most recent poll (7 Apr 2017), only 20% of self-identified Democrats favored gun rights over gun control, whereas 79% of Republicans favored gun rights. It's this growing partisanship that is really damaging America.
  • The younger generation is less likely to favor gun right over gun control. Is the proliferation and accessibility to information from the younger generation signaling a shift towards more liberal views?
  • The most educated Americans favor gun control over gun rights. Are the undereducated preyed on by the NRA machine?
  • The gap between whites and blacks is as stark as the gap between Republicans and Democrats. 30% more whites than blacks prefer protecting gun rights.
  • Regionally, the South and Midwest prefer gun rights compared to the West and Northeast. This pretty much aligns with any election map you look at.
  • People that live in cities are 26% less likely to favor gun rights over gun control compared to those lives in rural communities. Again, this falls pretty much in line with political affiliation.

UPDATE: Thanks to Rody Zakovich for this great tip for shading between two lines. Much better than my area chart trick!