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

Average in Groups???

Status
Not open for further replies.

jazerr

Programmer
Dec 13, 2000
152
US
CR8, Win2k, SQL Server 2k

I have a subreport with 2 groups. Essentially the data is this:

Topic 1 (group header 1)
Goal 1 (group header 2)
Objective 1.1 Progress = 5% (details)
Objective 1.2 Progress = 15%

Topic 2
Goal 2
Objective 2.1 Progress = 10%
Objective 2.2 Progress = 20%
Objective 2.3 Progress = 25%

I need to average the Progress fields, which is easy enough. The problem I am having is when I try to place the Average field in the Group 2 Header, it screws up the calculation...

I have chalked it up to the idea that the report is trying to average a seemingly different data set.

Any ideas???
 
Is the average field a formula or an automatic summary?

If a formula, post the formula. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
I tried both of these...

Average(MySP.Progress, Group2)

And

Sum(MySP.Progress, Group2)/
Count(MySP.Progress, Group2)


These both return the correct value if I place them in the Group 2 footer. Like I said before, I need them in the Group 2 header.

I also tried placing the formula in the footer, then making another field that retrieves the value of the calculation, but it behaves the same way as the actual formula.
 
What version of Seagate Crash Reports are you working with? Malcolm
 
This is odd. These formulas should both give identical results in either the header or footer of group 2. These formulas are not relative to where they are placed. Are you absolutely sure that you are moving from the footer to the header of the same group?

Can you cut and paste the ACTUAL formula, rather than a paraphrase? I want to make sure you aren't sneaking in any variables.

And, all of this is happening in the subreport, not when you try to bring the values back to the main report? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top