Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good Morning - I've created the following If/Then/Else statement in a script to use as a field in a list box, but it is not functioning exactly as I thought.
My field: ([PO]Ship To Location (Location ID)) has values that start with 'SHARE:' and those that do not. When the value is 'SHARE:' I want the value to be 'Met Location' and all other values to be 'Other Location'.
I'm not understanding what I'm doing wrong with the following script line. The only value that is showing up is 'Other Location' at this point
if(MATCH("[PO]Ship To Location (Location ID)", 'SHARE:'), 'MET Location', 'OtherLocation') as ShipToLocation,
Any help is much appreciated.
George
May be wildmatch instead of Match
example :
Data:
load *,if(wildmatch(Field, 'SHARE:*'), 'MET Location', 'Other Location') as ShipToLocation inline [
Field
SHARE:blabla
blabla
];
output :
May be wildmatch instead of Match
example :
Data:
load *,if(wildmatch(Field, 'SHARE:*'), 'MET Location', 'Other Location') as ShipToLocation inline [
Field
SHARE:blabla
blabla
];
output :
Taoufiq - this is great, thank you for your input. Was using MATCH more limiting than the WILDMATCH? I just want to understand since it seems that our expressions are virtually the same.
Appreciate your time!!!
George
with pleasure George,
the trick is that with WILDMATCH you can use '*' at the end to compare the values starting with 'SHARE:.....' which is your case otherwise Match will work very well if you compare with 'SHARE:' i.e. the exact word