Data Viz Done Right

January 4, 2017

Workout Wednesday: Comparing Year over Year Purchase Frequencies


What is Workout Wednesday? It’s a set of weekly challenges from Emma Whyte and me designed to test your knowledge of Tableau and help you kick on in your development. We will alternate weekly challenges: I will take the odd weeks and post them on my blog; Emma post challenges on the even weeks on her blog.

The idea is to replicate the challenge that we pose as closely as possible. When you think you have it, leave a comment with a link to your visualisation and post a pic on Twitter for others to enjoy.

Ok, so for week 1, I challenge you to recreate the visualisation below that helps identify the year over year purchase frequencies of Superstore (get the data here). The workbook is downloadable, but don’t cheat. Give it a real go before you download it to see if you got it right.

Here are the requirements:

  1. Y-axis is the cumulative % of total orders
  2. X-axis is the day of the year
  3. One line for each year, with the latest year highlighted
  4. Include a reference line for the target, which should adjust based on what the user enters
  5. Single select filter for Product Sub-Category
  6. Multi-select filters for Year, Region and Customer Segment
  7. Include a dot on each line at the first day when the cumulative % of order crosses the target
  8. Make the tooltips match mine
  9. Title should update based on the target entered by the user


  1. Whew, my brain is tired!!/vizhome/comparingyearoveryear/Dashboard1 @jeffkritzman

  2. Was able to get everything except for the "% n of orders" dots and the correct formatting for reference line in the tooltip "50.0%" (didn't think about creating a separate calculated field that was just the value of our simple).

    Also, calculated the day of year in a much less efficient manner, but now I know a much easier way of doing it. Thanks, Andy! This was a very worthwhile exercise.

  3. Nice challenge! I didn't know that you could use datepart for day of year either--I used a datediff instead--and I used lookup() instead of window_min to get the marks on.

    Thanks to you & Emma for setting this up, I'm looking forward to the next one!

    1. Good work! I like that you've done it a different way. Goes to show there's always more than one solution in Tableau.

  4. New Year's resolution... to try to keep up with these... I like these gyms... here's my answer!/vizhome/04012017-WW-YoYPurchaseFrequencies/YoYPurchaseFrequencies

    Some differences mainly in that I worked out day it reached target differently and how I then displayed the dot.

    Keep 'em coming - will try to keep up!
    (PS can't figure out why my logged in accoutn says unknown *sigh*

    1. Nice work Donna! Glad you enjoyed the challenge!!

  5. I love this idea and can't wait to play along. I had one question and one comment:

    In your version, should the highlighted year and total change if 2015 is removed from the filter?

    This might defeat the purpose of the exercise (or at least limit the features that can be used), but would it be possible to create the 'solution' in an earlier version of Tableau? IT limitations at work have me still on version 10.0, so I'm unable to open the solution you provide.

    Thanks again!

    1. I don't recall exactly what I did off the top of my head, but I think I set it to highlight the max Year of the whole data set not just what's in the view though that's probably how I should've done it. It's way easier to do with LOD in 10, but certainly can be done in earlier versions with table calcs.

  6. Its a great way to learn Andy! Thanks for taking the initiative.
    I liked the way you are viewing data in this use case. Not just line/bar chart of orders count.
    Here is my version:!/vizhome/WorkoutWednesday0104/Dashboard1
    Excited for next workout session ;)

    1. Good work Nishant. Glad you liked the challenge. Next week's will appear on Emma's blog.

  7. I'm a big fan of this! it's how I used the monday makeovers too! Here was my version, don't know why my chart looks so different (different superstore data?). But I think I got all the parts in there.

    1. Those dynamic markings were a major challenge!/publish-confirm

  8. That was a fun way to use my lunch break :)

    I must confess that I got stuck the %n so I had to look at your workbook.!/vizhome/ComparingYearonYearPurchaseFrequencies/ComparingYearonYearPurchaseFrequencies

  9. Really enjoyed that, although must confess to having to resort to looking at your solution to get the circles correct


  10. This was a great idea! Focus on the technical skills instead of endless fiddling with the style. I also could not crack the dots, to be honest I still struggled to decode even after I downloaded the workbook :) Keep 'em coming!


  11. Thanks Andy !

    Tableau Dashboard :!/vizhome/Workout_Wednesday_1/Workout_Wednesday_1

    However, I have copied and understand formulae.

    Added Max_Year to the title of chart too.

  12. That was a ton of fun...humbling too!

  13. Thanks so much for posting these challenges to encourage tableau enthusiasts to hone their skills. This is an excellent contribution to the community! Here's my solution - I have a feeling my solution for the circles is more complicated than it needs to be. Looking forward to studying others' workbooks.!/vizhome/WorkoutWednesdayWeek1_2/Dashboard

  14. Hi Andy, thanks for this exercise. I tried to recreate it. It was difficult. Some elements I just copied from your dashboard. But anyways I have some null values there. Is it a mistake?!/vizhome/WorkoutWednesday1_7/Dashboard1