2 Replies Latest reply on May 16, 2013 2:56 AM by Lester Anciro

    Last Year/This Year Comparison

    Lester Anciro

      Hi guys,


      I'm having a problem in comparing this year/last year data..


      For example, I have "May 16, 2013" for this year and I want to compare it "May 16, 2012" for the last year.

      This Date should be changed day by day..


      Any suggestions?


      below is the example view I want to get.

      Attached asd.bmp


      Thanks in advance.

        • 1. Re: Last Year/This Year Comparison
          Elizabeth Wu

          Do this:


          1. Create a new set from your date field by right clicking on it and clicking 'Create Set'. Name it something like "TodayOr1YrAgoToday"

          Go to the 'Condition' tab and select 'By Formula'. Enter the folllowing formula (changing the date field to your date field name): [Order Date]==TODAY() OR [Order Date] == DATEADD('year',-1,TODAY())


          Note that you don't have to create a set, you could use this formula to filter individual dates by placing it in the Condition tab in the filter on your date field. A set is just easier to re-use.


          2. Drag this set onto the filters shelf.


          3. Drag your date field onto the columns shelf.


          4. Add the 'Measure Names' to the filter shelf and select the measure names you want to include (Actual Sales, Target Sales and Total Inventory for example).


          5. Drag 'Measure Names' from the Dimensions onto the Columns shelf after the Date field.


          6. Drag the 'Measure Values' from the Measures onto the Rows shelf.


          7. Drag the 'Measure Names' onto Color in the Marks Shelf.


          I've attached a workbook that uses the Tableau Sample data and does the above.


          -- Modified: Added Sample Workbook. Improved Instructions.

          • 2. Re: Last Year/This Year Comparison
            Lester Anciro

            Thanks a lot! I'll try this one I think it's the best solution for my problem!!!


            Thanks a lot again, Elizabeth.