KNOWLEDGE BASE

Error "Level of detail expressions cannot contain table calculations or the ATTR function" When using the DATEADD function in an LOD with an Aggregation on the interval


Published: 14 Oct 2019
Last Modified Date: 14 Oct 2019

Issue

When using the DATEADD function in an LOD with an aggregation on the interval, an error occurs with some data sources. Example of formula: { DATEADD('day', AVG(1), #01-01-1970#) }

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

 

Environment

  • Tableau Desktop 2019.3 and earlier
  • Hyper, MySQL

Resolution

Wrap the interval in the INT() function:
{ DATEADD('day', INT( AVG(1) ), #01-01-1970#) }

Cause

This behavior occurs when the aggregated interval returns a float.
Did this article resolve the issue?