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

列内の特定の行を削除する

NetflixCrow956
Level III

「00097」で始まる行を削除したいのですが、どうすればよいですか?

ありがとう

undefined

この投稿のオリジナルは 、English (US) で書かれており、ユーザビリティ向上のため自動翻訳機能を使用して表示しています。コメントを投稿すると、オリジナルの言語(English (US))やご指定の言語 でも表示されます。

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re:列の特定の行を削除します

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 );
6 REPLIES 6
txnelson
Super User

Re:列の特定の行を削除します

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 );

この投稿のオリジナルは 、English (US) で書かれており、ユーザビリティ向上のため自動翻訳機能を使用して表示しています。コメントを投稿すると、オリジナルの言語(English (US))やご指定の言語 でも表示されます。

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