
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Summation error
Hello,
I have a calculated field in a grid that works fine, taking a value X and multiplying it by the value Y to give Z.
X is pulled from a part's record representing an amount of explosive per KG, Y is the qty (in KG) of a part in stock. Z = the total explosive amount for the part.
On a grid showing all the parts, quantities, the warehouse codes etc. the calculation works fine:
=round(NEQPerItemKG*sum(OnhandQty), .00001)
But if I have a similiar grid, but take out the part/qty etc, in order to see totals by warehouse, the calculation doesn't work.
Screen shots attached. Any help appreciated.
Thanks.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks both for your replies.
I'd just added a copy of the app when the second reply came in - and this works perfectly.
I really need to get my head round the set analysis...... I think this says 'do this calculation on the whole dataset, irrespective of any selections that have been made on these 5 fields', am I right?
Thank you.
Stephen

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
More explanation needed where the calculation is failing.
What formula are you using and what's the expected output?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this
Sum(Aggr(Round(NEQPerItemKG*sum(OnhandQty), .00001), Code, Warehouse, PartNum, Description, LotNum))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks both for your replies.
I'd just added a copy of the app when the second reply came in - and this works perfectly.
I really need to get my head round the set analysis...... I think this says 'do this calculation on the whole dataset, irrespective of any selections that have been made on these 5 fields', am I right?
Thank you.
Stephen

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The syntax that I provided isn't called set analysis.... it is just a way to get total from a more granular level dimensions... So within the Aggr() function, it will created a imaginary table and perform all the calculations at that level and then sum them up just like the table you have below in the snapshot. All selections will be honored, so no need to worry on that front

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great, thanks for your help. I appeciate it.
Regards,
Stephen
Extension : 7060
Telephone : +44 1294 487060

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yup, no problem
Please close this thread if everything is working for you...
Qlik Community Tip: Marking Replies as Correct or Helpful
Best,
Sunny

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great, thanks for your help. I appeciate it.
Regards,
Stephen
Extension : 7060
Telephone : +44 1294 487060
