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

Formula help

Status
Not open for further replies.

deeya

MIS
Sep 18, 2006
78
GB
CR10 MySQL

Guys hope you can help.

I have a field [DiskSpace] which calculates the difference in Diskspace on a Day by Day basis excluding increases. What i want to do is add the totals up....

The groups are:
Server Group
Disk Space Group C, D etc

Day Space [Disk Space]
01/02/2007 45,872
02/02/2007 23,921 0
03/02/2007 23,967 46
04/02/2007 24,206 239
05/02/2007 23,605 0
06/02/2007 24,108 503
07/02/2007 25,058 950

[DiskSpace] =
If {trendcounters.counter_name}={trendcounters.counter_name}
and {trendsday.value_avg} - Previous({trendsday.value_avg})
> 0 then {trendsday.value_avg} - Previous({trendsday.value_avg})

Thanks
 
Try:

whileprintingrecords;
numbervar Mytotal;
numbervar CurrValue:=0;
If {trendcounters.counter_name}={trendcounters.counter_name}
and {trendsday.value_avg} - Previous({trendsday.value_avg})
> 0 then
CurrCalue:={trendsday.value_avg} - Previous({trendsday.value_avg});
MyTotal:=MyTotal+CurrValue;
CurrValue

Now later you can display the total in the report fotter using:

whileprintingrecords;
numbervar Mytotal

-k
 
synapsevampire, all,

One more question...

How would I go about reseting the variable value, so I only sum the total [Disk Space] by server/disk drive?at the moment im getting a running total....

Thanks!
 
Place this formula in the group header:

whileprintingrecords;
numbervar Mytotal;
if not inrepeatedgroupheader then
Mytotal := 0;

The display formula belongs in the group footer, of course.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top