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

delete rows with same values except...

Hello to you, I have this table and I want to delete all duplicated rows based on "entity" and "layer" column value with one exception - I want that rows that have the value "set process allowed to" in "layer" column, will stay and not delete the duplications. Would like your help with it:

Image 1.jpg

 

3 REPLIES 3
txnelson
Super User

Re: delete rows with same values except...

After you select all of the duplicate rows, then all you have to do is to find the rows you don't want to be selected and then unselect them.

Here is an example

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

dt << select duplicate rows( Match( :sex, :height ) );

// Find the rows that should not be selected
theRows = dt << get rows where( :weight == 92 );

// Unselect those rows
For( i = 1, i <= N Rows( theRows ), i++,
	Row State( theRows[i] ) = Selected State( 0 )
);
Jim
Stas
Level I

Re: delete rows with same values except...

Thank you very much

Re: delete rows with same values except...

In addition to @txnelson's script, you should also learn how to use JMP's interactive commands for row operations. Please see this help about selecting rows and this help about finding rows.