Happy Valentines Day!

For this weeks’ #MakeoverMonday (week 7 for those keeping track) Andy Kriebel made a last-minute decision to change the data set to something  with a Valentines theme (thanks Andy!).

The makeover in question was of this infographic, originally posted here.

valentinesdayspending2

What do I like about the original?

  • The information is displayed clearly with values/percentages against each item.
  • The donut chart is precise with only two slices (yes/no).
  • Nice use of images.
  • The original data source is noted at the bottom of the page.
  • There is a description to explain what the graphic is showing.

What do I dislike about the original?

  • It’s a bit too pink for my liking (and I like pink)!
  • The data at the bottom could have been displayed more clearly (i.e. in bar chart form of similar) to aid comparison between groups of people. The different sized bubbles make this difficult.

I immediately knew I wanted to try waffle charts this week. Andy posted a great #TableauTipTuesday video a few weeks ago which explains how to build a waffle chart so I wanted to put this learning into practice.

In my example I wanted the waffles to show the spending on Valentine’s Day by people group (i.e. significant other, etc) in 2016. In his video Andy uses the Superstore data set and creates a calculated field for profit ratio by product category which he then uses to build the waffles. However, I struggled to write a calculation to show the percentage of spend by people group. I dabbled with the ‘Box to Colour’ calculation for a while and at one point I even wrote an Level of Detail (LOD) calculation! This worked perfectly in terms of showing the percentage of spend but it wouldn’t work when I built it into the ‘Box to Colour’ calculation. When I attempted to use this new calculation Tableau returned the following error message:

“Cannot blend secondary data source because one or more fields use an unsupported aggregation”

I later discovered an article on the Tableau Knowledge Base which explained why this was happening:

“This error message can also appear when a level of detail expression is used in a view that uses data blending. The linking field in the primary data source must be in the blended view before the LOD expression can be used from the secondary data source”.

I was indeed using two data sources; the Makeover Monday data set and the waffle chart reference sheet. Despite trying numerous times to solve this problem last night I couldn’t find a way around it so eventually gave up (Tableau – 1, Sarah – 0). There is probably a way of doing this but I didn’t have the time to figure it out.

Before revisiting the data set with a fresh pair of eyes this morning I thought I would look on Twitter to see if anyone else had built a waffle chart this week (with the intention of looking at their calculation). Thankfully I found this viz from Eliska Valterova (@eliskavalterova).

eliska

Although Eliska had also built waffle charts she had used a different metric to the one I was attempting to build; who Americans were intending to buy for (with the percentage of people who intended to buy gifts for each group), rather than how much they were intending to spend.The percentages used by Eliska (percent buying) were actually included in the original data set all along but I had missed these!

I decided to apply to same logic since I was unable to go with my original plan. I happy with how my viz turned out and I’m glad I had the opportunity to use waffle charts (finally)! I also couldn’t resist including some Love Hearts….it is Valentine’s Day after all!

Here’s my final viz. You can also view in more detail here on Tableau Public.

love-dont-cost-a-thing-mm-2017-wk7

Thanks for reading.