jchewsmith
Technical User
I am trying to find a way to calculate a declining total on a report. It is an inventory report that is grouped by inventory item and each item can have several receipt dates and quantities, but only one quantity on hand (QOH) for each item.
The following item has a QOH of 7,000
Item # Receipt Date: Receipt Quantity Remaining (This field is to be calculated)
1234 8/1/2012 6,000 6,000
1234 7/5/2011 13,200 1,000
1234 6/15/2010 3,060 0
Item Total QOH 7,000
I have tried this formula in the group header:
whileprintingrecords;
global numbervar items:={SSRpt_InventoryAvail.QOH}
and this formula in the detail section:
WhilePrintingRecords;
global numberVar items;
global numbervar remain;
If {SS_MFGRcptbyJob.MRJobRcptQty} > items then remain:= items
else remain:={SS_MFGRcptbyJob.MRJobRcptQty};
items:=items-remain;
But this is only giving me the remaining as it each receipt had a quantity on hand of 7,000.
Any ideas on what I am doing wrong?
The following item has a QOH of 7,000
Item # Receipt Date: Receipt Quantity Remaining (This field is to be calculated)
1234 8/1/2012 6,000 6,000
1234 7/5/2011 13,200 1,000
1234 6/15/2010 3,060 0
Item Total QOH 7,000
I have tried this formula in the group header:
whileprintingrecords;
global numbervar items:={SSRpt_InventoryAvail.QOH}
and this formula in the detail section:
WhilePrintingRecords;
global numberVar items;
global numbervar remain;
If {SS_MFGRcptbyJob.MRJobRcptQty} > items then remain:= items
else remain:={SS_MFGRcptbyJob.MRJobRcptQty};
items:=items-remain;
But this is only giving me the remaining as it each receipt had a quantity on hand of 7,000.
Any ideas on what I am doing wrong?