top 5

bionicman

Registered User.
Local time
Today, 10:04
Joined
Jul 22, 2003
Messages
145
I have a report that looks like this:
Code:
	column1	column2	column3	column4
item1	1	5	7	3
item2	2	6	9	4
item3	2	5	1	9
total	5	16	17	16

the calculations for the totals are all done in the report using
Sum([fieldname]). I need a way to pull the top 5 values from the total line. is that possible? any ideas how?

Thank you!
 
In the format event of the footer create an array, add all the values to it, sort it in descending order, select the first 5 elements and add them to a second array.
 
Hi Pat, thanks for the response. I don't really understand how to do what you are saying... anyway you can give me a little more detail?

Thank You!
 
Sorry, I can't write the code for you and I don't have any that can be adapted. If you search help you may find a useful example for populating an array or if you search here you may find one. You'll also need to search for code to use to sort an array.
 

Users who are viewing this thread

Back
Top Bottom