cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Choose Language Hide Translation Bar
View Original Published Thread

Move Rows

Dennisbur
Level IV

Hello
I have calculated the table, but I want to move rows in this table.

For example, I want to move the GPIO row to the start of the table and the JTAG row after GPIO.

I tried to write this script, but something went wrong, can you assist me with this script?

 

dt << Move Rows ( {"GPIO"}, At Start );
dt << Move Rows ( {"JTAG"}, After( "GPIO" ) );

 

Dennisbur_0-1677744523367.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Move Rows

<< Move Rows seems to work with selected rows

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
r = dt << Select Rows([5, 7, 8, 10]);
Wait(2);
r << Move Rows(At Start);

jthi_0-1677762185763.png

 

-Jarmo

View solution in original post

4 REPLIES 4
txnelson
Super User


Re: Move Rows

My suggestion is to open the Value Ordering column property, and change the order of the values in there, and then just sort the data table based upon the Parmeter column, and it will follow the Value Order you specified.

Jim
Dennisbur
Level IV


Re: Move Rows

Is there a script command to move rows in a table?

txnelson
Super User


Re: Move Rows

Here is one way of moving a row:

Names Default To Here( 1 );
DT = Current Data Table();

rowToMove = dt[5, 0];
dt << delete row( 5 );
dt << add rows( 1, after( 12 ) );
dt[13, 0] = rowToMove;
Jim
jthi
Super User

Re: Move Rows

<< Move Rows seems to work with selected rows

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
r = dt << Select Rows([5, 7, 8, 10]);
Wait(2);
r << Move Rows(At Start);

jthi_0-1677762185763.png

 

-Jarmo