Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

nsnybs21qv
New Contributor II

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]

Tags (1)
1 Solution

Accepted Solutions

Re: Wildmatch or Like function?

May be this:

LOAD [seller risk],

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

FROM Source

8 Replies

Re: Wildmatch or Like function?

May be this:

LOAD [seller risk],

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

FROM Source

nsnybs21qv
New Contributor II

Re: Wildmatch or Like function?

hmmm.it didn't work...

Re: Wildmatch or Like function?

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

nsnybs21qv
New Contributor II

Re: Wildmatch or Like function?

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

Re: Wildmatch or Like function?

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

MVP
MVP

Re: Wildmatch or Like function?

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;

nsnybs21qv
New Contributor II

Re: Wildmatch or Like function?

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

Thank you!

Re: Wildmatch or Like function?

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

Community Browser