I am trying to recreate an index chart with Tableau (https://mbostock.github.io/protovis/ex/index-chart.html) for Makeover Monday 2021 W17 data set, and I cannot figure out what is the best approach to do this. I am using Tableau Public so I cannot attach the workbook as a document but you can find it here : https://public.tableau.com/views/RemakingMakeoverMondayW17IndexChart/Sheet14?:language=en-US&publish=yes&:display_count=n&:origin=viz_share_link
The data set contains every state in the US and a price index for that state between the years 2008-2019. I want to create a line chart which would use a selected year as a comparison condition, and would show the difference between each year and the selected year.
My approach was the following:
I created a parameter for date "Year Parameter".
I created a calculated field "PARAMETER YEAR" to give me price index for the selected parameter date:
IF [Year] = [Year Parameter] THEN [Price Index] END
- I tried to calculate the difference and that is where I get stuck: SUM([Price Index]) - SUM([PARAMETER YEAR]). This calculation shows me only 1 state for the selected year.
Any ideas on how to deal with this?