Tip: Conditional Data Labels

advertisement
Tip: Conditional Data Labels
You may have already figured out that you can place a field on the Text shelf to add data labels based on
the values of that field. However, often you’ll find that you don’t actually want to label every mark; rather
you may want to label only the outliers, or only the data within your region. Using Tableau’s calculated
fields you can create conditional data labels based on a custom field that only includes the values of
interest.
Here’s how it works
Say you are analyzing the daily regional sales for a supermarket and you want to label all regions that
have sales greater than $130,000. Dragging the Sales Total field to the text shelf, adds data labels based
on the total sales for each region.
Page Copyright © 2003-2007 Tableau Software, Incorporated and its licensors. All rights reserved. Patents pending.
To add conditional data labels:
1. Select Create Calculated Field on the Measures Data window menu.
2. In the Calculated Field dialog box, name the field “Outliers” and write a conditional formula that
describes the marks you want to label. For example, the formula to only label regions whose sales is
greater than $130,000 looks like this:
The Calculated Field dialog box should look something like this:
Page Copyright © 2003-2007 Tableau Software, Incorporated and its licensors. All rights reserved. Patents pending.
3. Place the new field on the Text shelf.
The final view only includes data labels for the regions whose sales are greater than $130,000.
Page Copyright © 2003-2007 Tableau Software, Incorporated and its licensors. All rights reserved. Patents pending.
Note: If you are using Tableau v3.0 or later, you can show and hide the data labels for individual marks. To
hide a specific data label, right-click a mark and select Data Labels > Off.
Learn More
• Learn more about data labels by searching for Data Labels in the Tableau online help.
• Contact Tableau Technical Support at: (206) 633 3400 x513
Page Copyright © 2003-2007 Tableau Software, Incorporated and its licensors. All rights reserved. Patents pending.
Download