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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
danialier
Creator III
Creator III

Bar Chart limit condition

Hello,

I have a bar chart with two expression showing the sales of the products A and B in columns. Moreover I have a list box with these two products.

I want the bar chart to display the products I select in the list box, so:

     > If I select product A I just want product A to be displayed in the bar chart.

     > If I select product B I just want product B to be displayed in the bar chart.

     > If I select product A and B I want product A and B to be displayed in the bar chart.

Which is the conditional I should use in the conditional expression ?

thanks,

dani

1 Solution

Accepted Solutions
santharubban
Creator III
Creator III

try this,

if(product A,1,if((product A and product B),1,0)) and similar for product B

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Why can't you add the Products dimension to your bar chart? That way you won't need to mess around with conditional expressions.

You could use this if you do need/want to use conditional expressions and your products dimension is named Product:

For product A: if(substringcount(concat(distinct Product & '~', ','), 'A~')),1,0)

For product B: if(substringcount(concat(distinct Product & '~', ','), 'B~')),1,0)


talk is cheap, supply exceeds demand
santharubban
Creator III
Creator III

try this,

if(product A,1,if((product A and product B),1,0)) and similar for product B