cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
NetflixCrow956
Level III

delete specefic row in column

 

I would like to delete the lines starting with "00097" how to do?

Thank you

NetflixCrow956_1-1649074789463.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: delete specefic row in column

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

// Select the rows that meet the qualification
dt << select where( Left( :Order Number, 5 ) == "00097" );

// delete the selected rows.  Using the Try() function keeps
// the deletion from failing if no rows were selected
Try( dt << delete rows );
Jim

View solution in original post

6 REPLIES 6
txnelson
Super User

Re: delete specefic row in column

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

// Select the rows that meet the qualification
dt << select where( Left( :Order Number, 5 ) == "00097" );

// delete the selected rows.  Using the Try() function keeps
// the deletion from failing if no rows were selected
Try( dt << delete rows );
Jim
jthi
Super User

Re: delete specefic row in column

Here is one more option using get rows where() in combination with starts with() to get rows into a matrix and then deleting them with delete rows().

 

Script below will remove all names which start with "J" in Big Class datatable:

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
rows_to_delete = dt << Get Rows Where(Starts With(:name, "J"));
If(N Items(rows_to_delete),
	dt << Delete Rows(rows_to_delete);
	show(rows_to_delete);
);

-Jarmo
Byron_JMP
Staff

Re: delete specefic row in column

If you didn't want to use JSL to solve the problem, then a formula column could help.

 

Similar to @txnelson solution, make a new column, and paste this formula into it. 

Left( :Order Number, 5 )

Then in your data table, click on the one row that has 00097 to select it, then use the right click option to Select Matching Rows.

Once they are selected you can either delete those rows, or right click to Exclude/Hide them, so that you preserve all of your original data. 

JMP Systems Engineer, Health and Life Sciences (Pharma)
NetflixCrow956
Level III

Re: delete specefic row in column

Thank you ! 

NetflixCrow956
Level III

Re: delete specefic row in column

Thank you !

NetflixCrow956
Level III

Re: delete specefic row in column

Thank you so much