Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Something is weird by suing SUM in straight table

Hi Expert,

I have an example which give me weird result. I am using straight table for multiple fields of 9. I use Sum(F1+f2+f3+f4+f5+f6+f7+f8+f9) for grand total. I tried to create an example on excel and it is fine. But QlikView give me wrong result for this example. I attached the example App. I don't know what's wrong.

Any suggestion is greatly appreciated!

Weidong

1 Solution

Accepted Solutions
rubenmarin

I used this expression and result is ok:

num(Sum([/BIC/ZCRDHLDAM]) + Sum([/BIC/ZDLVBLKAM]) + Sum ([/BIC/ZPDUALCAM]) + Sum([/BIC/ZPDALCAM]) + Sum([/BIC/ZCUROPNAM]) + Sum([/BIC/ZNXTPRDAM]) + Sum([/BIC/ZFUTPRDAM]) + Sum([/BIC/ZNOTGIAM]) + Sum([/BIC/ZNOTINVAM]), '#,##0.##', '.' , ',' )

I copied the sum's from expression, the 2nd field ([/BIC/ZDLVBLKAM]) wasn't in the original expression.

View solution in original post

4 Replies
swuehl
MVP
MVP

If any of the fields can be NULL, and you want to just assume a zero value instead for these records, use something like

Sum(Rangesum(F1,f2,f3,f4,f5,f6,f7,f8,f9))

swuehl
MVP
MVP

No, I think you are just not using the same fields in your grand total aggregation, for example

ZNXTPRDAM is used twice.

rubenmarin

I used this expression and result is ok:

num(Sum([/BIC/ZCRDHLDAM]) + Sum([/BIC/ZDLVBLKAM]) + Sum ([/BIC/ZPDUALCAM]) + Sum([/BIC/ZPDALCAM]) + Sum([/BIC/ZCUROPNAM]) + Sum([/BIC/ZNXTPRDAM]) + Sum([/BIC/ZFUTPRDAM]) + Sum([/BIC/ZNOTGIAM]) + Sum([/BIC/ZNOTINVAM]), '#,##0.##', '.' , ',' )

I copied the sum's from expression, the 2nd field ([/BIC/ZDLVBLKAM]) wasn't in the original expression.

Not applicable
Author

Thanks for all! My bad and I haven't looked the fields name.