<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I select all colored cells in a data table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/75490#M35929</link>
    <description>&lt;P&gt;In this case the rows are colored and not individual cells.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Sep 2018 11:46:08 GMT</pubDate>
    <dc:creator>acfbt</dc:creator>
    <dc:date>2018-09-24T11:46:08Z</dc:date>
    <item>
      <title>How do I select all colored cells in a data table</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/74963#M35885</link>
      <description>&lt;P&gt;A&amp;nbsp;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?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 19:57:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/74963#M35885</guid>
      <dc:creator>acfbt</dc:creator>
      <dc:date>2018-09-21T19:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select all colored cells in a data table</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/74991#M35887</link>
      <description>&lt;P&gt;There is not a direct way to get this.&amp;nbsp; Partly because the issue is, are the rows colored, or are the cells colored.&amp;nbsp; 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.&amp;nbsp; If in a row which is colored, there is no colored marker in the Row State Column, the each cell is colored.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which of these is the case for you?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 22:03:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/74991#M35887</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-09-21T22:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select all colored cells in a data table</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/75126#M35900</link>
      <description>&lt;P&gt;As Jim stated, cell coloring can be related to or independent of row colors.&amp;nbsp; 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)&amp;nbsp; arguments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp; The 2 item list format is called a&amp;nbsp;&lt;STRONG&gt;name-value pair&lt;/STRONG&gt;. The attached script does not handle the case where the cell color is not an integer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish JMP would make Color Cells a Column Property so col &amp;lt;&amp;lt; get Column Property("Cell Colors") would return the list, without searching for the argument.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jim might have a simpler solution. Attached is the table &lt;STRONG&gt;Cars_modified.jmp&lt;/STRONG&gt; and a script that uses it.&amp;nbsp; The script references the table from c:/temp, so modify the script to have the correct table path.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Sep 2018 06:58:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/75126#M35900</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-09-22T06:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select all colored cells in a data table</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/75490#M35929</link>
      <description>&lt;P&gt;In this case the rows are colored and not individual cells.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2018 11:46:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/75490#M35929</guid>
      <dc:creator>acfbt</dc:creator>
      <dc:date>2018-09-24T11:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select all colored cells in a data table</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/75507#M35936</link>
      <description>&lt;P&gt;Then you want to use the following code(modified from&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/70"&gt;@gzmorgan0&lt;/a&gt; code)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//get and table row with a specified color
_colorRows = dt &amp;lt;&amp;lt; get rows where (Color Of( Row State( Row() ) ) != 0) ;

dt&amp;lt;&amp;lt;select rows(_colorrows);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Sep 2018 13:47:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/75507#M35936</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-09-24T13:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select all colored cells in a data table</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/514640#M74162</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("C:/temp/Cars_modified.jmp");
//______________________________________________________________________________________

//A function to find the colored cells in a specific column.
//-15341335 = reddish color, 73 = yellowish, 36=greenish  
get_colored_cells = Function( {col}, {_s,i, xp, clr_aa=0 },
   // If IsMissing(clr) then get all colors
	_s = col &amp;lt;&amp;lt; get script ; 
	for(i=1, i&amp;lt;=narg(_s) , i++,
        xp = Arg(_s, i);
        if(Head Name(xp) =="Color Cells", 
   //this only works if the color is an integer might need a for loop to change the 
   //key to the RGB value
            clr_aa = Associative Array(Arg(xp,1));  
            clr_aa &amp;lt;&amp;lt; set default value(0);
            Break()
        ); 
    );
   clr_aa 
);
//_______________________________________________________________________________________

// Usage examples:
model_aa = get_colored_cells( Column("Model"));
dt&amp;lt;&amp;lt; select rows (model_aa[73]);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I modified the above example to select yellowish cells, and it worked when there are multiple colors in the "Model" column. When there's only 1 color in the column, it doesn't work. How can I modify the script so that colored cells within the Model column can be selected when there's only 1 color that's used in the column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 20:52:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/514640#M74162</guid>
      <dc:creator>dn610</dc:creator>
      <dc:date>2022-06-27T20:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I select all colored cells in a data table</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/774483#M95631</link>
      <description>&lt;P&gt;Nice trick - via the column script ! :)&lt;/img&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;LI-MESSAGE title="🙏 Expression Indexing: read and write access" uid="697359" url="https://community.jmp.com/t5/JMP-Wish-List/Expression-Indexing-read-and-write-access/m-p/697359#U697359" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;could facilitate the&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;if(Head Name(xp) =="Color Cells", &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;part ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Till it's available, one could convert the Expression to a list and use List indexing:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("C:/temp/Cars_modified.jmp");
myScript = dt:Model  &amp;lt;&amp;lt; Get Script;
SubstituteInto(myScript, Expr(New Column()), {});
colorsettings = Associative Array(Try(myScript["Color Cells"],{}));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Jul 2024 05:21:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-select-all-colored-cells-in-a-data-table/m-p/774483#M95631</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-07-22T05:21:12Z</dc:date>
    </item>
  </channel>
</rss>

