8 Replies Latest reply on Apr 19, 2018 7:10 AM by Giacomo Vannucchi

    Year over Year Calculation via Date Parameters

    Derrick Lang

      My Business Need has me perplexed as to how best achieve year over year analysis with an adjustable date filter. We want to see what categories have grown by a custom year over year date range specified by the user. Our business model is retail, which means local events can affect traffic and volume more than national, date specific events (i.e. beginning of the fiscal quarter).

       

      Attached is example of what I am doing, I may be approaching this the wrong way. I have looked through many posts and have not identified a need similar to mine which would address this. I also met with a "Tableau Doctor", though that individual was not a real help outside of suggesting parameters over straight date filters. The Filtered tab allows the user to select the date range with the data structured similar to how it feeds into our Tableau Server Datasource. The Prior Year tab shows 2012's numbers and Current year tab shows 2013's.

       

      My goal is to get (if filtered to 1/1/2013-2/28/2013 via Parameters):

       

      LocationAcuteIllnessImmunization
      Renewal
      1CY:0.10 PY:0CY:0.12 PY:0.10CY:0.10 PY:0.10CY:0 PY:0
      2CY:0.12 PY:0CY:0.14 PY:0.11CY:0.10 PY:0.15CY:0 PY:0.10
      3CY:0.10 PY:0.11CY:0.14 PY:0CY:0.10 PY:0.13CY:0.10 PY:0
      4CY:0.10 PY:0CY:0.13 PY:0CY:0.13 PY:0.10CY:0.11 PY:0
      5CY:0.10 PY:0CY:0.12 PY:0CY:0.10 PY:0.10CY:0.10 PY:0

       

      Where CY shows the current year numbers, and PY automatically identifies the filtered day and month, subtracts from the year only, and displays the same data in contrast. From there I could do additional work on the backend of calculations, but arriving to that initial way to have Tableau show two different years while filtering to a specific date range.