Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlikers,
I was using not wildmatch for restricting a value of column in script, it was also removing null values from that column and then I tried <> instead of not wildmatch which is not removing null values. Can anyone please tell me why not wildmatch is not working like <>?
Regards,
You might want to modify where condition like this:
WHERE
isnull(ColA) or Not(WildMatch(ColA, 'App*'));
Regards,
Aditya
Ideally, both should work same. Can you share sample data and the where condition that you are using to restrict data ?
Regards,
Aditya
The not wildmatch is not loading the data with NULL values.
Ex:
Col A Linecd
Apple 1
Ball 2
Null 3
If I say "NOT WILDMATCH(COLA,'Apple')"" - the result is just 2 but ideally I should be getting 2 and 3 right?
Also <> is not working with ColA <> 'App*'
The '<>' operator is generally used for exact matching and doesn't involve wildcard patterns.
The 'not WildMatch' is typically used to exclude values that match a specific wildcard pattern.
In this context, when using not WildMatch(ColA, 'App*'), the output would show 'Ball 2' and 'Null 3'.
I was expecting the same, @BrunPierre. The result however differs:
Data:
NOCONCATENATE LOAD * INLINE [
ColA, Linecd
Apple, 1
Ball, 2
];
CONCATENATE (Data) LOAD
Null() AS ColA,
3 AS Linecd
AutoGenerate
1;
Test:
NOCONCATENATE LOAD
*
RESIDENT
Data
WHERE
Not(WildMatch(ColA, 'App*'));
DROP TABLE Data;
This is the result I'm getting:
You might want to modify where condition like this:
WHERE
isnull(ColA) or Not(WildMatch(ColA, 'App*'));
Regards,
Aditya
Yes, certainly. I would have however expected WildMatch() not to behave as shown.
Wildmatch() Returns expressions that match with provided match string/strings.
Since it returns matching expression, in current case, it won't find anything to return as value is null(). Maybe that's why it is returning only 1 entry.
Regards,
Aditya