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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totalling formula fields

Status
Not open for further replies.

jchewsmith

Technical User
Nov 20, 2006
161
US
I am updating the post I just submitted. I use the following do while to get a rcptqty result, then I use that * a sell price to get a sell price per item. I want to get a grand total for all item sell prices.

global numbervar newitems;
global numberVar items;
global numbervar remain;
WhilePrintingRecords;
If {SS_MFGRcptbyJob.MRJobRcptQty} > items then remain:= items
else if {SS_MFGRcptbyJob.MRJobRcptQty} <= items then remain:={SS_MFGRcptbyJob.MRJobRcptQty};
items:=items-remain;
newitems:=remain;
 
It is not entirely clear from either of your posts exactly what you are doing here, but to achieve a sum of your {@Sell Price} formula you could use a variable to accumulate the results of your Sell Price calculation.

Amend your existing {@Sell Price} formula as follows:

Code:
WhilePrintingRecords;
Local Numbervar Price := [[i]your existing calculation[/i]];
GlobalNumberVar Total := Total + Price;
Price;

Then, to display the Sum of {@Sell Price}, create the following formula:

Code:
WhilePrintingRecords;
GlobalNumberVar Total;

Depending on your report structure (groupng etc), you may need to reset the Total variable.

Hope this helps

Cheers
Pete
 
And of course, in both pieces of code above, "GlobalNumberVar Total" should be replaced by "Global NumberVar Total".

Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top