Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Hide entry in legend if there are no data

Hi all,

I have a combo chart which displays data for a Date dimension for a couple products. I would like the legend to only show an entry for the products that the user has selected in the filter.

Screenshot 2019-02-18 at 15.43.48.png

In this screenshot, the user has selected product 0 and the legend should only contain an entry for product 0, but it still also shows product 1. (You can still see the datapoints for product 1 on the charts on the 0 linie, but only because I chose to show the data point marks = "Show data points" in presentation.)

My measure looks like:

 

// product 0
If(WildMatch(GetFieldSelections([product], ',', 10), '*0*') = 1 , Sum({$<product={'0'}>}volume) ,0 }

// product 1
If(WildMatch(GetFieldSelections([product], ',', 10), '*1*') = 1
, Sum({$<product={'1'}>}volume)
,0
}

I have tried with '', 0 and Null() in the else statement and I have unchecked the "Include zero values" in the Addons/Data Handling section of the chart.

Why is this not working?

 

3 Replies
Highlighted
Specialist III
Specialist III

Re: Hide entry in legend if there are no data

data is there you are not showing 

i don't think so u can hide

 

 

 

Channa
Highlighted
Specialist III
Specialist III

Re: Hide entry in legend if there are no data

if you have single measure you can change legend by having expression in measure label based on condition

Channa
Highlighted
Partner
Partner

Re: Hide entry in legend if there are no data

Thanks, but we need to have a measure for each product, so that our customer can select one or more products.