Reputation: 301
I am trying to compare yesterday's data to the same day the year before. For example, yesterday is 11 November 2018. I want to compare to 12 November 2017 (same day but the year before). I am wanting this to be applied automatically on the filter so all I need to do is open the file and verify the numbers are correct before sending off the report.
Any help would be appreciated.
Thanks
Upvotes: 1
Views: 1675
Reputation: 11896
There are many Tableau functions that manipulate dates. A couple in particular are relevant to your problem:
The functions are well documented in the online help. Construct the formulas you need and filter accordingly.
Upvotes: 1
Reputation: 3318
Isolate yesterday's date as its own field. For instance if that is the max date in your data, then {max([Date])}
would create an LOD of the maximum date.
Then make a calculation that will display the same date last year:
year([Date]) = year([max_date])-1
and datepart('week',[Date]) = datepart('week',[max_date])
and datepart('weekday',[Date]) = datepart('weekday',[max_date])
Upvotes: 0