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

Ranking Pages by a Field

Status
Not open for further replies.

opalsubtreasuries

Programmer
Feb 18, 2005
2
US
I have a report that has 400 people on it. There is a field for money on it. I want to create a field that shows their ranking for the money field. For example the guy with the most money would have the number "1" in the ranking field. The person with the least would have the number "400" in the ranking field.
 
Hi,
Will it always have 400 people?
What about ties?

Why not just sort by money Descending and see who is where?


[profile]
 
The number will not always be 400, it can be anything. I want the report sorted by last name. I just need a field to calculate a ranking.
 
Is the field you want to rank by a detail level field? Or is it a summary for a group based on the person field?

-LB
 
Assuming it is a detail level field, you would create a formula within the main report:

//{@sharename} to be placed in the detail_a section:
whileprintingrecords;
shared stringvar name := {Table.Name};

This formula MUST be on the main report--use it instead of the name field.

Then insert a detail_b section and insert a subreport that contains the customer name and the money field, sorted in descending order by {table.money}. Add the "special field" recordnumber to the subreport to act as the rank. Then still within the subreport, suppress the name field, suppress the report header and footer, and then go to the section expert->details->suppress->x+2 and enter:

whileprintingrecords;
shared stringvar name;
{Table.Name} <> name

Do not link the subreport, but place it in detail_b. Next remove the border (format subreport->borders->change all single lines to no line. Then go to the section expert->detail_a->check "underlay following sections".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top