1 Reply Latest reply on Feb 22, 2018 10:00 PM by Poojala Alekhya

    This year vs last year same period

    Poojala Alekhya

      Hi,

      I have an issue in tableau please can anyone help me with this

      1.when i select a date range as today then it should display Feb 1st to Feb 23rd and it should display for last year same period.(I have tried with tableau online calculations but its not working).

      2.Here i will select date as Today then it should display last 7 days.

       

       

      Thanks in advance.

        • 1. Re: This year vs last year same period
          Zhouyi Zhang

          Hi, Poojala

           

          You need two parameters in this case rather than using filter.

           

          assume two parameters, FromDate and ToDate

           

          create a calculation with your date field like

           

          [Date] >= [FromDate] and [Date] <= [ToDate]

          or

          [Date] >= Dateadd('year',-1,[FromDate]) and [Date] <= Dateadd('year',-1, [ToDate])

           

          and drag this to filter.

           

          Hope this helps

           

          ZZ