2 Replies Latest reply on Mar 27, 2020 1:42 AM by Max Tsogtjargal

    Comparing Dates Ranges

    Max Tsogtjargal

      Dear Good People of Tableau Community,

       

      I have been struggling to make 'Date Range Comparison' dashboards and so far, no good.

      comparing_date_ranges.png

      Basically, this is what I want but without parameters.

      I have a two sales campaign. Let's say. Campaign 1 starts from July 1 to July 11 and Campaign 2 starts from April 1st to April 15.

      Campaigns come with its dates. But I have to calculate the minimum date from the campaigns and take the number of Campaign days by DATEDIFF function and put them into the line chart just like the above picture. Thing is it just doesn't show up like this without parameters.  For details, please refer to the sample workbooks attached.

      Many thanks in advance, guys.

      Best,

      Max.

        • 1. Re: Comparing Dates Ranges
          Budi Lubis

          Hi Max -

          I can't open ver 2020 but you will need to create to calculated fields as follows.  You can adjust the LOD partition to fit your data

          • 1st one to calculate the minimum date for each campaign, you can call it MinDate

                    {FIXED [Campaign]:MIN(IF [Sales]>0 THEN [Date] END)}

          • Then you can create the x-axis using DATEDIFF, you can call it AgeOfCampaign

                    DATEDIFF('day',[MinDate],[Date])

          1 of 1 people found this helpful
          • 2. Re: Comparing Dates Ranges
            Max Tsogtjargal

            Hi, Budy

             

            Thank you so much! That saved me a day.

            Finally, I could move on to next problem, haha.

             

            Best,

            Max