1 Reply Latest reply on Dec 18, 2012 7:03 AM by John Munoz

    Due Date Analysis - How to setup a dynamic date filter with an interval from: Today-90 days to: Today +5 days?

    Fabian Binz-Scharf

      Hi experts,

       

      I'm working on a due date analysis report and would like to get data within a specific interval, depending on the report key date (execution) - How would I go about setting up a date filter to span From: Today-90 days To: Today +5 days?

       

      Thanks!

      Fabian

        • 1. Re: Due Date Analysis - How to setup a dynamic date filter with an interval from: Today-90 days to: Today +5 days?
          John Munoz

          Hi Fabian,

           

          Great question. Here's how I would do it.

           

          Using the sample super stores data set I'm going to use ship date as my target date for calculating # of days ago.

           

          1. Right click in the Dimensions area of your workbook and select, 'create calculated field'. Let's call this field, 'days ago' and in the formula section enter this formula DATEDIFF('day',[ship date],today()). This will calculate, in days, the number of days from the ship date to today. Hit 'ok'.
          2. Let's set up a quick viz to show you that this works.
          3. Drag the 'days ago' pill (it should be green for continuous) to the columns shelf.
          4. Drag 'sales' in the dimensions area to the rows shelf. You should have a line graph that's kind of jumpy.
          5. Head back to the dimensions area, right click on 'days ago' and select, 'show quick filter'.
          6. Click on -12 (there are ship dates into the future in this dataset) and enter 5. Click on 1446 and select 90. That's your filter.

           

          BTW, this workbook actually already has this type of calculation in it. Check out the field named, 'time to ship'.

           

          Finally, to help out the consumers of this workbook, you might want to display the filtered values in the title.

           

          Happy Tableauing!