BookmarkSubscribeSubscribe to RSS Feed
Highlighted
ENTHU

Contributor

Joined:

May 13, 2018

Color Cells based on formula result and display using tabulate.

I am using tabulate command to display data from a table along with a graph.I have colored the cells in the data table based on a condition.

Lets say if temperature < 5 color = red, 10<temperature<20 color = blue etc.

I am then using tabulate function to create table from this.But the cell color doesnt seem to show up in the final output table.

7 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

Re: Color Cells based on formula result and display using tabulate.

The Tabulate Platform does not support cell color.  The displayed output from Tabulate is not a data table.  However, you can have the platform generate a data table from the displayed output, and then you can color those cells.  Look under the red triangle for the "Make into data table" option.

Jim
ENTHU

Contributor

Joined:

May 13, 2018

Re: Color Cells based on formula result and display using tabulate.

Thanks!

gzmorgan0

Community Trekker

Joined:

Jul 25, 2016

Re: Color Cells based on formula result and display using tabulate.

Just a quick note on several alternatives:

  • Use Table Summary and color rows
  • From the Tabulate menu, select Make Into Data Table and color that display
  • Write a script to make a custom display table. 
  • If possible, create a graph to represent the table. If it is complex, this is likely not feasible. Below is a simple example. The Graph Builder label is Percent of Total. Note that the bar colors are custom: 12-13 Blue, 14-16 Green, 17+ Red.
  • image.pngimage.png
ENTHU

Contributor

Joined:

May 13, 2018

Re: Color Cells based on formula result and display using tabulate.

This is helpful but I have a 20x20 data table.I have to loop through each cell, check the value and color it accordingly.

Eg : I have age1 - age10 columns.I need to color all cells withe age <20 as blue.

How can I do this?

gzmorgan0

Community Trekker

Joined:

Jul 25, 2016

Re: Color Cells based on formula result and display using tabulate.

You did not mention which version of JMP that you are using.

 

You should look up in the Scripting Index, Color Cells.  You can find it by typing "cell" as the search string for the objects messages.  This is a column message. The first argument is the color, the second argument is the row list or ro reference. If no rows are specified then all rows in that column are colored. This is copied from Example 3.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
a = {1, 3, 5};
b = {2, 4, 6};
:height << color cells( {{"Red", a}, {"blue", b}} );

Here is another example, using a For loop, that selects columns based upon their names an row condition.  I like to use custom colors, lighter colors so the numbers are readable.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Blood Pressure.jmp" );
nme = dt << get column names( String );
_xx = dt << get rows where( :Dose == "Control" );
For( i = 3, i <= N Items( nme ), i++,
If( Contains( nme[i], "8" ),
Column( dt, i ) << color cells( RGB Color( 122, 235, 235 ), _xx )
) //end if
); //end for

 

ENTHU

Contributor

Joined:

May 13, 2018

Re: Color Cells based on formula result and display using tabulate.

With inputs from all you guys I am able to make a data table from tabulate and color cells based on formula result.

I now need to display this table along with the graph.(I was doing this with tabulate earlier)

 

Is there an easy way to do this? Sorry new to jmp and have lot of questions.

gzmorgan0

Community Trekker

Joined:

Jul 25, 2016

Re: Color Cells based on formula result and display using tabulate.

You can do this with combine windows.  On the bottom right of your table view border check the box. Do the same for your graph. On the graph select the Menu icon and select Combine Windows.  See screenshot below. A pop-up menu will appear, give it a name and the window has both table and graph.

image.png