Aggregate vs Non-Aggregate Fields

by Zachary Ryan

When it comes to calculated fields in Tableau, a common problem that leads to these fields failing is always the 'cannot mix aggregate and non-aggregate arguments' error message. Of course, the key to never seeing this error message is to understand the differences between the two and there's no better time to tackle such a daunting question then on your second week at the Data School.

The way I understand it is as follows.

An Aggregated field is one that returns select or modified values from its natural form, being modified within Tableau, most likely in a view. This could be modifications through changing the measure to Sum, Average, Count, Count Distinct and so on.

A Non-Aggregated field is one that lacks modification and instead returns plenty of values, without being impeded by a measure.

Now that is still pretty confusing, so hopefully, I'll be able to simplify with some screenshots.

Non-Aggregated Fields

Above, we can see that both Profit and Sales have not been modified and don't contain a measure before both of them. They are simply 'Profit' and 'Sales'. As such, these are both Non-Aggregated.

Aggregated Fields

In this example, we can see that both Profit and Sales have the measure of 'SUM' before them. As a result of this, they are both considered Aggregated.

And this would be an example on how to receive the 'cannot mix aggregate and non-aggregate arguments' error message. Don't do this.

Don't.

But if you do happen to come across this error, at least you know where you went wrong now and understand the difference between the two.

Wed 26 Oct 2022

Tue 25 Oct 2022

Tue 25 Oct 2022