Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mja_jami
Contributor III
Contributor III

Nested IF in Load Scrirpt

Dear Qlik experts,

How can I write the load script so that it will populace a field 'Status' (i.e.;Flat Cancelled/ Reg Cancelled/ Active) checking two fields (cancel_date, premium) :

If cancel_date is not Blank/ Null and premium < 0; Then, Status = “Flat Cancelled” ,

If cancel_date is not Blank/ Null and premium >= 0; Then, Status = “Reg Cancelled” ,

If cancel_date is Blank/ Null; Then, Status = “Active”

Thank you very much for help.

Best regards,

Jami

Labels (2)
1 Solution

Accepted Solutions
mja_jami
Contributor III
Contributor III
Author

Thank you Bhargav,

I used this below and worked.

if(isnull(cancel_date) or cancel_date='' ,'Active',if(premium<0,'Flat Cancelled','Reg Cancelled')) as Status

Thanks very much.

View solution in original post

5 Replies
bhargav_bhat
Creator II
Creator II

Hi Mja_jami,

Below is the required expression

if(isnull(cancel_date) or cancel_date='' ,'Active',if(premium<0,'Flat Cancelled','Reg Cancelled')) as Status

 

Regards,

Bhargav

mja_jami
Contributor III
Contributor III
Author

Thank you Bhargav,

I used this below and worked.

if(isnull(cancel_date) or cancel_date='' ,'Active',if(premium<0,'Flat Cancelled','Reg Cancelled')) as Status

Thanks very much.

bhargav_bhat
Creator II
Creator II

Hi Mja_jami,
Can you please mark it as correct if you got the solution
Regards,
Bhargav
marcos_rv_666
Contributor II
Contributor II

Holis!!!

Try this

IF( isnull (cancel_date ) OR cancel_date = ' ' , 'Active', IF (  premium < 0 , 'Flat Cancelled', 'Reg Cancelled' )) AS Status 

 

Saludos!!!

Channa
Specialist III
Specialist III

IF( Len(Canceldate)>0 and Premium>0, ststus='Flat cancel',IF(Len(Canceldate)>0 and Premium>0, ststus='REg cancel',RedCancel'))

 

try like this

Channa