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

Summary on Running Total

Status
Not open for further replies.

mrichey

MIS
Nov 22, 2002
71
US
I have a report that looks like the following:

Server CPU%
serverA 12:00 .48
.51
15 min avg = .49 (these are running total averages)

12:15 .46
.48
15 min avg = .47

serverB 12:00 .52
.48
etc...


I would like to then get an "average" of the 2 running total averages and reset at each new server. I understand there is an issue with the second pass or while printing records. Is there an easy way to accomplish this?
 
Try something like:

@ServerGroup Header :
whileprintingrecords;
numbervar MyTotal := 0;
numbervar TimeGroupCounter := 0;

@TimeGroup Footer (assuming this is the current group level for the RT):
whileprintingrecords;
numbervar MyTotal := MyTotal+{#YourRunningTotal};
numbervar TimeGroupCounter := TimeGroupCounter+1;

@ServerGroup Footer:
whileprintingrecords;
numbervar MyTotal;
numbervar TimeGroupCounter;
MyTotal/TimeGroupCounter

-k



-k
 
be cautious of averages of averages, They are not kosher

eg

Item no cost avg cost

2 $100 $50
1 $25 $25
---- ----- ---
3 $125 $41.67

NOT ($50 + $25)/2 = $37.50 if you take the average of averages

Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top