Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
abhaysingh
Specialist II
Specialist II

if(not isnull(Flag1) and not IsNull(Flag2),1,0 ) as MainFlag

Hi,

Can anyone explain me the meaning of this expression?

thanks

3 Replies
sujeetsingh
Master III
Master III

That means Flag1 is not null and Flag2 is not null the 1 else 0.

tresesco
MVP
MVP

If both of Flag1 and Flag2 are not null, then 1, otherwise 0 (the value would be stored in a new field - MainFlag). In other words, if any of the flags is null, it will be 0, else 1.

Flag1Flag2result
nullnull0
nullNot null0
Not nullnull0
Not nullNot null1
abhaysingh
Specialist II
Specialist II
Author

Common:

LOAD

     %Oracle_ID,

     2 as Flag2

FROM

D:\Gaurav\Secondary.qvd

(qvd);

Join

LOAD

     %Oracle_ID,

     1 as Flag1

FROM

D:\Gaurav\Primary.qvd

(qvd);

NoConcatenate

CommonFlag:

LOAD

  %Oracle_ID,

  if(not isnull(Flag1) and not IsNull(Flag2),1,0 ) as MainFlag

Resident Common;

MapCommon:

Mapping

LOAD

  %Oracle_ID,

  MainFlag

Resident CommonFlag;

DROP Table Common;

this is the code written by someone to full fill condition like from primary and secondary only comman %Oracle id Has to be fetch.. is it right?