KNOWLEDGE BASE

Using the Attribute (ATTR) Function


Published: 27 May 2014
Last Modified Date: 25 Apr 2016

Question

How the Attribute (ATTR) function works, and how is it different from other aggregations such as MIN or SUM.

Environment

Tableau Desktop

Answer

When the ATTR function is used, the field becomes dependent on the level of aggregation of another dimension. The field no longer exists as independent values and is now wrapped in an aggregation, and then turned into a measure.

The underlying computation is roughly equivalent to the calculation:
IF ISNULL(<expression>) THEN NULL
ELSEIF MIN(<expression>) == MAX(<expression>) THEN <expression>
ELSE "*"
END

The ATTR function works if there is only one value for each row of the dimension on which the ATTR field is dependent.

Limitations

  • The ATTR function will not work in the same manner as other aggregations such as MIN, MAX, or SUM.
  • ATTR cannot be used as a sorting dimension in a crosstab.
Did this article resolve the issue?