Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

andy
Contributor III

Conditional show/hide in bar chart and combo chart

Hi,

I have an app where the user can select which measures to display out of 6 pre-defined. The selected measures show up in tables and charts. My problem is that in the bar-chart object there is no conditional show attribute so I did a if(index(GetFieldSelections(Labels),'Budget')>0,sum(Budget))

Works but the bars remains on their places which means that if I select the first and the last measure the bars have a great space between them. I would like the bars to be next to each other. Anyone have an idea of how to solve this or should I wait for the show-condition to be implemented in the standard bar-chart?

barchart.png

 

1 Solution

Accepted Solutions

Re: Conditional show/hide in bar chart and combo chart

Why don't you use 2 dimensions with 1 measure? Here dimension 2 will be Label and your expression will then by made up of Pick Match statement

Pick(Match(Label, .....),
Expression1,
Expression2,
Expression3,
...)

 

6 Replies

Re: Conditional show/hide in bar chart and combo chart

Not sure if it will make a difference, but have you tried to uncheck 'Include Zero Values' under Add-Ons -> Data Handling?

andy
Contributor III

Re: Conditional show/hide in bar chart and combo chart

Hi,

Yes I did so and also tried to add a 0 as the else condition in the if-statement. That didn't change anything though.

Re: Conditional show/hide in bar chart and combo chart

How many expressions and dimensions do you have in your chart?

Highlighted
andy
Contributor III

Re: Conditional show/hide in bar chart and combo chart

1 dimension and 6 measures

Re: Conditional show/hide in bar chart and combo chart

Why don't you use 2 dimensions with 1 measure? Here dimension 2 will be Label and your expression will then by made up of Pick Match statement

Pick(Match(Label, .....),
Expression1,
Expression2,
Expression3,
...)

 

andy
Contributor III

Re: Conditional show/hide in bar chart and combo chart

Yeah, that's a good suggestion, I'll try that right away.  The only drawback I think is that it cannot be used in a combo-chart if I want any measure to be presented as a mark instead of a bar. But I'll try it and it might be just good enough at this moment. Thanks for the hint!