Reputation: 167
I am trying to set up a filter or parameter for different date ranges in Tableau, such as:
based on the most recent data in the database. Is this possible?
Edit: I should have been more clear here.
Is it possible to only have these options in the filter and have it based on the maximum date in the database?
Upvotes: 2
Views: 6342
Reputation: 7431
Based on your comment and updated question, you can do it as you intend, though it isn't as straight-forward.
NOTE: I did this very quickly and with a random data set, so it will be important for you to test this thoroughly with your data set.
Steps:
Calculation: INT([Date Filter Parameter]) > DATEDIFF("week",ATTR([Date Field]),WINDOW_MAX(MAX([Date Field])))
True
.You will be able to filter your data like so:
Yup - that is built into Tableau.
Add your date to the filter and select the "Relative Date" option:
You can set the defaults - users can change these later:
Then just "Show Filter":
Upvotes: 3