<?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: Top 3 cell values in every column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56150#M31514</link>
    <description>&lt;P&gt;The column rank function (and some IF statements) might do the trick.&lt;/P&gt;</description>
    <pubDate>Mon, 30 Apr 2018 16:07:04 GMT</pubDate>
    <dc:creator>dale_lehman</dc:creator>
    <dc:date>2018-04-30T16:07:04Z</dc:date>
    <item>
      <title>How to select the highest three cell values in every column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56145#M31510</link>
      <description>&lt;P&gt;For every column that contains a word, say "Prediction", I want to extract top 3 cell values either greater than 5 or greater than 4.5 (if I get 3 numbers above 5 then I dont want any numbers above 4.5) in a list. Further, picking&amp;nbsp;the one that is farthest away from 5 and hide the corresponding cell value in its raw table. For example, in this example table given below:&lt;/P&gt;
&lt;P&gt;In Prediction B column, I want to store 6.6, 5.3 and 5. And hide the cell adjacent to Prediction B nut in Column B i.e. cell value 65.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 667px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10586i04F8093AB21FE14A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code selects columns which have the string "Prediction" in it.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
a = "Prediction";
col = dt &amp;lt;&amp;lt; get column names( string );
nc = N Items( col );
For( i = 1, i &amp;lt;= nc, i++,
	If( Contains( col[i], a ), )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How can I choose the top 3 cells greater than 5 or 4.5? Thank you so much JMP community for being so prompt.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 18:37:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56145#M31510</guid>
      <dc:creator>amy</dc:creator>
      <dc:date>2018-08-16T18:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56150#M31514</link>
      <description>&lt;P&gt;The column rank function (and some IF statements) might do the trick.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 16:07:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56150#M31514</guid>
      <dc:creator>dale_lehman</dc:creator>
      <dc:date>2018-04-30T16:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56183#M31536</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/1701"&gt;@dale_lehman&lt;/a&gt;&amp;nbsp;well, I couldn't find much on how I can use the column rank function. I can extract out one maximum value but I still can't figure how I can go ahead with top 3.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 13:37:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56183#M31536</guid>
      <dc:creator>amy</dc:creator>
      <dc:date>2018-05-01T13:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56188#M31539</link>
      <description>&lt;P&gt;I've attached your example with an attempt to use the column B predictions as you specified.&amp;nbsp; I'm not sure this does exactly what you want, but I think it is close.&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 14:29:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56188#M31539</guid>
      <dc:creator>dale_lehman</dc:creator>
      <dc:date>2018-05-01T14:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56236#M31566</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/1701"&gt;@dale_lehman&lt;/a&gt;&amp;nbsp;Thanks for the help. I have updated my script to select the maximum value of every column and have saved it in the "val" variable. Do you know how I can exclude the cell with the maximum number in the first column, perform some operations then exclude the cell with maximum number in second column and so forth?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
col = dt &amp;lt;&amp;lt; get column names( string );
nc = N Items( col );
For( i = 1, i &amp;lt;= nc, i++,
	Col1 = Column( dt, i );
	If( Contains( col[i], "Prediction" ),
		Show( col[i] );
		val = Abs( Col Max( Col1 ) );
		Show( val );
		MaxRow = dt &amp;lt;&amp;lt; get rows where( As Column( Col1 ) == Abs( Col Max( Col1 ) ) );
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 14:22:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56236#M31566</guid>
      <dc:creator>amy</dc:creator>
      <dc:date>2018-05-02T14:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56238#M31568</link>
      <description>&lt;P&gt;I don't do much scripting so I'll leave that for someone else to help you with.&amp;nbsp; I'll only say that I don't really understand the reason to want to exclude rows after doing these operations - it would seem better to create new columns with those rows either excluded or set to missing.&amp;nbsp; I would think that script would be relatively straightforward and I don't like the idea of overwriting the original data (if that is what you are suggesting).&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 13:27:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56238#M31568</guid>
      <dc:creator>dale_lehman</dc:creator>
      <dc:date>2018-05-02T13:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56244#M31573</link>
      <description>&lt;P&gt;This is a way of checking for data that needs to be removed from my analysis so I have to do it the same way. Thanks a lot for all the help I really appreciate it&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/1701"&gt;@dale_lehman&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 14:03:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56244#M31573</guid>
      <dc:creator>amy</dc:creator>
      <dc:date>2018-05-02T14:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56250#M31575</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11708"&gt;@amy&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Are you looking to exclude the entire row or the row for that column only ? The reason I ask, I am pretty sure you can exlude the whole row by using:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Exclude ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; However, if you just want to exclude the row in a column, I dont think it is possible. So why don't you try to store the row numbers into a variable and then exclude those rows ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 14:46:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56250#M31575</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-05-02T14:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56254#M31576</link>
      <description>&lt;P&gt;I don't even want to exclude an entire row. I want to exclude only cells. For Example, in the table I have posted, I want to be able to exclude the cell in column "B" that is adjacent to the cell that has value 6.6 in column "Prediction B". I am still struggling to figure how I can use regex to match such strings. I have made 2 lists, one which contains col names that have the word "Prediction" in them and another that dont. I would appreciate if you could also point me out to any function you think would work out best with such type of tables. I have just started working with JSL and I am still struggling with it. Thanks in advance for the help.&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&lt;/P&gt;&lt;P&gt;P.S: Does that mean there is no way I can exclude a single cell from a column in JSL?&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 15:06:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56254#M31576</guid>
      <dc:creator>amy</dc:creator>
      <dc:date>2018-05-02T15:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56255#M31577</link>
      <description>&lt;P&gt;In JMP you do not "Exclude" an individual cell, rather, you set the cell's value to a "Missing Value".&amp;nbsp; The Missing Value's symbol is "."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of if the column is of a character Data Type, you set the value to ""&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 15:18:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56255#M31577</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-05-02T15:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56256#M31578</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;Well, after setting the value of a cell to missing value/ hide/ exclude a cell's value, I would want to run some models onthe data table and then decide to either keep it that way or include the value to the cell again. Is this possible?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 15:20:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56256#M31578</guid>
      <dc:creator>amy</dc:creator>
      <dc:date>2018-05-02T15:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56257#M31579</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11708"&gt;@amy&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table(); 
SearchTerm = "Prediction"; 
ColNames = dt &amp;lt;&amp;lt; Get Column Names("String"); 
DesRowsList = {}; 
for(i = 1, i &amp;lt;= N Cols(dt), i++,
		If(Contains(ColNames[i],SearchTerm),
			SR = dt &amp;lt;&amp;lt; Select Where(As Column(dt,ColNames[i]) &amp;gt; 4.5) &amp;lt;&amp;lt; Get Selected Rows; 
			Insert Into(DesRowsList,SR); 
			dt &amp;lt;&amp;lt; Clear Select; 
		  );
   );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This should help you get the rows that meet your condition into one list. From there you should be able to extract top 3 in each case. To answer your question, I am not aware of excluding only cells&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 15:23:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56257#M31579</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-05-02T15:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56258#M31580</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11708"&gt;@amy&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;You can always subset tables, rather than trying to include individual cells.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 15:24:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56258#M31580</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-05-02T15:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56259#M31581</link>
      <description>&lt;P&gt;There is not a direct way to retireve a cell value once it has been set to Missing.&amp;nbsp; That is the reason that&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/1701"&gt;@dale_lehman&lt;/a&gt;&amp;nbsp;suggested using new columns and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&amp;nbsp;suggests to create a new subset of the data, and then to modify the subset.&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 15:28:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56259#M31581</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-05-02T15:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56260#M31582</link>
      <description>&lt;P&gt;Okay, thank you for helping out.&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 15:33:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56260#M31582</guid>
      <dc:creator>amy</dc:creator>
      <dc:date>2018-05-02T15:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56266#M31584</link>
      <description>&lt;P&gt;Also, is there a way I can match columns like B and Prediction B? Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 16:24:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56266#M31584</guid>
      <dc:creator>amy</dc:creator>
      <dc:date>2018-05-02T16:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56268#M31586</link>
      <description>&lt;P&gt;Use the Loc() function instead of the Contains() function to specify specific strings.&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 16:36:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56268#M31586</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-05-02T16:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Top 3 cell values in every column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56269#M31587</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;I could do that using regex:&amp;nbsp;match = regex(colstrings, "[{,]\s*([^{,}]*Prediction[^{,}]*)[,}]", "\1");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 17:49:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-the-highest-three-cell-values-in-every-column/m-p/56269#M31587</guid>
      <dc:creator>amy</dc:creator>
      <dc:date>2018-05-02T17:49:07Z</dc:date>
    </item>
  </channel>
</rss>

