cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • 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!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • 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
SpannerHead
Level VI

Select a block of cells based upon a condition

I would like to select a data table cell containing a specific string and any populated rows in the same column below the string until I reach an empty cell?  If Value were the text, I'd like to grab the ones below that.  Can't immediately think how to do that.

 

SpannerHead_0-1759356881179.png to 

SpannerHead_1-1759356950154.png

 

 


Slán



SpannerHead
2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: Select a block of cells based upon a condition

Try this

names default to here(1);
dt=current data table();

flag=0;
for each row(
	If(:theColumn == "Value", flag=1,
		:theColumn == "", flag=0
	);
	If(flag==1, dt<<select rows(Row()))
)
Jim

View solution in original post

SpannerHead
Level VI

Re: Select a block of cells based upon a condition

txnelson

 

Small tweak got me there.  Thanks.

 

names default to here(1);
dt = current data table();

flag=0;
for each row(
	If(:theColumn == "Value", flag=1,
		:theColumn == "", flag=0
	);
	If( flag==1, dt << select rows(Row()))
);

dt << Select Columns(:theColumn);

Slán



SpannerHead

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Select a block of cells based upon a condition

Try this

names default to here(1);
dt=current data table();

flag=0;
for each row(
	If(:theColumn == "Value", flag=1,
		:theColumn == "", flag=0
	);
	If(flag==1, dt<<select rows(Row()))
)
Jim
SpannerHead
Level VI

Re: Select a block of cells based upon a condition

txnelson

 

That's brilliant, and really close!  It selects the entire rows but I'd like to constrain it to cells in 

:theColumn

 


Slán



SpannerHead
SpannerHead
Level VI

Re: Select a block of cells based upon a condition

txnelson

 

Small tweak got me there.  Thanks.

 

names default to here(1);
dt = current data table();

flag=0;
for each row(
	If(:theColumn == "Value", flag=1,
		:theColumn == "", flag=0
	);
	If( flag==1, dt << select rows(Row()))
);

dt << Select Columns(:theColumn);

Slán



SpannerHead

Recommended Articles