Ranking a number field in a Table

Question:

I have a Filemakerpro 8.5 database with a Table containing 1,020 records, one for each of 1,020 Companies.  [I will be increasing the number of Companies, the number of records will change frequently.]  One of the number fields on the Companies Table is the size of the company.

Some time ago JoJohn helped me with a Calculation field which will calculate the rank of the size of that Company against the size of each of the other companies in the Table.

JoJohn’s calculation works well, and quickly, to rank by size, but I would very much prefer it to rank in the reverse order.  Is it possible to change the order?

At the moment it assigns the largest ranking number – “1020″ – to the largest size.

I would prefer to assign the smallest number – “1″ – to the largest size

This is JoJohn’s calculation field

Let(
[
List = ValueListItems ( "RankOrder"; "rank" ) & ¶;
Stop=Position(List;Size;0;1)+ 1

];

WordCount(Left(List;Stop))
)

Thanks for any guidance
Tony

Solution:

you can’t reverse the list sorting order, so complement the wordcount value:
rank value = get(foundcount) – WordCount(Left(List;Stop))

+ 1
instead of getting the 25th rank for a given record, you should get 1020 – 25 + 1 = 996th
Tags:
digg delicious stumbleupon