cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

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

Select and color rows

Hi I am writing the following code to achieve the following. Could anyone please help. For some reason the code is not working. 

Thanks Joydeep

 

Objective. 

 

I am opening Table 1, Then getting summary of Table 1 and save it to table 2. 

Now for each row in the Table 2, I want to color the rows of Table 1. 

So I am running For loop in Table to select each row and based on that trying to color the row of Table 1. 

 

I would appreciate your help. 

 

//// Here is the code I am trying
 
 
dt10= open("\\Test\Table1.jmp");
 
dt11= dt10 << Summary(
Group(:Work Week ),
Freq( "None" ),
Weight( "None" )
);
x= N Row(dt11);
v= N Rows(dt10);
For(i=1,i <=x, i++,
dt11 << Select Rows(i) ;

For (j=1,j<=v, j++, dt10 << current data table();

if ( Row State(dt10,j) == "Selected" , Column( dt10, "Work Week") << Color Cells( i,{j} ));


);
dt11 << clear selection();
);

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Select and color rows

Try this:

dt10 = Open( "\\Test\Table1.jmp" );

dt11 = dt10 << Summary( Group( :Work Week ), Freq( "None" ), Weight( "None" ) );

x = N Row( dt11 );
v = N Rows( dt10 );

For( i = 1, i <= x, i++,
	dt11 << Select Rows( i );
	dt10:Work Week << color cells( "Red")	
	dt11 << clear selection();
);
Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: Select and color rows

Try this:

dt10 = Open( "\\Test\Table1.jmp" );

dt11 = dt10 << Summary( Group( :Work Week ), Freq( "None" ), Weight( "None" ) );

x = N Row( dt11 );
v = N Rows( dt10 );

For( i = 1, i <= x, i++,
	dt11 << Select Rows( i );
	dt10:Work Week << color cells( "Red")	
	dt11 << clear selection();
);
Jim

Recommended Articles