Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
CrysiiD_BI
Contributor II
Contributor II

Filtering Line on a combo chart based on variables

I have a combo chart (bar & line). The bars change based on the variable selection I have. I also want the lines to change but it seems difficult to accomplish. The line represents a goal, when I switch the variable to yes I want a certain goal to display and when I switch it to no I want another goal to display. I'm not sure how to go about this.  I can't go the flag method as the goals are not fixed, I use set analysis to calculate the goal.

Is this even possible? If not do you have any alternatives? I was thinking about adding an alternative line on the chart and it seem viable for one sheet, but on the next sheet we have 5 charts. It would be tedious to have the user switch to the alternative on each chart. Hopefully I am explaining this well. 

Any help I can receive is much appreciated. 

Labels (1)
1 Solution

Accepted Solutions
rubenmarin

Hi, maybe with a combniation of pick and match to show the expression you want, like:

Pick(Match('$(varName)','Yes','No')
  ,[ExpressionForYes]
  ,[ExpressionForNo]
)

So if the variable stores 'Yes', Match() returns '1', and Pick uses the 1st expression. If the variable stores No, Match() returns 2 and Pick goes to the 2nd expression.

View solution in original post

2 Replies
rubenmarin

Hi, maybe with a combniation of pick and match to show the expression you want, like:

Pick(Match('$(varName)','Yes','No')
  ,[ExpressionForYes]
  ,[ExpressionForNo]
)

So if the variable stores 'Yes', Match() returns '1', and Pick uses the 1st expression. If the variable stores No, Match() returns 2 and Pick goes to the 2nd expression.

CrysiiD_BI
Contributor II
Contributor II
Author

That worked! Thank you!!!!