How to avoid showing duplicate texts in text label data
Published: 16 Nov 2022 Last Modified Date: 17 Nov 2022
Question
How not to repeat the specified string in the text for each data.
<Current Behavior> <Desired Behavior>
Environment
Tableau Desktop
Answer
1. Connect to Sample Superstore. 2. Create a new calculated field as following. Name : Show Category Name Calculation : IF FIRST()=0 THEN 'This data has'+' "'+ATTR([Category])+'"' ELSEIF LAST()=0 THEN '"'+ATTR([Category])+'" .' ELSE '"'+ATTR([Category])+'"' END 3. Drag [Category] to Detail on Marks. 4. Drag [Show Category Name] to Text on Marks. 5. Right click on [Show Category Name] on Marks -> Edit Table Calculation -> Set as following.
Thank you for providing your feedback on the effectiveness of the article.