cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • See how to use the JMP Marketplace – Free tools to expand JMP capabilities. Register. July 10, 2 pm US Eastern Time.

Discussions

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

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 III

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.

Recommended Articles