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!

Sum Formula

Status
Not open for further replies.

Joelcc

Programmer
Feb 9, 2005
6
US
Hello All,

I have three formulas:

Formula1: Average({Score}, {Group1})
Formula2: IF({@Formual1}>7)Then 1 Else 0
Formula3: Sum({@Formula2}, {Group2})

Formula3 is giving me "The Summary / Running Total field could not be created".

When I browse Formula2 Field Type is "Number"


 
That's because formula2 already contains a summary. Use variables instead to create the sum. I'm guessing that you have your group numbers backwards, and then you are actually trying to sum the averages of Group#2 at the Group#1 level.

Create three formulas:

//{@reset} to be placed in your group#1 header:
whileprintingrecords;
numbervar sumave := 0;

//{@accum} to be placed in the group#2 header or footer:
whileprintingrecords;
numbervar sumave := sumave + {@formula2};

//{@display} to be placed in the group#1 footer:
whileprintingrecords;
numbervar sumave;

-LB

 
I'm actually trying to calculate a Success Ratio on the Average Score.

So I want to count how many scores are greater than 7 under neath a group and divide it by the total number of scores in that group.
 
This should be easy to do,but I don't understand your report structure. Please provide some names for your groups and provide some sample data that demonstrates your report layout and where you want these summaries.

-LB
 
Group1:Supervisor
Group2:Employee

Group1:John Smith SSR?

Group2:Larry John 9.38
Mary Sue 7.58
Joe Smith 5.00

The Success Ratio for John Smith the Supervisor for Score of 7 or greater is 66.66%. Two out of the three Employees had => Score of 7.

I appreciate the help


 
Change the {@display} formula to:

//{@display} to be placed in the group#1 footer:
whileprintingrecords;
numbervar sumave;

sumave % distinctcount({table.employee},{table.supervisor})

This must be placed in the supervisor group footer. If you really must have it in the group header, then you will need to do the calculations as above in a subreport linked to the main report on {table.supervisor}, which you then place in the group (supervisor) header, with all but the group footer suppressed.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top