Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
sunny_talwar

Null Value with Match/WildMatch and Like

Hi Everyone,

I am trying to understand if this is a bug or if this is an expected behavior. Let's look at the following script:

Table:

LOAD *,

  If(Match(Value, 50) or Len(Trim(Value)) = 0, 1, 0) as Flag1,

  If(not Match(Value, 60), 1, 0) as Flag2,

  If(not Value like 60, 1, 0) as Flag3,

  If(not RangeSum(Match(Value, 60)), 1, 0) as Flag4;

LOAD Dim,

  If(Len(Trim(Value)) > 0, Value) as Value

Inline [

Dim, Value

A, 50

B, 60

C

];


Capture.PNG

I would expect that all the flags should give me the same value as I am just writing the same thing in many different ways (60 should be 0 and 50 and null should be flagged as 1). But Flag2 doesn't really behave like that. For some reason Match puts 0 into the null bucket as well. Is this a usual behavior or is this a bug????

I used to prefer using Match/WildMatch functions over using like function, but it seems that like is doing what I intended to do with the Match.

I did find a work around suggested by swuehl‌ using the RangeSum() function around the match function. But as I mentioned, I am just trying to understand Match/WildMatch behaivor here.

Thanks in advance for all the responses.

Best,

Sunny

Message was edited by: Sunny Talwar Adding the sample qvw with this post.

10 Replies
Digvijay_Singh

Thanks @sunny_talwar !!!

I had this issue since long, somehow I was managing using too many individual conditions like A <> 'ABC' and A <> 'BCA' and A <> 'DCA' but the list was growing so I had to somehow make match function work along with inclusion of nulls.

Your post help me to manage it using isnull(fieldname) along with match. 

Thanks!!

Digvijay