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

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cancell Doubling using sum

Hey everyone,

q.JPG

When I try to do sum(average*cost) it's doubling by the number of the number of the warehouses.

I tried to divide by the number of the warehouses [sum(average*cost)/count(warehouses)] but then I have a problem in the total.

q2.JPG

Cant figure out how to solve this

Regards,

Maayan

Labels (1)
4 Replies
sunny_talwar
MVP
MVP

I am not sure I understand the number you are looking to get? May be if you can share a sample with expected output, one of us can help you out.

QlikCommunity Tip: How to get answers to your post?‌

Preparing examples for Upload - Reduction and Data Scrambling

Uploading a Sample

Not applicable
Author

I looking for way to double the "avg use" with the cost and finally see the total.

Now when I try to do this with sum it's double with the number of the warehouses.

q.JPG

In the image you can see that the average*cost is 69151 and it need to be 34575 (half).

This happens because that the serial is in 2 warehouses

Now it is more understandable?

idogridish2
Creator III
Creator III

Hi Maayan,

ma shlomeh?

maybe you can try avg([use average])*avg(cost)

hope it helped.

swuehl
Champion III
Champion III

Or maybe

=Sum(Aggr( sum(average*cost) / count(warehouses), Serial))

edit:

Or maybe using a different outer aggregation...

I assume your issue is caused by the way your data model is built, but that's hard to tell without knowing it.