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!

Adding formula results in a group 1

Status
Not open for further replies.

sdzlkds

Technical User
Oct 20, 2005
41
0
0
GB
I'd be grateful for some help. I am using Crystal XI

I am looking to add the results of a formula at Group 2 level together so that I get a total at Group 1 level

The report is set up as follows and I want to add the results of Formula 1 together to give the total $1377.50 at Group 1 level

[Group 1] Project 1A

[Group 2] Rate

Rate FTE Equivilant Cost Formula 1
1a 0.5 $255 $127.50
1b 2.5 $500 $1250.00

Cost of project = $1377.50


Formula 1 is if Cost = 0 then 0 else
Sum (FTE Equivalent}, Rate)*
Maximum (Cost, Rate)


The end result I am after is

Project 1A = $1377.50
Project 1B = $222.50
Project 2A = $2500.00

etc

Thanks


 
I'm not sure if this will work, but it's worth a shot.

1. Create a new formula, I'll call it RateCost: Maximum(Cost, Rate)

2. Create a running total, I'll call it TotalRateCost:
Field to summarize: {@RateCost}
Type of summary: Sum
Evaluate: On change of Group2
Reset: On change of Group 1

3. Create a new formula:
sum({FTE Equivalent}, {Project}) * {#TotalRateCost}

Use this formula in the group footer for Group 1 (because of the running total, it won't work in the group header.)

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Thanks for responding. Unfortunately the Running Total won't let me select a formula under field to summarise...
 
Try creating a running total for the max of the cost. Then see if it will allow you to use another running total to sum that one.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
You can use a variable to do this:

//{@Reset} place in the Group #1 header then suppress:
whileprintingrecords;
numbervar sumx;
if not inrepeatedgroupheader then
sumx := 0;

//{@accum} place in the Group #2 section (header or footer) then suppress:
whileprintingrecords;
numbervar sumx := sumx + {@Formula1};

//{@result} for the Group #1 footer:
whileprintingrecords;
numbervar sumx;

Suppress the details, group #2 sections, and the group #1 header and drag the group #1 header into the group #1 footer.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top