Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I'm usign Match() function into a complex script expression to create one new field.
I'm using the following code:
![2018-04-20 14_05_44-Modifica Script [C__Users_denardm1_Desktop_test Locale.qvw].png](/legacyfs/online/200355_2018-04-20 14_05_44-Modifica Script [C__Users_denardm1_Desktop_test Locale.qvw].png)
And the result is:

For the "h" record DOCTYPE=null() so I thought that match() function returns -1 because Null is different from ZRE and ZOFR... but is not....
How can write the script to have the same result ?
I would like to avoid using an approach with "or isnull(DOCTYPE)" like:
if(not match(DOCTYPE,'ZRE','ZOFR') or isnull(DOCTYPE),-1,0) as ResultBecause, as i wrote, the expression is very complex and i would like to resolve this issue without using "OR" statement.
Had similar issues with match and null values
Null Value with Match/WildMatch and Like
Not sure if this is any better, but look at result 2
Load
*,
not match(DOCTYPE,'ZRE','ZOFR') as Result,
not (DOCTYPE Like 'ZRE' or DOCTYPE Like 'ZOFR') as Result2;
load * inline [
DOCTYPE,text
ZRE,a
ZOFR,b
YOFR,c
YOF,d
ZOE,e
ZOF,f
ZMTE,g
,h
];
Had similar issues with match and null values
Null Value with Match/WildMatch and Like
Not sure if this is any better, but look at result 2
Load
*,
not match(DOCTYPE,'ZRE','ZOFR') as Result,
not (DOCTYPE Like 'ZRE' or DOCTYPE Like 'ZOFR') as Result2;
load * inline [
DOCTYPE,text
ZRE,a
ZOFR,b
YOFR,c
YOF,d
ZOE,e
ZOF,f
ZMTE,g
,h
];
Super Sunny !!!