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!

Top N 1

Status
Not open for further replies.

pungigi

Programmer
Oct 29, 2003
115
US
Can I run a report like follows:

Vdr Name Total $ Pd (Formula: A + B)
abc 5643.25
def 8456.98
ghi 9487.54

this report returns thousands of records, I have it grouped by state so each state has hundreds under it. What I then want is to only show the top 10 $ in each state, I am having a real hard time doing this when I try to go to my Group Sort Expert Total $ Pd is not a choice.

 
In order to use the Top N expert for a given group, you need to have a summary formula at that group level. I think what you are trying to do is filter the top 10 vendors within a state. In order to do that, you need a vendor group and a subtotal of Total $ Pd at the vendor level.
 
If the vendor name and total paid are at the detail level, instead of using topN, you could first sort by {@totalpaid} in descending order, and then create a running total {#cntwingrp} using the running total editor: Select a recurring field, let's say vendor name, and choose count as the summary, evaluate for each record, reset on change of group (state). Then go to format->section->details->suppress->x+2 and enter:

{#cntwingrp} > 10

This should suppress all but the top 10 records within each group.

If you need {@totalpaid} sorted in ascending order then change the sort and then change the suppression formula to:

{#cntwingrp} < count({table.vendorname},{table.state})-9

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top