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 in Tableau by ritu
370 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 22 by anonymous
• 32,260 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 Atul
• 5,530 points
153 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 in Tableau by ch
• 3,290 points
31 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,240 points
2,419 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,240 points
118 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 in Tableau by Cherukuri
• 32,260 points
108 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 in Tableau by Cherukuri
• 32,260 points
22 views