Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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 (4)
1 Solution

Accepted Solutions
Highlighted
Contributor III
Contributor III

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
Highlighted
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

Highlighted
Contributor III
Contributor III

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

Highlighted
Creator II
Creator II

Hi Mja_jami,
Can you please mark it as correct if you got the solution
Regards,
Bhargav
Highlighted
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!!!

Highlighted
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