2 points by remi-quentin_92 8 months | flag | 1 comment
remi-quentin_92 8 months | flag

If you want to rank in decreasing order, you can either:

1 - scan with a minus sign

table T = with
[| as N |]
[| 0 |]
[| 1 |]
[| 2 |]
[| 3 |]
 
T.rk = rank() scan -T.N
 
show table "" a1b4 with
T.N
T.rk
1 2 3 4 5 6 7 8 9 10 11 12

2 - Use rankrev function (not documented but similar to rank function)

table T = with
[| as N |]
[| 0 |]
[| 1 |]
[| 2 |]
[| 3 |]
// equivalent to rank() scan -T.N
T.rk = rankrev() scan T.N
show table "" a1b4 with
T.N
T.rk
1 2 3 4 5 6 7 8 9 10 11 12 13