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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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 ?

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

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
Champion III
Champion III

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
Champion III
Champion III

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
Champion III
Champion III

Or if you want to stick to Match():

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