view v sortmap   =>   map
v   input view

Sortmap returns a map which describes in which order the rows need to be remapped to become sorted.

Example:
set v [view A def {a d b c}]

view $v sortmap
0 2 3 1