cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to use Accelerated Life Testing (ALT) to evaluate reliability. Register for June 5 webinar, 2pm US Eastern Time.

Discussions

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

Color by cell

for each row(

Hi folks, 

I want to colour my cells by value,

so if the row is <=  25 red, if > 25 and < 50 orange , if> 50 < 70 yellow.

and >75 green.

i am breaking it down to test first and when i run the first 2 arguments, the second condition changes all the rows to orange

For Each Row(
	If(
		:CDO 4 week Avg <= 25, dt:CDO 4 week Avg << color cells( "Red", Row() ),
		:CDO 4 week Avg > 25 <= 50,
			dt:CDO 4 week Avg << color cells( "orange", Row() )
	)
);

 

I cant understand why I am overwriting the condition and changing all cells colors to orange

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Color by cell

Second comparison seems wrong.

Try changing:

:CDO 4 week Avg > 25 <=50,

to

25 < :CDO 4 week Avg <=50,
-Jarmo

View solution in original post

3 REPLIES 3
jthi
Super User

Re: Color by cell

Second comparison seems wrong.

Try changing:

:CDO 4 week Avg > 25 <=50,

to

25 < :CDO 4 week Avg <=50,
-Jarmo
jearls11
Level III

Re: Color by cell

And is it possible to loop this for each column or do i have to make a for loop for each of the columns?

 

 

txnelson
Super User

Re: Color by cell

Here is a simple example of coloring cells across multiple columns, without having to process the cells row by row.  

txnelson_0-1633533845201.png

Names Default To Here( 1 );
// Open Data Table: Blood Pressure.jmp
// → Data Table( "Blood Pressure" )
dt = Open( "$SAMPLE_DATA/Blood Pressure.jmp" );

For( i = 3, i <= N Cols( dt ), i++,
	theRows = dt << get rows where( As Column( dt, i ) > 180 );
	Column( dt, i ) << color cells( "red", theRows );
);

 

Jim

Recommended Articles