2 points by remi-quentin_92 3 months | flag | 1 comment
remi-quentin_92 3 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

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