Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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)
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.
You want to suppress the "0" value label? Perhaps change the measure to:
if(count({<Category={"AA"}>}Amount) > 0, Sum({<Category={"AA"}>}Amount), '')
-Rob
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:
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
I don't know of any way to remove the bar space. Perhaps someone else has a suggestion.
-Rob
Thanks for your help Rob!
Alex
Maybe unchecking "Inlcude zero values" in the chart options help with that?
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