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

Strange SUM behavior

Hi,

I've got a strange issue where 'sum' function is acting as if there was a distinct command.

Here I've got my individual line items:

issue2.jpg

And here I've got the items grouped under it's product code.
issue1.jpg

You'll notice though that while sum ForecastedDetailActualAmt is correct, sum Disti Cost is wrong and seems to have picked the two distinct/different numbers to add together (31525 + 38768).  As you can see I don't have distinct in my expression.

Any idea what's going on? This is the first I've seen this happen.

Thanks.

Carlo

15 Replies
hic
Former Employee
Former Employee

I think that this is what you have in your data model and that QlikView shows the correct numbers. But to be sure, I need to look at the data model.

See more on Totals in Charts.

HIC

SunilChauhan
Champion
Champion

go to chart properties-> select your expression(Sum([Disti Cost])-> Total Mode-> Sum in drop down

hope this helps

Sunil Chauhan
jagan
Luminary Alumni
Luminary Alumni

Hi,

Can you attach some sample file, so that it would be easier to check.

Regards,

Jagan.

Not applicable
Author

Hi Henric,

Appreciate the help - thanks.  Do you want the qvw file?

Regards,

Carlo

hic
Former Employee
Former Employee

It would help if you post it. I am not sure that I will have time to look at it, but there are plenty of other smart people on this community.

I suspect that you only have the two records in the data, and that one of them appears on two lines in your chart due to one of the dimensions. It is pretty much along the lines of the "many-to-many relationship" described in the blog post. Then the sum is correct the way it is.

HIC

Not applicable
Author

Could you please send the QVW file

Not applicable
Author

Hi All,

Here's the qvw file.

Cheers,

Carlo

Not applicable
Author

I think you missed the attachment

hic
Former Employee
Former Employee

You need to re-think your data model.

HIC

Image1.png