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: 
balarajuhari
Contributor II
Contributor II

Compare two strings (One from field selections and another from a variable)

Hi Giants, I have a scenario where I want to populate a variable(vEUCategory) such that if any of the selected values in a field (Country) matches with any of the list in a variable (vEUCountries) then 1 else 0. How can i achieve this. I know we can achieve SQL's IN operator functionality in Qlikview using Match function. But here i need to compare multiple values (selections in Country field) with the list of values(EU Countries) in a variable (vEUCountries). I tried below, but not working when multiple countries (both EU and Non-EU) are selected.

vEUCategory=if(Match(subfield(Concat(Country, ','), ',', 1),$(=vNonEUCountries))=0 and

Match(subfield(Concat(Country, ','), ',', 1),$(=vEUCountries))>0),1,0).

Happy Learning,

Hari

2 Replies
Qrishna
Master
Master

Check this out.

1.PNG2.PNG

Hope that helps.

balarajuhari
Contributor II
Contributor II
Author

Thanks Krishna.