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

Cannot sum a field calculated off a summary total 3

Status
Not open for further replies.

tonykblen

Programmer
Mar 25, 2003
88
IE
Hi,

I am tryiing to create a report that calculates a weighting based on the following formula:

Order Produced Quantity / Overall Machine Qty

I then want to take this and multiply it by a yield percentage. I have been able to do this but cannot total up either column. From reading other posts it seems be that I cannot sum up a field which is calculated with another summary function. How do I work around this problem?

Many thanks,

Tony.

Tony Kennedy BSc. B.I.S.,
MCSA Cand.

A good start is half the work.
Every start is difficult .
-Two Gaelic proverbs
 
Forgot to put the formulae in:

In a formula called @Weighting
{mfgorder.mor_producedqty}/Sum ({mfgorder.mor_producedqty}, {itemspec.its_route}) - This give the weighting calculation for each manufacturing order.

This gives me a correct basis to calculate the yield

{@FillSize}*{@Weighting}


Tony Kennedy BSc. B.I.S.,
MCSA Cand.

A good start is half the work.
Every start is difficult .
-Two Gaelic proverbs
 
You would use the three-formula method.

//{@reset} for the group header (if you are summing at the its_route group level or other group level--if you are summing at the report level, you don't need this formula):
whileprintingrecords;
numbervar yield := 0;

//{@sumyield} to be placed in the detail section:
whileprintingrecords;
numbervar yield := yield + ({@fillsize}*{@weighting}); //or substitute your formula containing summary functions here inside the parens

//{@displyield} to be placed in the group (or report) footer:
whileprintingrecords;
numbervar yield;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top