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!

Daily average of count grouped by month

Status
Not open for further replies.

Plecebo

Technical User
Jul 15, 2008
4
US
I am trying to figure out the best way to display the daily average of a count by month.

Here is what the data looks like
Date(date),Location(string),UnitID(string)
2011-12-1,A,123
2011-12-1,A,456
2011-12-1,B,789
2011-12-1,B,246
2011-12-2,A,135
2011-12-2,A,123
2011-12-2,B,789
2011-12-2,B,468
...

We would like a report showing the following:
(location) 12/2011 1/2012 2/2012 (by month)
A 12.5 10.3 14.0
B 22.1 20.9 25.6

The summary fields should be calculated following this general idea for each month/location combination:
Avg(Count(UnitID))/(days in month)

The Avg(Count(UnitID)) is the tough part. A cross tab would work best, but anything at this point will work.

Any help is greatly appreciated.
 
Just what's the question? What is it you are having difficulty with?

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
If averages are the problem, Crystal will do them for you using Runtime. You could write a formula field for the number of days in each particular month, allowing for leap years.

If you're not already familiar with Crystal's automated totals, see FAQ767-6524.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top