Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
vsabbise
Creator
Creator

Compare 2 WildMatch outputs

I am looking for a solution to compare 2 WildMatch outputs in Qlik Sense Expression. In fact a way to code nested WildMatch .

I have my first list of id's generated by first Wildmatch expression And Second list of Id's generated by Second Wildmatch expression

Now I want common Id's from either of the lists

Ex: I want something like below:

=if (   wildmatch(

     if(WildMatch(File_Text_2,'$(vFileText2)*'),id_2),     if(WildMatch(File_Text,'$(vFileText)*'),id_1)

                       ),id_1)

Explanation:

if(WildMatch(File_Text_2,'$(vFileText2)*'),id_2)  : This generates list of id_2

if(WildMatch(File_Text,'$(vFileText)*'),id_1)            : This generates list of id

Now I want to list the common id's that are present in both the lists id_2 & Id_1

30 Replies
vsabbise
Creator
Creator
Author

Got it Thanks. However, I was facing an other issue with the '*' operator.

The expression p({<Text = {"$(vText1)*"}>}) * p({<Text = {"$(vText2)*"}>}) is resulting a 0 or null if one of the lists p() is empty. Is there a way to retain of the lists if other list is empty ?

Example:

What's happening now:
p({<Text = {"$(vText1)*"}>}) = {1, 2, 3}
p({<Text = {"$(vText2)*"}>}) = {}
then p({<Text = {"$(vText1)*"}>}) * p({<Text = {"$(vText2)*"}>}) = {}

What I want
p({<Text = {"$(vText1)*"}>}) = {1, 2, 3}
p({<Text = {"$(vText2)*"}>}) = {}
then p({<Text = {"$(vText1)*"}>}) * p({<Text = {"$(vText2)*"}>}) = {1, 2, 3}

but at the same time 'and' operation should be preserved. I mean common items should be listed.

p({<Text = {"$(vText1)*"}>}) = {1, 2, 3}
p({<Text = {"$(vText2)*"}>}) = {2}
then p({<Text = {"$(vText1)*"}>}) * p({<Text = {"$(vText2)*"}>}) = {2}

Could you help ?