Search code examples
tableau-api

Exclude current week in Tableau automatically


I have set of data that is automatically updated each day with new lines. On the other hand my graphs shows weekly/monthly data.

Is there any way to exclude current week/month, so that the graph can be automatically updated on the server, without me manually excluding and including weeks/months each time I have data for full week/month?


Solution

  • Here's another option which I use regularly in my reports.

    1. Index your date field by week, with a calculated field: STR(DATEDIFF('week', [Date], today(), 'monday'))

    Note that here I have specified my weeks start on Monday, your requirement may be different.

    1. Drag this field onto filters and exclude the value 0, as in the index the current week will always be 0, last week will be 1 etc.

    enter image description here