Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables vs running totals in Crystal 8.5

Status
Not open for further replies.

jchewsmith

Technical User
Nov 20, 2006
161
US
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?











 
Please do not start multiple threads on the same topic.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top