Tidbits
Here are a few tidbits/tricks that you may find helpful as you venture into the world of calculated fields in Tableau (Conversion error):
Cannot mix aggregate and non-aggregate arguments
One of the most common calculation errors you may encounter will be related to mixing aggregate and non-aggregate arguments in functions:
What this simply states is that if one part of the calculation is an aggregation (such as SUM
, AVG
, MAX
, and MIN
), all other parts should also be aggregations.
This becomes tricky when working with level of detail calculations. For example, we may have an LOD expression that gets a FIXED
sum of sales:
What if we need to use this with another calculated field that is aggregated? In the following example, we are dividing SUM(Quantity)
by our fixed LOD calculated field, which is already an aggregated field. However, we are getting the notorious Cannot mix aggregate and non-aggregate… error, as shown in the following screenshot:
Not to worry. Since LOD expressions...