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

Performing a calculation on a variable field

Status
Not open for further replies.

Andyherm

Technical User
Nov 29, 2006
25
GB
Hi,
I've been setting up a report which calculates time to resolve against trouble tickets which can be resolved either by going from open to comp status or open to wait.
I've been experimenting with running totals/variable fields and have managed to get a sum of all the resolve times for each ticket in a given date range using a variable field and I now need to divide this by the ammount of tickets for the average resolve time for that date range but using a formula {sum field} / DistinctCount ({SCCall.Call_Num}, {SCCall.Call_CalT_Code}) returns a value of 0.00.
I have confirmed that the value in the sum variable field is correct but how can I run calculations against this value to find the average?
(SCCall.Call_CalT_Code is part of the distinct count as I am only sampling one type of call).
 
You can rule out {SCCall.Call_CalT_Code}) , because if it were zero the formula would have the divided by zero error.

Post the actual formulas involved, not pseudo code...

Anyway, you can also keep track of a distinctcount manually if need be, you don't even stat what section your're attempting to do thisin, one would assume a group footer of {SCCall.Call_CalT_Code}???

-k
 
I've managed to get the desired result, problem was I was trying to display the average in the group header for {SCCall.Call_CalT_Code} instead of the group footer where the sum variable field was located. After moving the average field all works fine.
I'm using 5 formula fields to get this,
1 (TimeOpenDays) -
{SCFSR.FSR_Complete_Date} - {SCCall.Call_Indate}
2 (TimeOpenHours) -
TimeOpenDays} * 24
Both fields are in the details section, as a move to wait status will always come before comp I then have a min of @TimeOpenHours field in the group header {SCCall.Call_Num} to display the time to resolve figure.
I'm then using 3 variable fields,
1 (Formula1) is in {SCCall.Call_CalT_Code} Group Header
WhilePrintingRecords;
NumberVar RunningTotal;
RunningTotal :=0
2 (Formula2) - is in {SCCall.Call_Num} Group Header
WhilePrintingRecords;
NumberVar RunningTotal;
RunningTotal := RunningTotal + Minimum ({@TimeOpenHours}, {SCCall.Call_Num})
3 (Formula3) - is in {SCCall.Call_CalT_Code} Group Footer
WhilePrintingRecords;
NumberVar RunningTotal;
RunningTotal;

The average time field is now in the {SCCall.Call_CalT_Code} Group Footer
{@Formula3} / DistinctCount ({SCCall.Call_Num, {SCCall.Call_CalT_Code}).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top