2 Replies Latest reply on Feb 27, 2018 4:30 AM by Tim Dines

    Create a Year on Year comparison by selecting only one date range

    Luke Ives

      Hi All,

       

      I am struggling to create a formula within Tableau which will break the data down showing a comparison year on year.

       

      I have a bar chart which shows me all checks which have been completed against several product lines but also breaking that down by the number of checks by result (Red, Amber and Green). I need the ability to see all checks completed within the date range selected in a filter but for tableau to then automatically add another column which shows me the data for exactly the same date period but for the year previous.

       

      So say If I selected two weeks in January of 2018, without selecting 2017, I would need the system to show me the same two weeks in 2017 also.

       

       

      Can anyone help?

       

      Thanks,

      Luke

        • 1. Re: Create a Year on Year comparison by selecting only one date range
          nikher verma

          Hi Luke ,

           

          Please use twbx file , but if you have data for lets suppose 5 years ,you can expand it on daily basis .And then add and show filters on years, quarter ,month and day ,then you can compare your data year wise , quarter wise or month wise as per your requirement .

           

          Row\Column Shelf :: To create filters right click on year and select show filter and so on for Quarter and month .

          Filters :

          Hope this will work .

          • 2. Re: Create a Year on Year comparison by selecting only one date range
            Tim Dines

            Create two calculated fields based on  your date selection parameter.  The first calculated field will show you the data from that chosen date range and then a second will calculate the date as -365 days or take the dateparts and go back to the same day and month range with a year that is -1.  Do not drag these two calculated fields to the filter shelf but refer to them in another calculated field that you will use as a measure to display the data.