<?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 to select &amp;amp; colored Top 5 highest value cell from many columns using JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-select-amp-colored-Top-5-highest-value-cell-from-many/m-p/766952#M94705</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I thought we have formula like =Top(5, column("Type_A"):column("Type_D) &amp;lt;&amp;lt; Color Cell (3);&lt;/P&gt;
&lt;P&gt;Where 5 refers to number of Top values from column Type A to column Type D.&lt;/P&gt;
&lt;P&gt;I will try&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks !&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2024 06:44:13 GMT</pubDate>
    <dc:creator>WebDesignesCrow</dc:creator>
    <dc:date>2024-06-19T06:44:13Z</dc:date>
    <item>
      <title>How to select &amp; colored Top 5 highest value cell from many columns using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-amp-colored-Top-5-highest-value-cell-from-many/m-p/766939#M94702</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hello Experts,&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I select &amp;amp; colored the Top 5 highest value cell from many columns using JSL?&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;From all cells in column Type_A to Type_D (the similarity of these column name is it contains "_")&lt;/P&gt;
&lt;P&gt;I want to select &amp;amp; colored the Top 5 highest value cell with yellow.&lt;/P&gt;
&lt;P&gt;It seems "Select Where" function only applicable to comparing 2 columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expected result should be something like this;&lt;/P&gt;
&lt;P&gt;0.14, 0.12,0.11,0.1, 0.9 are the Top 5 highest value cells.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WebDesignesCrow_1-1718770411702.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65390i04471E73582EF515/image-size/medium?v=v2&amp;amp;px=400" role="button" title="WebDesignesCrow_1-1718770411702.png" alt="WebDesignesCrow_1-1718770411702.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;I'm using JMP 17.2&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 04:15:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-amp-colored-Top-5-highest-value-cell-from-many/m-p/766939#M94702</guid>
      <dc:creator>WebDesignesCrow</dc:creator>
      <dc:date>2024-06-19T04:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to select &amp; colored Top 5 highest value cell from many columns using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-amp-colored-Top-5-highest-value-cell-from-many/m-p/766950#M94703</link>
      <description>&lt;P&gt;How do you wish to deal with ties?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 05:43:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-amp-colored-Top-5-highest-value-cell-from-many/m-p/766950#M94703</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-06-19T05:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to select &amp; colored Top 5 highest value cell from many columns using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-amp-colored-Top-5-highest-value-cell-from-many/m-p/766951#M94704</link>
      <description>&lt;P&gt;Get the column names for all of the columns you are going to seaarch.&lt;/P&gt;
&lt;P&gt;Add a new column that contains the Row number&lt;/P&gt;
&lt;P&gt;Stack all of the columns you want to search.&amp;nbsp; Make sure you keep the Row column&lt;/P&gt;
&lt;P&gt;Sort the stacked data table in descending order of the Data column&lt;/P&gt;
&lt;P&gt;Loop through the first 5 rows of the sorted table and set the cell color in the original table based upon the Label column(column name in original table) and the Row column.&lt;/P&gt;
&lt;P&gt;Delete the stacked and sorted data tables&lt;/P&gt;
&lt;P&gt;Delete the Row column from the original data table&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 05:54:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-amp-colored-Top-5-highest-value-cell-from-many/m-p/766951#M94704</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-06-19T05:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to select &amp; colored Top 5 highest value cell from many columns using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-amp-colored-Top-5-highest-value-cell-from-many/m-p/766952#M94705</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I thought we have formula like =Top(5, column("Type_A"):column("Type_D) &amp;lt;&amp;lt; Color Cell (3);&lt;/P&gt;
&lt;P&gt;Where 5 refers to number of Top values from column Type A to column Type D.&lt;/P&gt;
&lt;P&gt;I will try&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks !&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 06:44:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-amp-colored-Top-5-highest-value-cell-from-many/m-p/766952#M94705</guid>
      <dc:creator>WebDesignesCrow</dc:creator>
      <dc:date>2024-06-19T06:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to select &amp; colored Top 5 highest value cell from many columns using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-amp-colored-Top-5-highest-value-cell-from-many/m-p/766958#M94707</link>
      <description>&lt;P&gt;There is an option using matrices (interactive solution suggested by Jim is much easier to understand and was the first idea that come to my mind also)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

// This table shows how this will behave with ties
// dt = Open("$SAMPLE_DATA/2D Gaussian Process Example.jmp");
// cols_of_interest = {"X1", "X2"};

dt = Open("$SAMPLE_DATA/Pogo Jumps.jmp");
cols_of_interest = {"Yat", "Yee", "Sam"};

m = dt[0, cols_of_interest];
v = Shape(m, N Items(m));
r = Ranking(v); // let Ranking decide our top5
idx = Loc(r &amp;gt; N Items(m) - 5);

vals = J(1, N Items(m), .);
vals[idx] = 1;
vals = Shape(vals, N Items(m) / N Items(cols_of_interest));

For(i = 1, i &amp;lt;= N Cols(vals), i++,
	rows_to_color = Loc(vals[0, i]);
	Column(dt, cols_of_interest[i]) &amp;lt;&amp;lt; Color Cells("Yellow", rows_to_color)
);

Write();
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Pogo Jumps.jmp - Yat, Yee, Sam&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1718781084937.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65393i21ED4FC44AEDC534/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1718781084937.png" alt="jthi_0-1718781084937.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;2D Gaussian Process Example.jmp - X1, X2 (note the behavior with ties)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1718781102953.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65394i4ADF719000029941/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1718781102953.png" alt="jthi_1-1718781102953.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 07:12:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-amp-colored-Top-5-highest-value-cell-from-many/m-p/766958#M94707</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-06-19T07:12:59Z</dc:date>
    </item>
  </channel>
</rss>

