Ascending grade
iasc x iasc[x]
Where x is a list or dictionary, returns the indexes needed to sort list x in ascending
order.
q)L:2 1 3 4 2 1 2
q)iasc L
1 5 0 4 6 2 3
q)L iasc L
1 1 2 2 2 3 4
q)(asc L)~L iasc L
1b
q)iasc `a`c`b!1 2 3
`a`c`b
Reverse a sort with iasc iasc:
q)x:100?100
q)b:100?.Q.a
q)c:b iasc x
q)b~c iasc iasc x
1b