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

Calculate a Shared Variable by Group 1

Status
Not open for further replies.

rwn

Technical User
Dec 14, 2002
420
US
I'm sharing a variable from a sub report to the main report.
This variable then is used to determine the Jobs Work Center %Variance (called @%Variance).

Report is GROUP first by Work Center and then by Jobs.

I need to do a sum of this @%Variance for the Grouping of Work Center, so I know the sum %Variance for that Work Center for all the jobs that are included in that work center.

Thanks for any advise!
 
If you simply want to sum the results, create a formula and place it in the jobs group section:

whileprintingrecords;
numbervar sumx := sumx + {@varianceformula};

Then in the workcenter group footer, use:

whileprintingrecords;
numbervar sumx;

Add a reset formula in teh workcenter group header:
whileprintingrecords;
numbervar sumx;
if not inrepeatedgroupheader then
sumx := 0;

-LB
 
The @varianceformula is in a GF section. I tried the above but the result is then number zero.
 
I think you have misplaced the formulas then. The reset goes in the workcenter group header, the variance formula goes in the Group footer for Job, and the display formula goes in the workcenter footer. This assumes that workcenter is Group #1, and Job is Group #2.

-LB
 
Yes, I needed to put the reset in the right grouping. thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top