Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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]
May be this:
LOAD [seller risk],
Pick(WildMatch([seller risk], '*High*', '*Medium*', '*Low*'), 'High', 'Medium', 'Low') as [Highest Risk]
FROM Source
May be this:
LOAD [seller risk],
Pick(WildMatch([seller risk], '*High*', '*Medium*', '*Low*'), 'High', 'Medium', 'Low') as [Highest Risk]
FROM Source
hmmm.it didn't work...
Did not work for any of the rows or did not work partially?
it didn't work at all, no value returned for the highest risk field
Can you share a screenshot of data within seller risk field?
I think Sunny's answer is right, could you post your script?
Here is an example with Sunny's answer
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;
It worked on a second try. I forgot the '*'.
Thank you!
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