Error - Aggregate and on-aggregate cannot be combined

0 votes
Hi, I'm new to tableau, when i use calculated fields, this error often pops up.

What does this error mean "Cannot mix aggregate and non- aggregate together" ?
May 22, 2019 in Tableau by ritu
1,957 views

1 answer to this question.

0 votes

Hi Ritu,

This happens when you are comparing a field with aggregate(field) such as 

IF [Sales] = MAX([Sales]) .......    Here this would throw an error same like yours.

To avoid this you can use Fixed LOD which converts the Aggregated measure into a single dimension to compare or use with a field. Aggregation such as MIN, MAX, SUM, AVG, etc.

IF [Sales] = { MAX([Sales]) } ...... would not throw an error.

So use Fixed LOD to do such comparisons

To know about Fixed LOD, 

https://www.edureka.co/blog/tableau-lod/ 

answered May 23, 2019 by anonymous
• 33,010 points

Related Questions In Tableau

0 votes
1 answer

error on aggregate and non aggregate values

Create a calculated field that outputs a ...READ MORE

answered Apr 17, 2018 in Tableau by sdfg
• 5,550 points
456 views
0 votes
0 answers

Cannot use aggregate and non-aggregate fields in the if statement

Hi. I cannot use aggregate and non-aggregate ...READ MORE

Oct 7, 2019 in Tableau by ch
• 3,450 points
369 views
0 votes
1 answer
0 votes
1 answer

How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,230 points
8,219 views
+1 vote
1 answer
0 votes
1 answer

Calculated filed with if-then

Below is the required code:  IF (NOT ISNULL([test2])) ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,230 points
856 views
+2 votes
1 answer
0 votes
1 answer

How to aggregate and count the occurrence of TRUE and FALSE?

Hi, you can do any of below ...READ MORE

answered Mar 12, 2019 in Tableau by Cherukuri
• 33,010 points
1,125 views
0 votes
1 answer

How to have some values in filter to be static and some to be dynamic

Hi Nithin, 1. You can form group ...READ MORE

answered Mar 18, 2019 in Tableau by Cherukuri
• 33,010 points
166 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP