2 Replies Latest reply on Aug 28, 2017 7:55 AM by Charan Loya

    Date Filters

    Charan Loya

      Hello,

       

      I have a question regarding date filters. I have 2 date fields, lets say shipped date and ordered date, for the selected shipped date, i would like the ordered date to filter to selected date - 10 Days.

       

      For example: if Shipped Date = 8/25/2017 then ordered date should be 8/15/2017 - 8/25/2017, if shipped date = 8/24/2017 then ordered date should be 8/14/2017 - 8/24/2017.... It seems straight forward but i have trouble making this dynamic.

       

      I would really appreciate If someone can help solve this or point me in the right direction.

       

      I have attached superstore data to play around with. Hope my question is clear.

       

      - CL

        • 1. Re: Date Filters
          Glenn Kuly

          Hi Charan, the date filters you set are fighting with each other, and so no values will be shown except for where the date ranges overlap. So by setting the Ship Date filter to a single day, Order Dates will be limited to that day, regardless of the range you set.

           

          Here's one possible solution (shown in the attached workbook). Use the Ship Date field to create a parameter, then create a calculated field that will show sales based on 10 days of Order Dates up to and including the chosen Ship Date:

           

              Calculation 1

              IF DATEDIFF('day',[Ship Date Parameter],[Order Date]) <= 0

              AND DATEDIFF('day',[Ship Date Parameter],[Order Date]) >= -10

              THEN [Sales]

              END

           

          Have I correctly understood what you are after?

           

          date parameter.png

           

          -- Glenn

          • 2. Re: Date Filters
            Charan Loya

            Yes. This is exactly what i was looking for. Thank you very much.