Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Match Function is excluding null values

Im using the Match function to exclude a particular value however it also seems to be removing null values . Does anyone have any ideas ?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Seems to work for me:

LOAD *

WHERE FieldName = 'CountryStatus' and not FieldValue = 'Inactive';

LOAD recno() as ID, FieldName, if(len(trim(FieldValue)),FieldValue, NULL()) as FieldValue INLINE [

FieldName, FieldValue

CountryStatus, Active

CountryStatus, Inactive

CountryStatus,

];

View solution in original post

10 Replies
swuehl
MVP
MVP

Could you post your expression / statement and some sample data. And what you expect to get?

Anonymous
Not applicable
Author

How about something like

If ( isnull[[YourField] or match(........) , .....................

Anonymous
Not applicable
Author

Can we use below expression

if(not(isnull([Field])), Match(...))

Not applicable
Author

Sorry my expression is

WHERE (FieldName = 'CountryStatus'

AND Match(FieldValue, 'Inactive) = 0)

;

this removes all Country statues which are 'inactive'. However it also removes all records that don't have a CountryStatus assigned ie nulls which is not what I want.

Anonymous
Not applicable
Author

WHERE (FieldName = 'CountryStatus'

AND

( Match(FieldValue, 'Inactive') = 0 or isnull(FieldValue) )

swuehl
MVP
MVP

Seems to work for me:

LOAD *

WHERE FieldName = 'CountryStatus' and not FieldValue = 'Inactive';

LOAD recno() as ID, FieldName, if(len(trim(FieldValue)),FieldValue, NULL()) as FieldValue INLINE [

FieldName, FieldValue

CountryStatus, Active

CountryStatus, Inactive

CountryStatus,

];

jonas_rezende
Specialist
Specialist

Hi.

When Country Status is null, which is value of FieldValue?

Not applicable
Author

Hi Bill I tried this however it returns values with CountryStatus as Inactive

swuehl
MVP
MVP

Or if you want to stick to Match():

WHERE FieldName = 'CountryStatus' AND Rangesum(Match(FieldValue,'Inactive'))=0;