Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

rupe
Not applicable

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.

Tags (2)
4 Replies
richardpayne
Not applicable

Re: Fuzzy Search in Scripts

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

VishalWaghole
Not applicable

Re: Fuzzy Search in Scripts

Hi

PFA of qvw application file that will help you.

Thanks

Vishal

Not applicable

Re: Fuzzy Search in Scripts

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

rupe
Not applicable

Re: Fuzzy Search in Scripts

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 .....