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: 
Anonymous
Not applicable

Wildmatch or Like function?

Hi

I'm trying to map a field "seller risk" to a "Highest risk" field.

The seller risk's value has multiple seller and their risk, for example "Apple - Low; Microsoft - Medium; Nokia - High"

The Highest risk field should take the highest risk of all sellers' risk and in this example, it should be "High"

I'm trying to use the wildmatch function, but looks like it doesn't work.  Any idea how to map this?

Thanks

Yvonne

This is my script:

Load [seller risk],

if(wildmatch([seller risk], 'High'),'High',
if(wildmatch([seller risk], 'Medium'),'Medium','Low')) as [Highest Risk]

1 Solution

Accepted Solutions
sunny_talwar

May be this:

LOAD [seller risk],

          Pick(WildMatch([seller risk], '*High*', '*Medium*', '*Low*'), 'High', 'Medium', 'Low') as [Highest Risk]

FROM Source

View solution in original post

8 Replies
sunny_talwar

May be this:

LOAD [seller risk],

          Pick(WildMatch([seller risk], '*High*', '*Medium*', '*Low*'), 'High', 'Medium', 'Low') as [Highest Risk]

FROM Source

Anonymous
Not applicable
Author

hmmm.it didn't work...

sunny_talwar

Did not work for any of the rows or did not work partially?

Anonymous
Not applicable
Author

it didn't work at all, no value returned for the highest risk field

sunny_talwar

Can you share a screenshot of data within seller risk field?

maxgro
MVP
MVP

I think Sunny's answer is right, could you post your script?

Here is an example with Sunny's answer

1.png

Source:

load * inline [

seller risk

Apple - Low; Microsoft - Medium; Nokia - High

Nokia - High; Apple - Low; Microsoft - Medium;

Apple - Low; Microsoft - Medium;

Apple - Low;

nomatch

];

final:

LOAD

  [seller risk],

    Pick(WildMatch([seller risk], '*High*', '*Medium*', '*Low*', '*'), 'High', 'Medium', 'Low', [seller risk])

          as [Highest Risk]

Resident Source;

DROP Table Source;

Anonymous
Not applicable
Author

It worked on a second try. I forgot the '*'.

Thank you!

sunny_talwar

Hahahaha, you should have copy pasted the expression (assuming the field names matched the sample you provided). But I am glad we maxgro‌'s sample helped you figure out the issue