cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP 19 is here! See the new features at jmp.com/new.
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
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