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

summary on a formula 1

Status
Not open for further replies.

psimon1

Technical User
Mar 18, 2003
55
0
0
US
Hello

I am running CRXI and want to know how to do this. There has to be a way.

I am trying to create a report to determine projected earnings for employees and departments.

I have a formula derived on an employee grouping called Projected Earnings.

I have another grouping for departments. To me, this sounds like a pretty simple sum function.

However, when I attempt Sum ($({@projearnings})), I get an error msg: "field is required here." It must be me; there has to be a way to do this.

Anyone?

Thanks.



 
YOu can not perform a summary on a formula containing a summary.

YOu will have to use a variable eg

@Total

Whileprintingrecords;

global numbervar total:=Total + (your sum formula)

Place this in the group footer where summary is evaluated and suppress it (becomes invisible)

In report footer place another formula
@display total
Whileprintingrecords;

global numbervar total

If this is a group summary you will need to reset in relevant group header, and place above formula in relevant group footer

@Reset total
Whileprintingrecords;

global numbervar total:=0

Ian

 
Thank you for the response, Ian.

I got this to work except for the "group summary.' You are correct; I am doing a per department summary.

Under "Change Group Options", do I need to use a formula as group sort order?

 
if you want a dept summary then just place the display formula in dept group footer
and reset formula in Dept group header

@Reset total
Whileprintingrecords;

global numbervar total:=0

If you want to show an overall total in report footer you will need two variables, just change evaluate formula to generate Grand total

@Total

Whileprintingrecords;

global numbervar total:=Total + (your sum formula);
global numbervar Gtotal:=GTotal + (your sum formula);

This one does not need to be reset, create another display formula, and place in report footer.

@display Gtotal
Whileprintingrecords;

global numbervar Gtotal

Ian

 
I am missing something.

My display total in group footer #1 for department isn't totalling all of the individual employees' projected earnings. It seems to be taking the max.

employee proj_earnings
1 10
2 20
3 30

total 30

I put the 'reset' formula in the department header.

Thank you again. You are obviously extremely knowledgeable.

ps
 
Have you placed the reset in the right group header. Sounds like you have placed it in the employee header.

Ian
 
Yes, it's in the group #1 header (for department).
 
I have the 'reset' formula that you mentioned earlier in the employee header.

Which is the evaluate formula? Which formula should I have in the employee header?
 
The 'reset' formula should be in the Department header.

The evaluate formula, is the formala I called @total and this should be in the employee footer.

Ian

 
psimon1,

Please don't double post. I just responded to your other post, and I wouldn't have taken the time had I seen this one.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top