What is ATTR in Tableau?
If you've ever dragged a dimension into your Tableau view and watched it instantly morph into something like ATTR(Dimension Name), you’ve likely felt a moment of confusion. This subtle, automatic change is one of Tableau's most misunderstood features. This article will break down exactly what the ATTR function is, what that pesky asterisk it sometimes returns means, and how you can use it to build better, more reliable dashboards.
What is ATTR() in Tableau? The Simple Answer
ATTR stands for "Attribute." It's an aggregation function with a very specific job: it checks if all the values for a dimension are the same within a certain level of detail in your visualization.
Here’s the simple logic it follows:
- If there is only ONE unique value, ATTR returns that value.
- If there are MULTIPLE unique values, ATTR returns an asterisk (
*).
Think of ATTR as a strict bouncer for your data. Inside your chart, you have different groups (or partitions). The bouncer's job is to check each group. If everyone in a group presents the exact same ID (the dimension value), the bouncer lets that ID value through. If the people in the group show different IDs, the bouncer simply flashes a stop sign (the asterisk) and doesn't single anyone out. It's a signal that there's more than one person, but it won’t pick one for you.
A Quick Example
Imagine you have data for customer orders. Every row is an item in an order. A single Order ID can have multiple Product Name values but should only have one associated Customer Name.
- If you group your data by
Order ID1001, and every row for that order hasCustomer Name= "Jane Smith," thenATTR(Customer Name)will return "Jane Smith." - But if for that same
Order IDyou ask forATTR(Product Name), and the order contained "Laptop Stand" and "Wireless Mouse," the function will return*because there are two different values.
This asterisk isn’t an error. It’s valuable information, telling you, “Hey, you asked me for a single attribute, but I found multiple.”
How ATTR() Behaves in a Visualization
Understanding ATTR in theory is one thing, seeing it in action makes it click. Let's use the sample Superstore dataset that comes with Tableau.
Scenario 1: ATTR() Succeeds with a Single Value
Let’s build a view that shows how ATTR successfully returns a value.
- Create a new worksheet.
- Drag the
Categorydimension to the Rows shelf. - Drag the
Sub-Categorydimension to the Rows shelf, to the right ofCategory.
Your view is now partitioned by each unique Sub-Category. This is your level of detail. Now, let’s see what ATTR does.
- Drag
Categoryagain, but this time drop it on the Text card in the Marks pane.
You'll notice Tableau automatically changes it to ATTR(Category), and the correct category name appears next to each sub-category.
Why did this work?
Look at the "Chairs" row. At this specific level of detail (the sub-category), what are the possible values for Category? There's only one: "Furniture." Since every row of data that makes up the "Chairs" sub-category belongs to the "Furniture" category, the ATTR function confidently returns "Furniture." It correctly attributes "Chairs" to its one-and-only parent category.
Scenario 2: ATTR() Returns an Asterisk When Values Conflict
Now, let's flip the logic and purposely ask for an attribute where we know multiple values exist.
- Create a new worksheet.
- Drag
Categoryto the Rows shelf. - Drag
Sub-Categoryto the Text card.
Tableau will wrap it in ATTR(Sub-Category), and you’ll see this result:
- Furniture: *
- Office Supplies: *
- Technology: *
Why did we get the asterisk?
The level of detail in this view is now Category. So, Tableau is asking the ATTR function: "For the 'Furniture' category, what is the single, unique value for Sub-Category?"
Of course, within "Furniture," there are several sub-categories: "Bookcases," "Chairs," "Furnishings," and "Tables." Since there isn't one unique value, ATTR returns an asterisk * to signal that multiple distinct values exist for that partition.
ATTR() vs. MIN() and MAX()
So, why would you use ATTR() when other aggregations like MIN() and MAX() can also work on text fields? The difference is about displaying a chosen value versus verifying a singular value.
Let's use our previous example where we saw the asterisk:
ATTR(Sub-Category)for the "Furniture" category =*MIN(Sub-Category)for the "Furniture" category = "Bookcases" (first alphabetically).MAX(Sub-Category)for the "Furniture" category = "Tables" (last alphabetically).
MIN() and MAX() will always pick a value. This can be misleading. A manager looking at a chart with MIN(Sub-Category) might wrongly assume that the only sub-category under Furniture is "Bookcases."
Use ATTR() when your logic depends on a one-to-one relationship. It acts as a safety check. If you expect a single value but get an asterisk, it’s a sign that your assumptions about the data structure or your view’s level of detail are incorrect.
Why Is ATTR() Needed at All? The Aggregation Rule
This is where one of Tableau’s core concepts comes into play: the inability to mix aggregate and non-aggregate fields in certain contexts. When you create calculations or build a viz, every field needs to be on the same level - either all aggregated or all not.
For example, if you place SUM(Sales) (an aggregate) on your view, you can't simply display a non-aggregated dimension like Customer Name alongside it. Tableau wouldn't know which of the thousands of customer names to show next to the overall sales total.
You have to tell Tableau how to aggregate Customer Name. This is where ATTR steps in. ATTR(Customer Name) turns the dimension into an aggregate. If your view is detailed enough that only one customer name is present in a partition (like a view showing sales per Order ID), ATTR(Customer Name) will show that name. If not, it will show an asterisk.
Practical Use Cases for ATTR()
1. Data Blending Check
When blending data from a secondary source, the fields you bring over are always aggregated. Tableau frequently defaults to ATTR() for blended dimensions. This is extremely useful because an asterisk in a blended field instantly tells you there’s an issue with your data relationship. For example, if you blend sales data with sales targets on Region and see ATTR(Sales Target) showing *, it could mean you have duplicate target entries for that region in your secondary source.
2. Creating Smart Labels
ATTR shines in calculated fields where you need to mix measures and dimensions. Imagine you want to create a label that shows 'Target Missed!' if sales are below a certain threshold. The calculation might be:
IF SUM([Sales]) < 1000 THEN "Target Missed!" ELSE "" END
Now, what if you wanted to also include the Region Manager in that label? You can't just type [Region Manager] because that is a non-aggregate field, whereas SUM(Sales) is an aggregate.
This is where ATTR fixes the problem:
IF SUM([Sales]) < 1000 THEN "Target Missed for " + ATTR([Region Manager]) ELSE "" END
This formula works because ATTR([Region Manager]) is an aggregate. It also serves as a check: if a region strangely has two managers assigned in your data, the label would show *, immediately alerting you to a data cleanliness problem.
3. Troubleshooting Relationship Mismatches
The asterisk is your best troubleshooting partner. When you see it, don’t try to "get rid of it" immediately. Ask yourself, "Why is Tableau finding multiple values here?" Nine times out of ten, the solution is one of these:
- Adjust the Level of Detail: The most common fix. If
ATTR(Sub-Category)shows an asterisk at theCategorylevel, addingSub-Categoryto the Rows or Columns shelf provides a more granular level of detail whereATTR(Sub-Category)will resolve to a single value. - Re-Evaluate Your Question: Sometimes an asterisk means you're asking the wrong question of your data. Perhaps you shouldn't be looking for a single
Product Nameat theCustomerlevel of detail. Maybe you wanted a count instead (COUNTD(Product Name)) or a concatenated list. - Examine Your Data Source: An unexpected asterisk is often a free data quality check. It points to duplicates or inconsistent entries that need fixing at the source.
Final Thoughts
Mastering ATTR() is a significant step in moving from a beginner to an intermediate Tableau user. It’s more than just an aggregation function - it’s a data validation tool that forces you to be clear about the structure of your data and the questions you ask of it. By returning a value only when it's singular and presenting an asterisk (*) otherwise, ATTR() adds a layer of reliability to your dashboards and helps you spot data integrity issues before they lead to wrong conclusions.
The learning curve with concepts like ATTR() and aggregation rules is exactly why building reports in traditional BI tools can feel like a heavy lift. It often takes hours just to get the data to co-operate before you can even analyze it. At Graphed, we’ve removed that complexity. You can connect your data sources, and then simply describe the chart or report you need in conversational language. We handle the underlying data logic, relationships, and aggregations for you, allowing you to move straight to insights in seconds instead of fighting with the tool's settings. With Graphed , your focus stays on the business questions, not the technical hurdles.
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?