问题
I know that the ATTR function is used for aggregation, but can someone explain it in simple terms?
回答1:
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
回答2:
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)
来源:https://stackoverflow.com/questions/34416290/can-someone-please-explain-the-attr-function-in-tableau