This content has been marked as final.
Show 1 reply
-
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 Dec 18, 2012 7:03 AM (in response to Fabian Binz-Scharf)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.
- 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'.
- Let's set up a quick viz to show you that this works.
- Drag the 'days ago' pill (it should be green for continuous) to the columns shelf.
- Drag 'sales' in the dimensions area to the rows shelf. You should have a line graph that's kind of jumpy.
- Head back to the dimensions area, right click on 'days ago' and select, 'show quick filter'.
- 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!