cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
lala
Level IX

How does JSL implement the sorting of memory arrays?

Thanks!

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
ar = dt << GetAsMatrix( {2, 4} );
ar << Sort( By( 1 ), Order( Descending ), replace table );//??
  • Of course, this code is just a try.

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: How does JSL implement the sorting of memory arrays?

You might find something in Sorting Lists  useful. The Rank() function is often overlooked.

Craige

View solution in original post

2 REPLIES 2
jthi
Super User

Re: How does JSL implement the sorting of memory arrays?

You can sort vectors and lists but I'm not sure if you can sort matrix by specific column. But you can always convert that matrix to private table, sort it and get it back into matrix.

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
ar = dt << GetAsMatrix({2, 4});

dt_m = As Table(ar, <<private);
dt_m << Sort(By(1), Order(Descending), Replace Table);

ar1 = dt_m[0,0];
Close(dt_m, no save);

show(ar, ar1);
-Jarmo
Craige_Hales
Super User

Re: How does JSL implement the sorting of memory arrays?

You might find something in Sorting Lists  useful. The Rank() function is often overlooked.

Craige

Recommended Articles