Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
bimanbeginner
Contributor II
Contributor II

Creating a wild Match search

Hi There

Please could you assist in making my wild match search as dynamic as possible

I need to match column Name1 to Name2 if there is any matching words it must return true.

In my example all of them should return true im not sure what I am doing wrong.

Thanks

1 Solution

Accepted Solutions
ciaran_mcgowan
Partner - Creator III
Partner - Creator III

I suggest that you have a look at my example below, it works. I even added an extra field to test that it does.

Capture.PNG

View solution in original post

9 Replies
giakoum
Partner - Master II
Partner - Master II

It looks perfectly correct to me as only "Bubble Gum" exists in both name1 and name2

What exactly are you after?

bimanbeginner
Contributor II
Contributor II
Author

All of them them contain a word from the Name1 residing in Name2

I would like to all of them to say true...because they contain at least one word from Name1

bimanbeginner
Contributor II
Contributor II
Author

All of them them contain a word from the Name1 residing in Name2

I would like to all of them to say true...because they contain at least one word from Name1

ciaran_mcgowan
Partner - Creator III
Partner - Creator III

Hi bimanbeginner,

I see what you're trying to do here. The first thing you need to do is separate out all the potential words from Name1. In the load script, add this line:

Subfield(Name1, ' ') AS Name1_Words

This will create a row of data for each word which means there will be duplication that may need to be removed later. Once the data is separated you can accomplish what you want with the script below:

if(WildMatch(Name2, '*' & Name1_Words & '*'),'True','False')

Job Done!

trdandamudi
Master II
Master II

What Ciaran mentioned above is the best option or if you think you have only couple of words then you can use the below expression:

=if(WildMatch(Name1,'*'&Name2&'*') or WildMatch(Name2,'*'&Name1&'*')

    or WildMatch(Name1,'*' &subfield(Name2, ' ' ,1)&'*') or WildMatch(Name1,'*' &subfield(Name2, ' ' ,2)&'*') ,'True','False')

Wildmatch.jpg

ciaran_mcgowan
Partner - Creator III
Partner - Creator III

I suggest that you have a look at my example below, it works. I even added an extra field to test that it does.

Capture.PNG

bimanbeginner
Contributor II
Contributor II
Author

Thank you , I guess this does answer my question although it will not work in my actual case as the Name1 field is made up of many different combinations of delimiters

ciaran_mcgowan
Partner - Creator III
Partner - Creator III

Can you post an example of some of your data?

I've had to do a lot of data clean up to get this to work sometimes (especially when scraping from the web) so I still might be able to help.

bimanbeginner
Contributor II
Contributor II
Author

Thank you Ciaran I appreciate it.

The root cause of my problem, is that I need to compare a bank statement to system transactions.

As you know with bank statements a client could put any reference when making a payment.

I need to link the payment on the statement to the transaction to show the reference the client has used.

The wild match I am using is to find any reference that may contain the clients name or a part thereof to create a new mapping table to try and Identify the new payments in the future...  Maybe there is a better way to do this...?

  Mapping Data