BookmarkSubscribeSubscribe to RSS Feed
joydeepb83

Occasional Contributor

Joined:

Feb 20, 2018

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

Joined:

Jun 22, 2012

Solution

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
1 REPLY
txnelson

Super User

Joined:

Jun 22, 2012

Solution

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