Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4299 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi All,

 

How can i calculate rank, based on a single field. I have some duplicate records. Although, i want to rank the student with the highest marks to lowest marks.

 

Please see attachment for help.

 

Thanks in advance.

post-104036-0-50409400-1365857135_thumb.

post-104036-0-06926900-1365857137_thumb.

Posted

I would do a looping find to mark the dupes and use only the first occurence of each record

create a global roll number field (G_RollNo), also create a flag field

sort the records by Roll Number

go to first record

Set Field [G_RollNo; Roll Number]

Loop

go to next record/exit after last

if [Roll Number=G_RollNo]

Set Field [Flag Field;"X"]

else

Set Field [G_rollNo;Roll Number]

end loop

 

Find Records omitting those with Flag Field marked X

 

 

and then.....

 

with a couple of extra fields -- G_Marks - global marks field, G_Rank - global rank field, Position, you can do a script like this:

#sort records descending by marks

Sort Records

go to Record/First

Set Field [G_Rank; 1]

Set Field [Rank; G_Rank]

Set Field [Position; 1]

Loop

go to Record/Next - exit after last

Set Field [Position; G_Rank +1]

Set Field [G_Rank; Position]

End Loop

Go to Record/First

Loop

if [G_Mark = Mark]

Paste [select; Rank]

else

Set Field[Rank; Position]

End if

Copy [Rank]

Set Field [G_Mark; Mark]

go to Record Next/exit after last

End Loop

 

 

This will give you marks that will go:

 

1

2

2

4

4

6

 

etc.

This topic is 4299 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.