Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (17.6k points)

I've got google analytics data for goal completions represented in a line graph in Tableau, with the week of the year as the x axis. What I need is to set a conditional filter on WEEK([Date]) so that all but the most recent week is shown. Something like this :

IF DATEPART('week',[Date]) < DATEPART('week',TODAY())

THEN 'Show'

ELSE 'Filter'

END

But when I try this, I get an error saying "The formula must be an aggregate calculation or refer only to this field".

Could someone fix the formula for me? 

1 Answer

0 votes
by (47.2k points)

  • Instead of trying to set this in the filter dialog box 

  •  Use that formula to create a calculated field. Now, simply drag that field to the filter box and filter on 'Show'.

Firstly register yourself in an industry-recognized Tableau Certifications such as you can register for our Tableau Training Course.
...