Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
alexquimu
Partner - Contributor III
Partner - Contributor III

Hiding Zero Values in a Chart in Qliksense with multiple measures and one dimension

Hi there.

I have a Chart Bar in Qliksense with one dimension and two measures. However, some of these measures return a zero result, and I need to hide them from the chart. To achieve this, I went to the Data Handling section and unchecked the option to Show 0 values

minikiu00_1-1726477526454.png

Despite this, the bars with zero values are still visible. Is there a way to completely remove these bars with zero values from the chart? (see the picture)

minikiu00_2-1726477820480.png

In case someone wants to try, this is the data I used:

Test_Data:
LOAD * INLINE
[
Amount, Category, Area
12, AA, Area1
34, AA, Area2
15, BB, Area3
15, BB, Area1
];

 

And these are the measures:

Category AA: Sum({<Category={"AA"}>}Amount)

Category BB: Sum({<Category={"BB"}>}Amount)

 

I have also tried using an IF-expression to return null when the measure yields a 0 result, and unchecked the null values in the dimension data. However, this approach does not seem to work.

 

Thanks in advance.

Labels (6)
6 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You want to suppress the "0" value label? Perhaps change the measure to:

if(count({<Category={"AA"}>}Amount) > 0, Sum({<Category={"AA"}>}Amount), '')

-Rob

alexquimu
Partner - Contributor III
Partner - Contributor III
Author

Hey Rob.

I just changed the measure with the expression you suggested, and it still showed '-'. However, I just discovered that by changing the measure format from 'Automatic' to any other, e.g. 'Number', it does not show the label, see the picture:

alexquimu_0-1726574964862.png

I suppose there is no way to remove the bar, so that the blue bar in Area2 can be centered on the label, right?

 

Thank you so much for your response, you really helped me. Have a nice day!

 

Alex

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I don't know of any way to remove the bar space. Perhaps someone else has a suggestion. 

-Rob

alexquimu
Partner - Contributor III
Partner - Contributor III
Author

Thanks for your help Rob!

Alex

BernardBernoulli
Contributor III
Contributor III

Maybe unchecking "Inlcude zero values" in the chart options help with that?

BernardBernoulli_0-1727169228767.png

 

alexquimu
Partner - Contributor III
Partner - Contributor III
Author

Hey BernardBernoulli,

Thanks for your response! Unfortunately, the solution you provided was my initial attempt, and I've since discovered that it doesn't work as expected when a chart has multiple measures.

Alex