I'm trying to come up with a verb that would return the sort order of a table according to criteria, such as one column can sort up, the other down, etc. However, I can't seem to figure it out. Please help me (see example below).

Given the dyadic verb MultiSort (where the left argument being 0 means sort up, and 1 means sort down):

 n =. >1 4 72; 2 6 41; 1 4 20; 1 5 74; 1 6 27
  n
1 4 72
2 6 41
1 4 20
1 5 74
1 6 27
 ]isortorder =. 0 1 0 MultiSort n
4 3 2 0 1
 isortorder { n
1 6 27
1 5 74
1 4 20
1 4 72
2 6 41

Thanks,

Martin
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to