Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ameensom
Contributor II
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
MVP
MVP

try this

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

View solution in original post

5 Replies
Chanty4u
MVP
MVP

try this

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

shraddha_g
Partner - Master III
Partner - Master III

Try below in Load Script,

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

arvind_patil
Partner - Specialist III
Partner - Specialist III

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

marcus_sommer
MVP
MVP

You could use:

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

- Marcus

ameensom
Contributor II
Contributor II
Author

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

Thanks a lot