cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

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