ashrobo Posted June 6, 2003 Posted June 6, 2003 i've generated a running total (DeliveryQty) for my report but i cant get it to display the way i wanted it to. DeliveryQty = Sum of Quantity of the same item with different PONo here is the pic of the report that i currently have now.. columns: ItemNo LotNo PartNo PONo Quantity DeliveryQty http://lyfe.dysorder.org/work/report.gif for the first row of Item 1, the DeliveryQty (the rightmost row) should display just 20,000, instead of 18,000 and 20,000. this is what i've designed to get the above image, after reading the MSDN.. http://lyfe.dysorder.org/work/report%20design%20copy.gif all help will be appreciated! -ashrobo p/s: hope the pictures are useful.. Quote
hog Posted June 6, 2003 Posted June 6, 2003 What you need to do is create a formula like so: global dblTotal as double dblTotal = dblTotal + {YourTableNmae. DeliveryQty} formula=dblTotal Then place this field on your report instead of the DeliveryQty one Quote My website
ashrobo Posted June 6, 2003 Author Posted June 6, 2003 thanks hog, i'll try that soon (after i clear the mysterious bug that i had introduced when messing around the report) :) Quote
ashrobo Posted June 6, 2003 Author Posted June 6, 2003 (edited) What you need to do is create a formula like so: global dblTotal as double dblTotal = dblTotal + {YourTableNmae. DeliveryQty} formula=dblTotal Then place this field on your report instead of the DeliveryQty one this doesn't work, what i got to achieve is to put the total quantity on the first line of the items. for eg. ItemNo PONo Quantity DeliveryQty 1 X123 1,000 3,000 X345 2,000 Edited June 6, 2003 by ashrobo Quote
hog Posted June 6, 2003 Posted June 6, 2003 Just looking back at your original post, it would appear that although you want to sum the delivery qty you have a grouping by item number, which will bring back two records for item 1 with two different po numbers. Remove the po field from your query as this info is not required as you are only interested in the delivery qtys. *********** Forget that, just got out of bed and read your post again...doh The formula way should work fine for what you want to achieve with a running total Quote My website
ashrobo Posted June 9, 2003 Author Posted June 9, 2003 Just looking back at your original post, it would appear that although you want to sum the delivery qty you have a grouping by item number, which will bring back two records for item 1 with two different po numbers. yes, this is what i want to do. Remove the po field from your query as this info is not required as you are only interested in the delivery qtys. *forgetting about the above* The formula way should work fine for what you want to achieve with a running total what i want to do is to get a total for the individual items with different po numbers. -ashrobo Quote
hog Posted June 9, 2003 Posted June 9, 2003 Yes I understand you. OK if you have two rows returned for example and you want to see a running total then the formula field approach I mentioned earlier will work. Quote My website
ashrobo Posted June 10, 2003 Author Posted June 10, 2003 the formula field approach gives me the running total without any resetting for different items. or did i use the wrong word "running total" here? it's just the total for individual items.. Quote
hog Posted June 10, 2003 Posted June 10, 2003 OK, if you want the 'running total' to be specific to each new item group include another global variable in the formula to store the previous items id. On the next call check that the item ids still match, if they don't reset the dblValue to 0 to start a new running total. Quote My website
ashrobo Posted June 10, 2003 Author Posted June 10, 2003 OK, if you want the 'running total' to be specific to each new item group include another global variable in the formula to store the previous items id. On the next call check that the item ids still match, if they don't reset the dblValue to 0 to start a new running total. that's what i thought of too, but i dont know how to store the previous item id and thought it might not even be possible in CR. any clues? million thanks.. :) -ashrobo Quote
hog Posted June 10, 2003 Posted June 10, 2003 Try this: Global dblTotal As Double Global intPreviousID as Number If intPreviousID <> {YourTableNmae. itemID} Then intPreviousID = {YourTableNmae. itemID} dblTotal = 0 Else dblTotal = dblTotal + {YourTableNmae. DeliveryQty} End If formula=dblTotal Quote My website
ashrobo Posted June 11, 2003 Author Posted June 11, 2003 solved thanks hog for your time! i've managed to solve this problem.. here's the solution.. http://www.tek-tips.com/viewthread.cfm?SQID=571744&SPID=767&page=1 -ashrobo Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.