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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
juandevqlik
Contributor III
Contributor III

Use if with multiple members of a variable

Hi,

I create one variable called name with values 'green', 'red', 'blue'.

I create a filter which contains this dimension "name" and show 3 values, all correct here.

I have other variables of amount called: 'greenamount', 'redamount', 'blueamount', 'greenandredamount' and all the combinations ...

Then i want to create a table in which the column depends on the filter selection. So for example:

if (name = green, 'greenamount'), this works perfect but when im trying to choose 2 values in the filter the logic doesnt works. So if the user, clicks on 2 options of the filter: 'red' and 'blue', i would like to do something like if(name = 'green and name='blue', 'greenandblueamount')

Is this posible at qlik sense? 

Thanks for the replies 

 

Labels (7)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

change to below

=if(substringcount(GetFieldSelections(name),'red') and substringcount(GetFieldSelections(name),'blue'),'greenandblueamount')

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

change to below

=if(substringcount(GetFieldSelections(name),'red') and substringcount(GetFieldSelections(name),'blue'),'greenandblueamount')

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
juandevqlik
Contributor III
Contributor III
Author

works perfect, thanks for your reply very usefull 🙂