Blog Channels
Creating a Dynamic Anchor Date with a Relative Date Filter
21
May 2012
Creating a Dynamic Anchor Date with a Relative Date Filter
Ever wonder how you might change a Tableau anchor date (see image below) to be dynamic? Fear not, we’ve created a solution which might satisfy those individuals and/or groups who clamor for greater flexibility.

So, here are the 3 (yes, just three) steps to Tableau date magic.
Step 1: Create (and then show) the following Parameter(s):

Note:
Anchor Date is a Date data type
Choose Interval is a Integer data type
Choose Time Segment is a string data type with (Years, Quarters, Months, Weeks)
Step 2: Create Calculation(s):

Step 2.1: Anchor Begin

Step 2.2 Anchor End

Step 2.3 Filter

Step 3: Set the View up! (Or just USE it):

The end.



1 comment(s)
Comments
Ben Sullins
Wouldn't it be nice
if you could not have to do a second case statement and create a calc like so?
dateadd([Parameter].[Date Interval], [Date], today())
Looks like you cannot make the 'date part' of the 'dateadd' function dynamically set via parameter though :(