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!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

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

Select rows based of multiple conditions

Hello,

I'm trying to select rows where either the second or third column have a value below 10^-9, or if there is a missing value in the 4th column. The problem appears to be with the less than operator and I cannot figure out why.

 

Example table:

Col1

Col2Col3Col4
10.000000590.000000308

A

24.08e-9-8.1e-11B
3-1.11e-101.02e-10 

 

Here's the code:

dtColNames = dt << get ColumnNames("String");
val = 10^-9;
dt << Select Where((dt:dtColNames[2]<val | dt:dtColNames[3]<val ) | ismissing(dt:dtColNames[4]));

If I simplify this down to the following:

dtColNames = dt << get ColumnNames("String");
val = 10^-9;
dt << Select Where(dt:dtColNames[2]<val );

nothing is selected, when row 3 should be.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Select rows based of multiple conditions

A character string is not a column name or reference. You need to convert the string to a column reference.

 

dt << Select Where( Column( dt, dtColNames[2] )[] < val | Column( dt, dtColNames[3] )[] < val | ismissing( Column( dt, dtColNames[4] )[] ));

View solution in original post

2 REPLIES 2

Re: Select rows based of multiple conditions

A character string is not a column name or reference. You need to convert the string to a column reference.

 

dt << Select Where( Column( dt, dtColNames[2] )[] < val | Column( dt, dtColNames[3] )[] < val | ismissing( Column( dt, dtColNames[4] )[] ));
aserino
Level III

Re: Select rows based of multiple conditions

Ah! Thanks!

Recommended Articles