cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
bernie426
Level II

How to color/marker selected rows based on multiple selection criteria?

Hi,

I am writing a script that is able to color and mark selected rows. Let's take the Big Class table as an example.

The following is my script, can anyone help out to get the selected rows to be colored to specific color like "Blue" and able add different marker for age =12 and age=13.

Open( "$SAMPLE_DATA/Big Class.jmp" );

  For Each Row( Selected(Row State()) = And ( Or (age == 13, age ==12), sex =="M"))= Color State( {0, 0, 225} );

  Color To RGB( Color Of( Selected( Row State() ) ));

Many Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
Kevin_Anderson
Level VI

Re: How to color/marker selected rows based on multiple selection criteria?

Hi, bernie426!

There's a bunch of ways to do this.  Here's one:

BigClass_dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

BigClass_dt << Select Where( And ( Or (age == 13, age ==12), sex =="M")) << Colors(RGB Color(0,0.333,0.667)) << Markers( "\!U2642" ) << Clear Select;

BigClass_dt << Select Where( And ( Or (age == 13, age ==12), sex =="F")) << Colors(RGB Color(0.376,0.248,0.376)) << Markers( "\!U2640" ) << Clear Select;

If you had many color and marker assignments to do, you might want to be a little less explicit.

View solution in original post

2 REPLIES 2
Kevin_Anderson
Level VI

Re: How to color/marker selected rows based on multiple selection criteria?

Hi, bernie426!

There's a bunch of ways to do this.  Here's one:

BigClass_dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

BigClass_dt << Select Where( And ( Or (age == 13, age ==12), sex =="M")) << Colors(RGB Color(0,0.333,0.667)) << Markers( "\!U2642" ) << Clear Select;

BigClass_dt << Select Where( And ( Or (age == 13, age ==12), sex =="F")) << Colors(RGB Color(0.376,0.248,0.376)) << Markers( "\!U2640" ) << Clear Select;

If you had many color and marker assignments to do, you might want to be a little less explicit.

bernie426
Level II

Re: How to color/marker selected rows based on multiple selection criteria?

Thanks, Kevin. It worked out great for me.

Many Thanks,