Last Modified Date: 24 May 2017
AnswerThe ATTR function filters the View, not the underlying date, and can be an important tool in certain situations especially for working with views based on data blending. ATTR works at the row level and its purpose is to identify if the row is unique. If the row is unique it returns the value, else it returns "*".
In it simplest form, the formula reads like this:
IF MIN ([dimension]) = MAX ([dimension]) THEN MIN ([dimension]) ELSE "*" END
The ATTR function evaluates all the members within the field and returns a value if 1) there is only a single value (MIN = MAX) or 2) all members are identical (MIN = MAX) else it returns "*". Which can be interpreted as "there is more than one value".
You can build out the basic ATTR function by adding conditions for when the ATTR function should be triggered, for example:
IF ISNULL ([dimension]) THEN NULL
ELSEIF MIN ([dimension]) = MAX ([dimension]) THEN MIN ([dimension])
- 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.
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Training and Tutorials