Average on Top 20 records

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Daisy_(Guest)
Posts: 4
Joined: Tue Oct 10, 2017 12:44 pm

Average on Top 20 records

Post by Daisy_(Guest) » Sat May 27, 2006 8:07 pm

Hi,__I am trying to average on only the top 20 date fields in the database . How can I do that.____Thanks__Daisy

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Average on Top 20 records

Post by kfleming » Wed May 31, 2006 10:07 am

Here is an example of how to sum a numeric amount for records within the first 20 days in the report. What you want to do may be slightly different but the general technique would be the same.____Sort and group by date. Create a total field that counts the date field, accumulates once per date and resets at the grand level.__Then create a test calculated field with the expression:__IIF(COUNT>=20,amount,0)__Finally create a total field that sums the test field, accumulates for every record and resets at the grand level.____This will give you a sum of the amount for records that are in the first 20 dates.____Kathleen__R&R Support__

Post Reply