0 votes
1 view
in BI by (13.4k 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 (36.9k 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'.

...