Remove 0s from data labels

Reply
Green Belt

Remove 0s from data labels

I want to remove 0's from data labels (i.e. only show data labels when it is not 0). 

 

Any idea how I can do this? I've attached a picture of the card I'm seeing. As you can see, there are a lot of 0s in the data labels. 

Screen Shot 2020-03-25 at 1.23.59 PM.png

Highlighted
Blue Belt

Re: Remove 0s from data labels

Hi @hamza_123 

 

You could create a new beastmode to return an empty string if the value is 0 otherwise return the value

CASE WHEN `value` = 0 THEN '' ELSE `value` END

Put this calculated field into the Tooltip 1 field and then set the data value label to be Tooltip 1 instead.



**Was this post helpful? Click the heart icon**

**Did this solve your problem? Accept it as a solution!**
Highlighted
Yellow Belt

Re: Remove 0s from data labels

Grant's solution would likely be the most comprehensive for a variety of different scenarios.

 

I'm also curious as to how your Data Label Settings are configured. If "Show When Zero" is unchecked, it should automatically hide all your "0" values. Seems to work for all my charts.


Capture.PNG


----------
Serving up data insights since 2002...
Highlighted
Green Belt

Re: Remove 0s from data labels

For the first solution provided: empty thread even shows if beast mode selected. 

 

For the second solution provided: My shows 0 box is unchecked. Even then this is hapenning. I don't get it

Highlighted
Blue Belt

Re: Remove 0s from data labels

@hamza_123 How are your data label settings defined? Did you change it to reference %TOOLTIP1 instead of leaving it blank?

 

What do you mean by empty thread?



**Was this post helpful? Click the heart icon**

**Did this solve your problem? Accept it as a solution!**
Announcements
Want to join our weekly online meet up? Please visit this board here and let me know. Click here for more details!