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

Field Ranking

Status
Not open for further replies.

ecugrad

MIS
Apr 17, 2001
191
US
I have two fields I need to rank CAPACITY and TIME my grouping for the report is EMPLOYEE ID's. I would like the rankings to be in desinding order. I have tried multiple pieces of code, but with limited or no luck. The two fields are not summary fields. The numbers pull straight from a table. I'm utilizing Crystal 8.5 and have limited expeirence with formulas. Any help will be appreciated
 
Hi,
Explain what you mean by rank, please..I am not sure what you mean aside from ordering them within the details.

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Okay, for Capacity and Time we have collect numbers one number for each employee every month. So all I do is order them within the detail section?

Employee Capacity (Capacity_Rank) Time (Time_Rank)
1 77 2 6 2
2 88 1 4 4
3 56 3 7 1
4 42 4 5 3


 
You could set up two formulas for the ranks, like the one following for time rank:

if {Table.Time} = nthlargest(1,{Table.Time}, {Table.Employee ID}) then 1 else
if {Table.Time} = nthlargest(2,{Table.Time}, {Table.Employee ID}) then 2 else
if {Table.Time} = nthlargest(3,{Table.Time}, {Table.Employee ID}) then 3 else
if {Table.Time} = nthlargest(4,{Table.Time}, {Table.Employee ID}) then 4

You could alternatively sort by one of the fields in descending order and then add a running total that does a count and resets on change of employee ID, but you would only be able to do this for one of the fields.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top