Creating a year-on-year comparator
To create a year-on-year comparator, you need to combine everything that we saw previously: Calculated Field, Reference Line, and Parameter.Â
Your mission (if you accept it) is to build a visualization where you can see the Sales by Sub-Categories of a selected year compared to the previous year with a Reference Line. Color also helps you to quickly spot the sub-categories where the sales are lower than the past year. Here's the final result:Â
Quite impressive, isn't it? Let's build it! Follow the tutorial:
- Create a Parameter to choose the year. Configure it as anÂ
Integer
with aList
of allowable values. The list is composed of four values:2015
,2016
,2017
, and2018
. You can, if you want to make it perfect, change the display of the values to remove the thousand separators (by modifying the display format or editing theDisplay As
column). Name itSelect a year
, and choose 2018 as the current value.
Your Parameter configuration window should look like this...