Choose Language Hide Translation Bar
Highlighted
acfbt
Level I

How do I select all colored cells in a data table

A data table was given to me where certain rows are colored red to indicate issues, but I do not know the logic behind the issues. How do I go about selecting all rows colored red in JSL?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
gzmorgan0
Super User

Re: How do I select all colored cells in a data table

As Jim stated, cell coloring can be related to or independent of row colors.  The only way I know how to get to Cell Colors for a specific column is to get the column script and "unpack" the expression (script)  arguments.

 

If a columns contains colored cells, it has an argument Color Cells( {... } ) where the list contains one or more lists, the first item in each list is the color number and the second item in the list is another list, a list of cells(rows) with that color.  The 2 item list format is called a name-value pair. The attached script does not handle the case where the cell color is not an integer.

 

I wish JMP would make Color Cells a Column Property so col << get Column Property("Cell Colors") would return the list, without searching for the argument.  

 

Jim might have a simpler solution. Attached is the table Cars_modified.jmp and a script that uses it.  The script references the table from c:/temp, so modify the script to have the correct table path.

 

 

 

View solution in original post

4 REPLIES 4
Highlighted
txnelson
Super User

Re: How do I select all colored cells in a data table

There is not a direct way to get this.  Partly because the issue is, are the rows colored, or are the cells colored.  To determine this, if you look in the column that has the row number in it, that is, look in the Row State Column, and if there is a marker in the the rows where the rows are colored, and it is the same color as the row, then the rows are colored.  If in a row which is colored, there is no colored marker in the Row State Column, the each cell is colored.

 

Which of these is the case for you?

Jim
Highlighted
gzmorgan0
Super User

Re: How do I select all colored cells in a data table

As Jim stated, cell coloring can be related to or independent of row colors.  The only way I know how to get to Cell Colors for a specific column is to get the column script and "unpack" the expression (script)  arguments.

 

If a columns contains colored cells, it has an argument Color Cells( {... } ) where the list contains one or more lists, the first item in each list is the color number and the second item in the list is another list, a list of cells(rows) with that color.  The 2 item list format is called a name-value pair. The attached script does not handle the case where the cell color is not an integer.

 

I wish JMP would make Color Cells a Column Property so col << get Column Property("Cell Colors") would return the list, without searching for the argument.  

 

Jim might have a simpler solution. Attached is the table Cars_modified.jmp and a script that uses it.  The script references the table from c:/temp, so modify the script to have the correct table path.

 

 

 

View solution in original post

Highlighted
acfbt
Level I

Re: How do I select all colored cells in a data table

In this case the rows are colored and not individual cells.

Highlighted
txnelson
Super User

Re: How do I select all colored cells in a data table

Then you want to use the following code(modified from @gzmorgan0 code)

//get and table row with a specified color
_colorRows = dt << get rows where (Color Of( Row State( Row() ) ) != 0) ;

dt<<select rows(_colorrows);
Jim
Article Labels

    There are no labels assigned to this post.