Subscribe Bookmark RSS Feed

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

bernie426

Community Trekker

Joined:

Feb 9, 2015

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
Solution

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.

2 REPLIES
Solution

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

Community Trekker

Joined:

Feb 9, 2015

Thanks, Kevin. It worked out great for me.

Many Thanks,