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
If you want to rank in decreasing order, you can either:
1 - scan with a minus sign
2 - Use rankrev function (not documented but similar to rank function)