Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
andy
Partner - Creator III
Partner - Creator 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
sunny_talwar

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,
...)

 

View solution in original post

6 Replies
sunny_talwar

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

andy
Partner - Creator III
Partner - Creator III
Author

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.

sunny_talwar

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

andy
Partner - Creator III
Partner - Creator III
Author

1 dimension and 6 measures

sunny_talwar

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
Partner - Creator III
Partner - Creator III
Author

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!