Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
ameensom
New Contributor II

How to use IF not null with specific fields?

I want to create new field in the data

- Want to name the field as (profit) where I calculate total - cost only if another field which is (Date of delivery is not NULL)

Existing field

total, cost, date of delivery

Field I want to create: Profit of deliveries

Basis formula in mind: total - cost IF date_of_delivery not NULL.

Any help with this as I am not a programmer.

1 Solution

Accepted Solutions
Chanty4u
Esteemed Contributor III

Re: How to use IF not null with specific fields?

try this

count(if(isnull(Date_of_Delivery),cost),total)

5 Replies
Chanty4u
Esteemed Contributor III

Re: How to use IF not null with specific fields?

try this

count(if(isnull(Date_of_Delivery),cost),total)

shraddha_g
Honored Contributor III

Re: How to use IF not null with specific fields?

Try below in Load Script,

Total   - if(not isnull([Date of delivery]) or len([Date of delivery])>1 , Cost) as Profit

arvind_patil
Valued Contributor III

Re: How to use IF not null with specific fields?

Hi Ameen,

May be like below:

if(not isnull([Date of delivery]) or len([Date of delivery])>1 , Total   - Cost)  as Profit


Thanks,

Arvind Patil

MVP & Luminary
MVP & Luminary

Re: How to use IF not null with specific fields?

You could use:

if(date_of_delivery, total - cost, 0) as [Profit of deliveries]

- Marcus

ameensom
New Contributor II

Re: How to use IF not null with specific fields?

I ended up using if(isNull(dateOfDelivery,'Not Delivered','Delivered')

Thanks a lot

Community Browser