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

average of a count

Status
Not open for further replies.

rmcguire80

IS-IT--Management
May 31, 2012
106
US
Hello,

I have a number of shipments and trying to get a count of the number of shipments, so

do a count of the SHIPMENTS.RECNO then get an average of the number of shipments based a specific number of days in a date range in this case the entry date range

thanks
 
In report footer create formula

@AvgCount
Count( SHIPMENTS.RECNO )/datediff("d", StartdateParametre, Enddateparameter)

depending on your data structure you might have to use

distinctCount( SHIPMENTS.RECNO )/datediff("d", StartdateParametre, Enddateparameter)

Ian
 
what do we put for the StartDateParameter? Im guessing I'll need to a a parameter field for a date range
 
if I have my report group by individual user initials (SHIPMENTS.ENTEREDBY) how do I get the average per user?

thanks
 
To count by user

@AvgCount
Count( SHIPMENTS.RECNO, SHIPMENTS.ENTEREDBY )/datediff("d", StartdateParametre, Enddateparameter)

To exclude weekends use Ken Hamady solution, you can also remove public holidays too.


Ian
 
Missed comment about date range, I assumed you were using date parameters to fix date range of report.

However, as you are grouping by user they may not have entries for every day in reporting range

To only count days for specific user data range change formula

@AvgCount
Count( SHIPMENTS.RECNO, SHIPMENTS.ENTEREDBY )/datediff("d", minimum(entrydate, SHIPMENTS.ENTEREDBY ) maximum(entrydate, SHIPMENTS.ENTEREDBY ))

This will count days between two limits, you will need to replace with result of Ken Hamady formula if you want to exclude weekends. Also days without shipments will still be counted.

Ian



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top