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: 
Roop
Specialist
Specialist

Fuzzy Search in Scripts

I am looking to define a true fuzzy search in scripting form so that it would find the most likely result from an input:

Input:

Blk

Black

Bk

White

Blu

B

Pk

Lookup Table:

Black

White

Blue

Pink

Orange

Result:

InputResult
BlkBlack
BlackBlack
BkBlack
WhiteWhite
BluBlue
BBlue or Black
PkPink

as can be seen, this example cannot use wildcards, but must use fuzzy logic. Under ideal circumstances, there would be a factor that would say how close the match was - I know this bit is asking a lot!

I have thousands of records that I wish to match in this way .........

Thanks in advance.

4 Replies
richardpayne
Creator
Creator

Just giving this thread a bump. I'm interested in this solution as well.

VishalWaghole
Specialist II
Specialist II

Hi

PFA of qvw application file that will help you.

Thanks

Vishal

Not applicable

Hello Rupe,

Try following below steps:

1) LOAD the below script.

2) Create a Straight table, with Color and Fuzzy as dimensions.

3) use below expression

=WildMatch(Color,mid(Fuzzy,1,1)&'*'& mid(Fuzzy,2,1)&'*' & mid(Fuzzy,3,1)&'*')

Script

Input:

LOAD * INLINE [

Fuzzy

Blk

Black

Bk

White

Blu

B

Pk

];

LookupTable:

LOAD * INLINE [

Color

Black

White

Blue

Pink

Orange

];

Please let me know if this was helpful or anything else is required.

Thanks,

angad

Roop
Specialist
Specialist
Author

Sorry - have been away for a while. Yes a useful response but I specifically wanted to use fuzy logic as opposed to semi-fuzzy logic - if that makes sense .....