Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
ERoderz
Level II

JSL: Color or Mark by Column

I'm trying to color and mark by a specific column that was created using the "Word()" function. For some reason, the "Color or Mark by Column" function doesn't work with the (word) formula created column.

It works fine for any other columns that were originally in the table. Is there a line of code I can add or modify to get this working?

 

 

New Column( "AM or PM", character, Formula( Word( 5, :"Date Info" ) ) );
dt << color or mark by column( "AM or PM", marker theme( hollow ) );

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: JSL: Color or Mark by Column

@txnelson is on the right track.  It seems that there is a problem with the syntax you are trying to use to reference the columns.  In the first line of code you shared, you have

 

:"Date Info"

 

The column is created, but it has no values. Try the following and see if it works.

dt << New Column( "AM or PM", character, Formula( Word( 5, :Date Info ) ) );

dt << Color or Mark by Column( :AM or PM, Marker Theme( "hollow" ) );

 

 

Wendy

View solution in original post

4 REPLIES 4
Highlighted
txnelson
Super User

Re: JSL: Color or Mark by Column

Your reference to AM or PM in the color or mark by column, needs to be referenced with either
:AM or PM
or
Column("AM or PM")
or
:Name("AM or PM")

Jim
Highlighted
ERoderz
Level II

Re: JSL: Color or Mark by Column

That still doesn't seem to be working. I can get other columns (not created by the "Word" formula) to be colored or marked just fine... Why not this one?! @txnelson 

Highlighted

Re: JSL: Color or Mark by Column

@txnelson is on the right track.  It seems that there is a problem with the syntax you are trying to use to reference the columns.  In the first line of code you shared, you have

 

:"Date Info"

 

The column is created, but it has no values. Try the following and see if it works.

dt << New Column( "AM or PM", character, Formula( Word( 5, :Date Info ) ) );

dt << Color or Mark by Column( :AM or PM, Marker Theme( "hollow" ) );

 

 

Wendy

View solution in original post

Highlighted
ERoderz
Level II

Re: JSL: Color or Mark by Column

That worked! Thanks Wendy!