Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

How to make Multiple 'if' function

I need to make an expression with multiple 'if' functions:

If('order_status' = 'A' and 'Confirm_date'-'Create_date'>1, 'Quantity',0) as Late_quantity,

however, another kind of orders should be also categorised as late orders:

If('order_status' = 'B' and 'Confirm_date' is null and Today()-'Create_date'>1,'Quantity',0) as Late_quantity.

Is it possible to make an expression in Qlikview to cover both cases into one scenario?

1 Solution

Accepted Solutions
MVP
MVP

Re: How to make Multiple 'if' function

Hi Peter,

try this

=If('order_status' = 'A' and 'Confirm_date'-'Create_date'>1, 'Quantity',

If('order_status' = 'B' and 'Confirm_date' is null and Today()-'Create_date'>1,'Quantity',0)) as Late_quantity

Regards,

Jagan.

6 Replies
rajni_batra
Valued Contributor

Re: How to make Multiple 'if' function

Try This

If('order_status' = 'A' and 'Confirm_date'-'Create_date'>1, 'Quantity',

   If('order_status' = 'B' and 'Confirm_date' is null and Today()-'Create_date'>1,'Quantity') as Late_quantity.

MVP
MVP

Re: How to make Multiple 'if' function

Hi Peter,

try this

=If('order_status' = 'A' and 'Confirm_date'-'Create_date'>1, 'Quantity',

If('order_status' = 'B' and 'Confirm_date' is null and Today()-'Create_date'>1,'Quantity',0)) as Late_quantity

Regards,

Jagan.

Not applicable

Re: How to make Multiple 'if' function

Thank Jagan!

It works! But just another question: if I want to do something like: if 'Confirm_date' is not null, then..., how to code the "is not null" function?

Peter

Not applicable

Re: How to make Multiple 'if' function

Thank Jagan!

It works! But just another question: if I want to do something like: if 'Confirm_date' is not null, then..., how to code the "is not null" function?

Peter

rajni_batra
Valued Contributor

Re: How to make Multiple 'if' function

use

not isnull(date)

Not applicable

Re: How to make Multiple 'if' function

Thanks Rajni!!

Peter

Community Browser