Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
vireshkolagimat
Creator III
Creator III

Qty getting doubled while calculating sum

Dear All,

I'm calculating sum of qty sold as one exp and sum of qty sold multiplied by packsize in another exp.

But the first exp works fine but second one is not showing the correct values.

I tried to use the distinct in the second exp but still facing issues.

Regards,

Viresh

 Packsize issue.PNG

2 Solutions

Accepted Solutions
rubenmarin

Hi, as Packsize is a dimension and will have only one value you can try with "Packsize*Sum(SalesQty)" or "Packsize*Column(1)"

View solution in original post

rubenmarin

Hi, total fails because of having difrferent values for Packsize, you can set the expression as:
Sum(Aggr(Sum(SalesQty)*Packsize, ProductCode, ItemCode, Packsize))

Or just:
Sum(Aggr(Sum(SalesQty)*Packsize, Packsize)) //does the operation for each Packsize and sums all generated values

View solution in original post

6 Replies
shiveshsingh
Master
Master

If you remove item code dimension, then what is the result?

rubenmarin

Hi, as Packsize is a dimension and will have only one value you can try with "Packsize*Sum(SalesQty)" or "Packsize*Column(1)"
vireshkolagimat
Creator III
Creator III
Author

Hi, i think it works fine but can't show the total even though I've enabled show partial sum option in the presentation tab.

Packsize issue2.PNG

Thank you.

vireshkolagimat
Creator III
Creator III
Author

Hi, i tried but no changes. Thank you.

rubenmarin

Hi, total fails because of having difrferent values for Packsize, you can set the expression as:
Sum(Aggr(Sum(SalesQty)*Packsize, ProductCode, ItemCode, Packsize))

Or just:
Sum(Aggr(Sum(SalesQty)*Packsize, Packsize)) //does the operation for each Packsize and sums all generated values
vireshkolagimat
Creator III
Creator III
Author

Hi, I was able to fix it and used the same logic. Thank you.