6

I know that the ATTR function is used for aggregation, but can someone explain it in simple terms?

Aman Sheriff
  • 61
  • 1
  • 1
  • 3

3 Answers3

8

In the most simplest of terms, ATTR returns a value if it is unique, otherwise it returns "*". I think you'll find this link helpful with examples.

https://www.interworks.com/blog/tcostello/2014/05/15/attr-tableaus-attribute-function-explained

Bernardo
  • 2,907
  • 1
  • 8
  • 16
3

You cannot mix aggregate and non aggregate comparisons in tableau, you have to use ATTR, for e.g. if ATTR(segment) ='Corporate' then sum(sales)

Community
  • 1
  • 1
S123DB8
  • 335
  • 3
  • 16
0

ATTR is like using an already aggregated field for comparison with another aggregated field. Measures are taken as aggregated fields while dimension's aren't. If you have created a field which is already aggregated and still you want to use this field as measure it will be shown as ATTR as it cannot be further aggregated but is behaving like it has.

AnilGoyal
  • 14,820
  • 3
  • 16
  • 30