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

Average Calls for a day of week

Status
Not open for further replies.

kskid

Technical User
Mar 21, 2003
1,767
US
I am relatively new to Crystal Report (using 8.5).

I want to calculate the average number of calls received for each day of the week (i.e. Sun, Mon, Tue, etc) within a month. Selecting the records within the month is easy enough using LastFullMonth and DayofWeek({Calldate}) for the day of week.

Group 1 by day of week and group 2 by date with subtotals at each group

That's as far as I can go. Not sure what I have to do to get the averages for each day of the week.

By the way, the help mentioned the SummaryFunction but I could not find it in the Formula Editor.

 
You don't need the second group. Count the Calls for that day of week, and then Distinct Count the Dates in that group. Divide Calls by Dates and you have your average. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
A crosstab easily handles this.

Create a formula with dayofweek({table.date})

Insert a crosstab in the report header or report footer and place the formula in the Columns section, and the amount in the Summarized Fields.

Select Change Summary and select Average.

Crystal will handle the rest for you.

-k
 
SV - I almost went there, but it doesn't sound like he has a numeric field to average. He is counting the reocrds for each date, and then trying to averagle all of the counts for dates on Monday, Tuesday, etc. In other words, I think he is trying to summarize a summary field. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
That worked great. And yes, I was summarizing a summary field.

Thank you very much....

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top