5 Replies Latest reply on Feb 7, 2020 11:14 AM by Tableau_Newbie

The formula must be an aggregate calculation or refer only to this field

I need help with the syntax of a formula. This is what I want to accomplish.

IF [Event Type] = "Sales Meeting" OR [Event Type] = "Team Tuesday" THEN ([Attendance %]) =  [60% - Attendance % Parameter]

ELSEIF  [Event Type] = "Company Event" OR [Event Type] = "Team Building" THEN ([Attendance %]) =  [70% - Attendance % Parameter]

ELSEIF [Event Type] = "Community Event" THEN ([Attendance %]) =  [50% - Attendance % Parameter]

END

How can I make this work? Also, do you know of any good resources to learn more about complex formulas in tableau?

• 1. Re: The formula must be an aggregate calculation or refer only to this field

see below - the new value takes the name given to the calculation and is not repeated in the formula

IF [Event Type] = "Sales Meeting" OR [Event Type] = "Team Tuesday" THEN   [60% - Attendance % Parameter]

ELSEIF  [Event Type] = "Company Event" OR [Event Type] = "Team Building" THEN [70% - Attendance % Parameter]

ELSEIF [Event Type] = "Community Event" THEN ( [50% - Attendance % Parameter]

END

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• 2. Re: The formula must be an aggregate calculation or refer only to this field

BTW tableau has excellent online video free training at   Tableau Training: View Training Courses | Tableau Software

• 3. Re: The formula must be an aggregate calculation or refer only to this field

Event with your implementation, I'm still getting the same error message.