KNOWLEDGE BASE

Error "Level of detail expressions cannot contain table calculations or the ATTR function" Occurs in the Calculation


Published: 15 Sep 2022
Last Modified Date: 15 Sep 2022

Issue

If you use LOD (level of detail expressions) with table calculation or ATTR function, the below error will occur and you cannot finish the calculation.

Level of detail expressions cannot contain table calculations or the ATTR function


LOD with table calculation:
User-added image

LOD with ATTR function:
User-added image

Environment

  • Tableau Desktop

Resolution

Remove the table calculation or ATTR function.

For table calculation
Option 1: 
Only use the table calculation and set the computing dimension.
For example, if you want to calculate the rank within each category, please refer to the below image.
User-added image

Option 2: 
Move the Table Calculation outside of LOD expressions like the below image.
Note: please verify if LOD expression is necessary or not.
User-added image

For ATTR function
Replace the ATTR function with MIN() or MAX() function or rewrite the aggregation function within the LOD expression like the image below.

User-added image

Please also refer to the attached workbook for details.



 

Cause

This is by design. 
 
Did this article resolve the issue?