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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Luis
Partner - Contributor
Partner - Contributor

Sum( Null() )= 0 when it should be Null()

Hi,

Qlik when it makes a sum of null values it puts zero (0) when I suposse it should show null.

I need to show when the sum is 0 show 0 and when all values are null show null() (-). 

It works multiplying and dividing by the count, but I hope there is a better way.

Example:

A= Null ()

Sum( A )=0

Sum (A) * Count( A) / Count (A)= Null()

Any better way? 

Thanks

 

 

Labels (1)
1 Reply
H_Julian
Contributor III
Contributor III

There are a few things you could do like:

You could put it within an if statement:

if (A=Null(),Null(),sum(A))

 

I personally prefer replacing Null Values with a string like '#' within the Script Editor

This way this problem won't even appear:

if (A=Null(),'#',A) as A

 

Greetings