Video | Tableau | Data visualisation | Analytics

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

A video to walk you through how the Attribute function works in Tableau.

Part ofTableau Functions
Watch on YouTube
  • 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

ATTR is Tableau's aggregate function for dimensions: it returns a single value when everything in a group agrees, and an asterisk when it doesn't. Understanding this behaviour unlocks several practical tricks and helps you avoid a few nasty side effects.

Demonstrated using the Superstore sales data set, exploiting the fact that some US city names exist in multiple states.

The Breakdown
  • What ATTR actually returns 0:28

    ATTR is an aggregate function found in Tableau's function list under the aggregate group. It returns the single value of an expression if every row in the current level of detail shares that value, otherwise it returns an asterisk; nulls are ignored.

  • See it change as you alter the level of detail 1:57

    Wrap a dimension in ATTR and add it to a view where a second field controls the level of detail (e.g. city and state). At the finer level of detail it resolves to real values; remove the finer field and it collapses to an asterisk wherever multiple values exist for a group, showing it's calculated as an aggregate.

  • Use it to signal hidden detail and populate tooltips 4:59

    Put an ATTR-wrapped dimension into a tooltip or on the view: a star tells the user there's more granular detail underneath that mark, and a real value tells them the mark is already at its lowest level. This is a handy way to hint at drill-down potential without building extra charts.

  • Use it to fix 'cannot mix aggregate and non-aggregate' errors 6:42

    When a calculation compares an aggregated measure (like SUM) against a raw dimension, Tableau will error because one side is aggregated and the other isn't. Wrapping the dimension in ATTR aggregates it too, resolving the conflict — this only works cleanly if the field you're wrapping is genuinely at a single value for the level of detail you bring into the view.

  • Use it to add fields to the view without changing granularity 10:18

    Dragging a dimension onto the marks card (e.g. onto Detail) at a level below your current granularity will silently start controlling the visual level of detail, potentially fragmenting your marks. Switching that pill's dropdown to Attribute keeps it available for tooltips or reference while stopping it affecting the chart's granularity — this works with virtually any dimension, though very high-cardinality fields will just always show a star.

  • Limitation: you lose dynamic sorting 13:10

    A dimension pill sorts dynamically based on whatever measure you choose, but the same field wrapped in ATTR only supports manual/alphabetical sorting — you lose that dynamic capability entirely once it's an attribute.

  • Limitation: grand totals can break 15:04

    Calculations built around ATTR can cause grand totals to render incorrectly. Swapping in MIN or MAX might not fix it either — this usually signals a data prep issue that's better solved upstream, or resolved with an LOD expression instead.

  • Limitation: it's slower than MIN/MAX 17:54

    Because ATTR has to scan the whole group to check whether every value matches, it's less efficient than MIN or MAX, which extracts can index for quickly. If the same visual result is achievable with MIN or MAX, prefer those over ATTR for performance.

Worth Knowing
  • ATTR ignores nulls when deciding whether all values match
  • If you don't need ATTR's asterisk-signalling behaviour, MIN or MAX will often give the same visible result faster
  • Aggregation errors that force you to reach for ATTR often point to a data preparation problem better solved earlier in the pipeline, or with an LOD expression
Use It When

Reach for ATTR when you need to signal that more detail exists beneath a mark, when you need a dimension available in tooltips or the marks pane without it fragmenting your view's level of detail, or when a calculation throws an aggregate/non-aggregate mismatch error.

How this Rollup was made provenance & method

A Rollup is drafted by AI from the video's transcript, then reviewed and edited by Tim. Everything used to produce this one is listed below — the model, the exact prompt, and the source video — so the process is transparent and reproducible.

Transcription
On-device — NVIDIA Parakeet v3 for recent videos, OpenAI Whisper large-v3 for earlier ones. The transcript never leaves the machine or gets published.
Drafting
Claude Sonnet 5 in the cloud, from that transcript.
Prompt
The exact Rollup prompt (v2) — the full system prompt, unedited.
Source video
Watch on YouTube
Drafted
5 July 2026 at 09:38
Reviewed & edited
11 July 2026 at 13:38 · by Tim Ngwena

Model + prompt + video is everything you'd need to recreate a Rollup like this yourself. The one thing we don't share is the transcript.

Rights. The video and its transcript are the property of TN Media Ltd. Unauthorised use or download is prohibited. © TN Media Ltd.