Week 42: Can you build a comparative line chart with dynamic inputs?

This week’s challenge is taken directly from a situation I recently had on a project.  The goal of the project was to be able to isolate out time periods of a specific length and compare it to the time period directly before it.  So as an example, if it’s October 2019, I want to look at the 6 month period ending October 2019 (May 2019 to October 2019) vs. the 6 month period directly prior (November 2018 to April 2019).  The intended final visual was a line chart that showed trending over time – so that the first month of the current period was compared directly to the first month of the prior period.  This type of analysis is perfect for retail or consumer packaged goods environments – there they often work off of 13, 26, or 52 week rolling periods – so my hope is that you’ll be able to take this scaffolding and put it to good use in the context of your own situation.

And since this is Workout Wednesday, I thought I’d take it to the next level by also emphasizing some ways to make the whole interaction a little bit more user friendly and dynamic in nature.  So instead of fumbling with drop-downs, users can have custom buttons to change the time range and end month.  I hope you’ll enjoy this part of the build as much as I did.



  • Dashboard Size: 1100 x 800 (# of sheets is up to you!)
  • Create a line chart for two different periods
    • Periods are chosen through a dynamic input
    • Periods display in chronological order – oldest date for each time period should be the first data point per line
  • Create a way to dynamically change the time range/periods; make this interactive
    • When users click on a time range, the selection should be hot pink, otherwise light gray (or pick your favorite colors)
  • Create a way to dynamically change the end month; make this interactive
    • When users click an end month, all months that are part of the current period should be blue; those in the prior period should be very dark gray, those outside of either range should be light gray (or pick your own colors)
  • Create a dynamic title with a legend that includes the date ranges of the two periods
  • Match tooltips, formatting, and labels (they’re all pretty easy this week)


This week uses the Superstore Data Set from 2019.3 (it goes through the end of 2019)


When you publish your solution on Tableau Public make sure to take the time and include a link to the original inspiration.  Also include the hashtag #WorkoutWednesday2019 in your description to make it searchable!


After you finish your workout, share on Twitter using the hashtag #WorkoutWednesday2019 and tag @AnnUJackson@LukeStanke@lorna_eden, and @curtisharris_!


Keep an eye out for the solution video – that will be ready over the weekend!

2 thoughts on “Week 42: Can you build a comparative line chart with dynamic inputs?”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top