# What is ATTR (...) aka Attribute function in Tableau?

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2021-02-03
- **Format:** Video · 20 min watch · transcript available
- **Topics:** Data visualisation, Analytics
- **Tools:** Tableau (attr, calculated fields, data modelling, relationships)
- **Canonical:** https://just-tim.com/posts/what-is-attr-attribute-function-in-tableau
- **Watch:** https://youtu.be/tDMdXdQMGW4

I walk through Tableau's attribute (ATTR) function, explaining what it does, when to use it, and where it falls short. Using the American Superstore data set, I demonstrate how ATTR returns a single value or an asterisk when multiple values exist, and cover three practical use cases plus three key limitations.

## Key takeaways

- ATTR is an aggregate function that returns a single value if all rows in a group share one value, otherwise it displays an asterisk (null values are ignored)
- Use ATTR to signal hidden detail beneath a mark, surface dimension values in tooltips, and resolve 'cannot mix aggregate and non-aggregate' errors in calculations
- Setting a dimension pill to Attribute (via its drop-down) stops it from affecting the visualisation's level of detail while keeping it available in the marks pane
- ATTR strips out dynamic sorting, can break grand totals, and is slower than MIN/MAX, which often achieve the same result more efficiently
- Aggregation issues in calculations frequently point to a data prep problem better solved earlier in the stack, or with LOD expressions

## Chapters

- 0:28 What the attribute function is
- 1:57 Demonstrating ATTR on city and state
- 4:59 Use case: signalling hidden detail and tooltips
- 6:42 Use case: fixing aggregation errors in calculations
- 10:18 Use case: controlling level of detail in the marks pane
- 13:10 Limitation: loss of dynamic sorting
- 15:04 Limitation: grand totals not rendering
- 17:54 Limitation: performance versus MIN/MAX

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/what-is-attr-attribute-function-in-tableau

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
