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

Top N Plus Ties 2

Status
Not open for further replies.

dukeslater

Technical User
Jan 16, 2001
87
US
CR 8.5 - I haven't used the Top N feature much, but I need to produce a report with the top 3 values, plus ties - so I may actually be displaying 5 or 10 records.

I'm sure I could create a couple of variables and suppress based on those values, but before I start I thought it would be wise to check in to see if there is some easier way that I'm missing. It would seem to be a relatively common problem.

Thanks as always.
 
I think suppression is about all you can do. See thread149-930979. For consistency, in that thread, my second (suppression) formula should have been:

whileprintingrecords;
numbervar x;
numbervar counter;

counter > 5 and //where 5 is the "real" topN you want
x <> sum({table.field},{table.groupfield})

-LB
 
Create a summary with the grouping based on a unique field in the detail line (recordid?). The summary value should be on the field that you want to base your top n values on.

You now have a grouped report.
Suppress the group header and footer.
Now use the Group Sort/Top N expert to limit the output to the top 5 values plus ties.

 
Many thanks to both of you. I searched for related threads but didn't find the one referenced. Nice to have a couple more tricks in the bag.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top