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
57 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
• 22,110 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
103 views
0 votes
1 answer
0 votes
1 answer

How can I count the aggregate function in Tableau

Create two calculated fields one for 100's ...READ MORE

answered Apr 5, 2018 in Tableau by Atul
• 10,240 points
1,444 views
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
1,621 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
64 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
• 22,110 points
76 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
• 22,110 points
13 views