Subscribe Bookmark RSS Feed

Get access to column property

Highlighted
KinKame

Community Trekker

Joined:

Nov 30, 2015

Hello,

I was struggling a little to get column property in my table but finally here is how I do:

  1. set up property in column (color gradient, limit .... )
  2. right click on the column title and select "copy column property"
  3. paste into script window

example as below: I was struggling for the color gradient part

Add Column Properties(
Formula( (As Column( Char( kweek ) || "F" ) - As Column( Char( kweek1 ) || "F" )) / As Column( Char( kweek1 ) || "F" ) ),
Set Property( "Color Gradient", {"Green Yellow Red", Range( {-0.35, 0, -0.03} ), "Reverse Scale"} ),
Color Cell by Value
);

then in the script it will become 

column(dt, "name") << Add Column Properties(
Formula( (As Column( Char( kweek ) || "F" ) - As Column( Char( kweek1 ) || "F" )) / As Column( Char( kweek1 ) || "F" ) ),
Set Property( "Color Gradient", {"Green Yellow Red", Range( {-0.35, 0, -0.03} ), "Reverse Scale"} ),
Color Cell by Value
);

 

hope it will help some of jmp users