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

count average in footer fields.

Status
Not open for further replies.

DanHD

Technical User
Dec 1, 2008
98
NL
hello

I've a report for the helpdesk. It's printing the the database fields: call id's, startdate and enddate, also the formulafield 'days total', this is the enddate - startdate in days. I use only a customergroup.
The calls can have different status. Because the log files of the calls in the database structure, it is necessary to put this fields in the footer of the group to get the MAX(changid), see thread767-1616747. There is also a filter on the status.
Now I need by each group the average of the formule field 'days total'. I can't do this with the function summary or running totals, because they als count the 'hidden' fields.
How can I tackle this issue?


I've group the calls on the customer and it all works.I created also a formule which count the days that a call is open, something like (start day - current day).All those fields are placed in the footer and, and because the different select statements, a lot aff field are not shown.Now I need to now the average of open days. I've tried running totals and the summary functions, but it seems to me that each time also the 'hidden' fiels are used in the formula. Of course I only want to now the avarege from the values which are printed in the report. How can I do this?

Dan
 
If you are getting the correct result for your days open formula in the group footer, then you can use variables like this to calculate the average:

//{@accum} to be placed in the group section containing the {@daysopen} formula:
whileprintingrecords;
numbervar cnt := cnt + 1;
numbervar days := days + {@daysopen};

In the report footer, use this formula to get the average:
whileprintingrecords;
numbervar cnt;
numbervar days;
days/cnt

-LB
 
hi LB,

thanks so far, but if one call isn't solved yet, then on that record the value for @daysopen is 0 (system print ‘Standard format’, I’ve suppressed this field).
Actually in the numbervar cnt := cnt + 1; there must be something like an excluding if the value is 0.


Dan
 
You are placing the formula in the group section, NOT in the detail section, right?

If you want to exclude records that are not yet closed, then do that in the selection formula:

not isnull({call.enddate})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top