BookmarkSubscribeSubscribe to RSS Feed

Community Trekker

Joined:

May 4, 2017

## How to extract the value color column property and store in a list?

Hi,

I want to get the color assigned to a specific cell, assuming that the cell column has "value color" property.

Here is the copy of my script that was applied to Big Class.jmp. I added value color property to "sex" column.

``````//Get the grouping column and store in a list
Summarize( A = by( :sex ) );
B = :sex << get property( value ordering );
If( Is Empty( B ),
GroupList = A,
GroupList = B
);
Show( GroupList );

//get the value color ordering property
GroupColor=:sex << get property( value colors );
Show(GroupColor);``````

The output is as follows:

``````GroupList = {"F", "M"};
GroupColor = {"F" = 19, "M" = 21};``````

However, I want the output for the GroupColor to be like this:

``GroupColor = {19,  21};``

Is this possible?Thanks,
Shaira

2 ACCEPTED SOLUTIONS

Accepted Solutions

Staff

Joined:

Jun 23, 2011

Solution

## Re: How to extract the value color column property and store in a list?

``````NamesDefaultToHere(1);
dt = Open("\$SAMPLE_DATA/Big Class.jmp");
:sex << Set Property( "Value Colors", {"F" = -13647958, "M" = -4222675} );
groupColor = :sex << get property( value colors );
Show(groupColor);

for(i=1, i<=NItems(groupColor), i++,
groupColor[i] = Arg(groupColor[i], 2);
);
Show(groupColor);``````

Super User

Joined:

Jun 22, 2012

Solution

## Re: How to extract the value color column property and store in a list?

This will work

``````For( i = 1, i <= N Items( GroupColor ), i++,
GroupColor[i] = Num( Word( 3, Char( GroupColor[i] ) ) )
);``````
Jim
4 REPLIES

Staff

Joined:

Jun 23, 2011

Solution

## Re: How to extract the value color column property and store in a list?

``````NamesDefaultToHere(1);
dt = Open("\$SAMPLE_DATA/Big Class.jmp");
:sex << Set Property( "Value Colors", {"F" = -13647958, "M" = -4222675} );
groupColor = :sex << get property( value colors );
Show(groupColor);

for(i=1, i<=NItems(groupColor), i++,
groupColor[i] = Arg(groupColor[i], 2);
);
Show(groupColor);``````

Community Trekker

Joined:

May 4, 2017

## Re: How to extract the value color column property and store in a list?

Thanks! This works. :)

Super User

Joined:

Jun 22, 2012

Solution

## Re: How to extract the value color column property and store in a list?

This will work

``````For( i = 1, i <= N Items( GroupColor ), i++,
GroupColor[i] = Num( Word( 3, Char( GroupColor[i] ) ) )
);``````
Jim

Community Trekker

Joined:

May 4, 2017

## Re: How to extract the value color column property and store in a list?

Thanks! This also works. :)