Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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)
  • zero

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