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!

SUM a field from the Details section 1

Status
Not open for further replies.

rwn

Technical User
Dec 14, 2002
420
US
This formula is in the details section.
@EarnedSetup={Job_Operation.Est_Setup_Hrs}*({@sharedWCBurden}-{@sharedEstSum}).

I have a Group Named Department and need to SUM the @EarnedSetup for each Group and have a Report Footer SUM for all the @EarnedSetup.


Thanks
 
When showing formulas, you should show the content of all formulas--even the nested ones. Since your formula names seem to indicate that you are using some shared variables, you would need to use variables in the main report to create these sums:

//{@resetgrp} to be placed in the department group header:
whileprintingrecords;
numbervar grpsumES;
if not inrepeatedgroupheader then
grpsumES := 0;

//{@accumboth} to be placed in the detail section and suppressed:
whileprintingrecords;
numbervar grpsumES := grpsumES + {@EarnedSetup};
numbervar grtotES := grtotES + {@EarnedSetup};

//{@displaygrpsum} to be placed in the group footer:
whileprintingrecords;
numbervar grpsumES;

//{@displaygrtot} to be placed in the report footer:
whileprintingrecords;
numbervar grtotES;

-LB
 
I have changed the formula a bit to reflect a new result. The data to be shown will be Effeciency Percent. For another section of the reports data and the need is to have the average of the @{acumbothEFF}. SO if the Eff showing is 90% 50%, 25%, 80% the average value should be 61.25%. Can these formula be enhanced to do an average value? Thank you!

//{@resetgrpEFF} to be placed in the WORK CENTER Group Header:
whileprintingrecords;numbervar grpsumEff;
if not inrepeatedgroupheader then grpsumEff := 0;

//{@acumbothEFF} Placed JOB Group Header.
whileprintingrecords;numbervar grpsumEff := grpsumEFF + {@RunEff};
numbervar grtotEFF := grtotEFF + {@RunEff};

//@{displaygrpsumEFF}
whileprintingrecords;
numbervar grpsumEFF;

//@{displaygrtotalEFF} Place in Report Footer
whileprintingrecords;
numbervar grtotEFF;

 
I think you mean you want the average of the grpsumEFF, correct? So change the formula in the Work Center group footer to:

//@{displaygrpsumEFF}:
whileprintingrecords;
numbervar grpsumEFF;
numbervar cnt := cnt + 1; //to count the values
grpsumEFF; //for the correct display in this group footer

//{@displayEFF%} for the report footer:
whileprintingrecords;
numbervar grtotEFF; //note that this references the grand total which is equal to the sum of the grpsumEFFs.
numbervar cnt;
grtotEFF/cnt

Click on the % icon in the tool bar to format the last formula.

-LB
 
Sorry but NO. I do need the average of the @{acumbothEFF}. This formula is located in the Group Job, and for each showing of this for a new Job, it needs to show the running average. Now it shows a running total.
 
Same logic then--just don't suppress this formula:

//{@acumbothEFF} Placed JOB Group Header.
whileprintingrecords;
numbervar grpsumEff := grpsumEFF + {@RunEff};
numbervar grtotEFF := grtotEFF + {@RunEff};
numbervar cnt := cnt + 1;
grpsumEFF/cnt;

-LB
 
Thank you.

The averages for the GROUP Jobs is working fine, should I use a formula from above to Average by the Group WORK CENTER for all the Jobs that are being averaged in each Work Center? Then the Grand Total? The Groupings are such.


Work Center
Jobs
 
You also need a reset for the cnt variable, so change your reset formula in WC group header to:

//{@resetgrpEFF} to be placed in the WORK CENTER Group Header:
whileprintingrecords;
numbervar grpsumEff;
numbervar cnt;
if not inrepeatedgroupheader then (
grpsumEff := 0;
cnt := 0
);

Then add a count variable that is not reset to this formula:

//{@acumbothEFF} Placed JOB Group Header.
whileprintingrecords;
numbervar grpsumEff := grpsumEFF + {@RunEff};
numbervar grtotEFF := grtotEFF + {@RunEff};
numbervar cnt := cnt + 1;
numbervar grcnt := grcnt + 1;
grpsumEFF/cnt;

//{@runningavgwkctr} in WkCtr group footer AND in report footer:
whileprintingrecords;
numbervar grtotEFF;
numbervar grcnt;
grtotEFF/grcnt; //for running average

//{@avgperwkcter} in WkCtr group footer;
whileprintingrecords;
numbervar grpsumEFF;
numbervar cnt;
grpsumEFF/cnt;

-LB
 
You are always the ole wise one! Thanks and best wishes.
 
IBass,

I have a question on the last two formula's. {@runningavgwkctr} & {@avgperwkcter} .

You indicated to put {@runningavgwkctr} in WkCtr group footer AND in report footer and {@avgperwkcter} in WkCtr group footer. I don't follow this and when is the Grand Avg for the Report Foooter being calculated? I appologize for not maybe seeing the obvious.
 
Since it is a display formula for a running average, it will show the correct value in both the work center and report footer.

The {@avgperwkcter} is not a running average, but the average for the particular work center.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top