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!

Capture a Value

Status
Not open for further replies.

deeya

MIS
Sep 18, 2006
78
GB
CR10 MYSQL

Group1 Host Name
Group2 Counter Name
Group3 Trend Date
11/02/2007 45,884
10/02/2007 45,909
09/02/2007 46,408
08/02/2007 45,872
07/02/2007 23,000
06/02/2007 25,548

What I want to do is capture the most recent value(45,884) and use it later in a formula. How would I do that? Maximum?

Thanks

 
The data is sorted ascending by date, so create a formula in the Group Header of:

whileprintingrecords;
numbervar MaxDateValue:={table.value}

Now you can use that variable later in a formula.

Rather than say you want to capture something and use it, why not state specifically what you need to ultimately do?

-k
 
synapsevampire your right im going round in circles so im going to try and explain what I want doing because my head hurts now!

CR10 MYSQL
Parameters = Trend Date and Server Capacity(default 90 days)

Group1 Host Name
Group2 Counter Name (ie. C drive, D drive)
<GRAPH> plotting date and space
Group3 Trend Date
Date Space DiskSpaceDiff Count
11/02/2007 45,884 0 0
10/02/2007 45,909 25 1
09/02/2007 46,408 499 1
08/02/2007 45,872 0 0
07/02/2007 23,921 0 0
06/02/2007 25,967 46 1
05/02/2007 24,206 239 1
04/02/2007 23,605 0 0
03/02/2007 24,108 503 1
02/02/2007 25,058 950 1
01/02/2007 25,345 287 1
DiskSpaceDiff =
whileprintingrecords;
numbervar DiskTotal;
numbervar CurrValue:=0;
If {trendcounters.counter_name}={trendcounters.counter_name}
and {trendsday.value_avg} - Previous({trendsday.value_avg})
> 0 then
CurrValue:={trendsday.value_avg} - Previous({trendsday.value_avg});
DiskTotal:=DiskTotal+CurrValue;
CurrValue

Count = whileprintingrecords;
numbervar CountTotal;
numbervar CountValue:=0;

CountValue:=
If {@DiskSpace} > 0 then 1 else 0;
CountTotal:=CountTotal+CountValue;
CountValue

What i then need to do is:
most recent diskspace value (45,884)/ (total of DiskSpaceDiff / total of count) = the result would give me number of days the diskspace will reach capacity.

45,884/(2549/7) = 126 days

So finally the report will only show the graph/result where the number of days is lower than the parameter value [server capacity]

Hope this explains it.....I havent used variables before so im very confused at the moment! Hopefully you will understand what i want to do, If not please ask me what info you need me to add.
 
If it can't be easily done with variables, get the value again using a subreport. Subreports waste machine time, but that's getting cheaper all the time.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Madawc, synapsevampire,

Can you explain the method I still dont understand?

Thanks
 
I still dont understand?

Which bits? Crystal can usually be developed by getting one bit right and working towards the answer. Display the variable fields and see what's actually in them.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top