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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
tmumaw
Specialist II
Specialist II

Logic Issue

Can someone please help me with this logic.  I have 2 fields I am checking.  Both fields are blank and it's coming back with a mismatch. I have tried If(isnull(Davey_NextRenewalPODNP) and (len(NRC_SAP) = 0),0

Thanks

if(isnull(davey_NextRenewalPODNP) and (Len(NRC_SAP) > 0),1,
       if(isnull(davey_NextRenewalPODNP) and isnull(NRC_SAP),0,
              if(NRC_SAP  <> davey_NextRenewalPODNP,1,0)))  as NoMatchNRC
,

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Can you check using Len(Trim()) instead of IsNull()

If(Len(Trim(davey_NextRenewalPODNP)) = 0 and Len(Trim(NRC_SAP)) > 0, 1,
      If(Len(Trim(davey_NextRenewalPODNP)) = 0 and Len(Trim(NRC_SAP)) = 0, 0,
              If(NRC_SAP <> davey_NextRenewalPODNP, 1, 0)))  asNoMatchNRC,

View solution in original post

6 Replies
sunny_talwar
MVP
MVP

So you are facing a issue here?

if(NRC_SAP  <> davey_NextRenewalPODNP,1,0)

tmumaw
Specialist II
Specialist II
Author

No.  It's when they are both blank.

Thanks

sunny_talwar
MVP
MVP

Can you check using Len(Trim()) instead of IsNull()

If(Len(Trim(davey_NextRenewalPODNP)) = 0 and Len(Trim(NRC_SAP)) > 0, 1,
      If(Len(Trim(davey_NextRenewalPODNP)) = 0 and Len(Trim(NRC_SAP)) = 0, 0,
              If(NRC_SAP <> davey_NextRenewalPODNP, 1, 0)))  asNoMatchNRC,

dominicmander
Partner - Creator
Partner - Creator

Hi Thom,

As a test, try Ord() of both fields ... it could be that there is a "blank" character Chr(0) ... which is a character for a blank so fails the IsNull() and Len() tests.

tmumaw
Specialist II
Specialist II
Author

Thanks Sunny T.....

sunny_talwar
MVP
MVP

No problem