Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sajid_Mahmood
Creator
Creator

How to calculate Null value as 0 in expression while using sum or aggr function

How to check and replace the null values with 0 where the expression results are returning the null values from the aggr(sum) function.

For example: I am trying to calculate if(aggr(sum(sales), customer > 0 and sum(sales, customer <= 0, 'LOST') now here the condition is not getting true since there may be NULL values obtained by the result of this expression. So I would like to replace the null values with zeros so that this condition is always evaluated as true when values are zero or null.

I hope you got my problem. Please advise the solution asap.

Thanks and Regards

Sajid Mahmood

1 Reply
Not applicable

You can use:

If(isnull(value), 0, value)

or

If(isnull(sum(value)), 0, sum(value))