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
PowerOx327
Level I

How to get rows with more than one condition?

Hi,

 

I'm trying to get rows with more than one condition as so:

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
r = dt << Get Rows Where( :sex == "F", :name == "ROBERT", :name != "MARK" );
Show( r );

 

But what I'm getting is only rows where : sex == "F",

Is there any way to get all rows that are :name == "ROBERT", and also rows that are :name != "MARK"  i.e. the :name rows where it is not "MARK"

 

1 ACCEPTED SOLUTION

Accepted Solutions
Thierry_S
Super User

Re: How to get rows with more than one condition?

Hi,

Have you tried to build your condition as a logic statement (see below)?

 


r = dt << Get Rows Where( :sex == "F" | (:name == "ROBERT" | :name != "MARK" ));

 

This should return all the rows with Female, Roberts, or NOT Mark.

Best,

TS

Thierry R. Sornasse

View solution in original post

2 REPLIES 2
Thierry_S
Super User

Re: How to get rows with more than one condition?

Hi,

Have you tried to build your condition as a logic statement (see below)?

 


r = dt << Get Rows Where( :sex == "F" | (:name == "ROBERT" | :name != "MARK" ));

 

This should return all the rows with Female, Roberts, or NOT Mark.

Best,

TS

Thierry R. Sornasse
pmroz
Super User

Re: How to get rows with more than one condition?

The relevant logical operators in JSL are & for AND, | for OR, and ! for NOT.

Recommended Articles