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!

Class Rank 1

Status
Not open for further replies.

mairving

MIS
Jul 7, 2002
24
US
I am trying to do a class ranking. It is pretty easy to do in Excel using the rank function. When I do it in Crystal here is what I have:
Name GPA Rank
Student 1 4.00 1
Student 2 4.00 1
Student 3 4.00 1
Student 4 3.89 2
Student 5 3.89 2
Student 6 3.75 3

What I would like for it to do is like so:
Name GPA Rank
Student 1 4.00 1
Student 2 4.00 1
Student 3 4.00 1
Student 4 3.89 4
Student 5 3.89 4
Student 6 3.75 6

The GPA field is a group total since it is calculated by a total grade of the classes vs. hours. The current Rank function is using a Running Total that does a count of the GPA and changes when the GPA changes. Any ideas on how to get a proper rank?
 
Try a formula like this:

whileprintingrecords;
numbervar rank;
numbervar gpa;

if groupnumber = 1 then (
rank := 1;
gpa := round({@yoursummarycalc},2)
);
if round({@yoursummarycalc},2) <> gpa then (
rank := groupnumber;
gpa := round({@yoursummarycalc},2)
);
rank

-LB
 
Thanks that did it. The part that I left off was creating the gpa var.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top