<?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: Max value of each row across multiple columns and the corresponding name of the source column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35699#M21062</link>
    <description>&lt;P&gt;The script and data table worked great for me.&amp;nbsp; Now, I did change the&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;     dt=Open("........");
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;     dt=current data table();
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since the table was already open.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, I would suggest that you try that, or that you place an additional statement after your dt=Open statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;     wait(0);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There is a chance that your data table has not finished before the For Each Row starts.&amp;nbsp; The Wait(0); will force the open to complete before running the For Each Row&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jun 2018 15:21:10 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2018-06-05T15:21:10Z</dc:date>
    <item>
      <title>Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35640#M21015</link>
      <description>&lt;P&gt;Hi, is there an easy way to find the max value of each row and the column name (or parameter) corresponding to the max value? Below is a simple example to illustrate the request:&lt;/P&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4&lt;/TD&gt;&lt;TD&gt;36.4&lt;/TD&gt;&lt;TD&gt;36.1&lt;/TD&gt;&lt;TD&gt;36.7&lt;/TD&gt;&lt;TD&gt;39&lt;/TD&gt;&lt;TD&gt;38&lt;/TD&gt;&lt;TD&gt;38.3&lt;/TD&gt;&lt;TD&gt;39&lt;/TD&gt;&lt;TD&gt;T8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;38&lt;/TD&gt;&lt;TD&gt;35.1&lt;/TD&gt;&lt;TD&gt;35.1&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;34.1&lt;/TD&gt;&lt;TD&gt;34.5&lt;/TD&gt;&lt;TD&gt;34.8&lt;/TD&gt;&lt;TD&gt;33.8&lt;/TD&gt;&lt;TD&gt;36.4&lt;/TD&gt;&lt;TD&gt;37&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;T4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 06:44:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35640#M21015</guid>
      <dc:creator>ILoveJMP</dc:creator>
      <dc:date>2017-02-10T06:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35643#M21017</link>
      <description>Looking for the exact same solution.&lt;BR /&gt;For each row find max value and return column name so i can run statistics on the resultant data.&lt;BR /&gt;Eg to find how many times a column name shows up as maximum, the number of columns that contribute to max value, the STD DEV etc.</description>
      <pubDate>Fri, 10 Feb 2017 11:23:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35643#M21017</guid>
      <dc:creator>DataMojo</dc:creator>
      <dc:date>2017-02-10T11:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35647#M21020</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// this example uses JMP 13 data table indexing

dt = New Table( "Untitled",
    New Column( "a", Numeric, Set Values( [1, 33, 1] ) ),
    New Column( "b", Numeric, Set Values( [2, 2, 2] ) ),
    New Column( "c", Numeric, Set Values( [333, 1, 0] ) ),
    New Column( "maxval", numeric ),
    New Column( "maxcol", Numeric )
);

colnames = dt &amp;lt;&amp;lt; getcolumnnames;

For Each Row(
    r = Row();
    // 1::3 means columns 1 through 3.  {a,b,c} would also work.
    location = Loc Max( dt[ r, 1 :: 3] ); // location of maximum value in array
    maxval = dt[r, location];
    maxcol = colnames[location] &amp;lt;&amp;lt; getname;
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Data table with maximum value from row and name of maximum column for row" style="width: 849px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/5099iB5A0239A70F684C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="maxcol.PNG" alt="Data table with maximum value from row and name of maximum column for row" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Data table with maximum value from row and name of maximum column for row&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Uncharted/Data-table-subscripting/ba-p/21013" target="_blank"&gt;Earlier post on data table subscripting&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 13:03:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35647#M21020</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-02-10T13:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35675#M21043</link>
      <description>&lt;P&gt;I have run into one issue here, if the columns I need to choose are between the data set it doesnt seem to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="token function"&gt;For Each Row&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;
    r &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Row&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="token comment"&gt;// 1::3 means columns 1 through 3.  {a,b,c} would also work.&lt;/SPAN&gt;
    location &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Loc Max&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; dt&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt; r&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; 57 &lt;SPAN class="token punctuation"&gt;:&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;:&lt;/SPAN&gt; 11&lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token comment"&gt;// location of maximum value in array&lt;/SPAN&gt;
    maxval &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; dt&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;r&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; location&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
    maxcol &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; colnames&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;location&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt; getname&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to choose columns 57 through 113, but for some reason when I do this it through the script off and i get incorrect values.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2017 00:59:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35675#M21043</guid>
      <dc:creator>DataMojo</dc:creator>
      <dc:date>2017-02-11T00:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35676#M21044</link>
      <description>&lt;P&gt;Resolved i was missing the offset of columns that had to be added to the location variable.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2017 01:41:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35676#M21044</guid>
      <dc:creator>DataMojo</dc:creator>
      <dc:date>2017-02-11T01:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35677#M21045</link>
      <description>&lt;P&gt;Good point. The example could be generalized like this (intentionally ugly column arrangment...) Pick one of the either/or that works best for you. The 2nd one has the advantage of isolating you from accidental rearrangements of the columns. The first one might be good for 100s of columns.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "Untitled",
    New Column( "maxval", numeric ),
    New Column( "a", Numeric, Set Values( [1, 33, 1] ) ),
    New Column( "maxcol", Numeric ),
    New Column( "b", Numeric, Set Values( [2, 2, 2] ) ),
    New Column( "c", Numeric, Set Values( [333, 1, 0] ) ),
);


// either
vars = [2 4 5];
colnames = (dt &amp;lt;&amp;lt; getcolumnnames)[vars];
// or
colnames={a,b,c}; // this might be best choice


For Each Row(
    row = Row();
    location = Loc Max( dt[ row, colnames] ); // location of maximum value in array
    col = colnames[location]&amp;lt;&amp;lt;getname;
    maxval = dt[row, col];
    maxcol = col;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Feb 2017 03:27:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35677#M21045</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-02-11T03:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35698#M21061</link>
      <description>&lt;P&gt;It still doesn't work properly for me. Attached please find both the script and the data files. Could you please let me know what I did wrong here?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 03:09:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35698#M21061</guid>
      <dc:creator>ILoveJMP</dc:creator>
      <dc:date>2017-02-13T03:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35699#M21062</link>
      <description>&lt;P&gt;The script and data table worked great for me.&amp;nbsp; Now, I did change the&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;     dt=Open("........");
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;     dt=current data table();
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since the table was already open.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, I would suggest that you try that, or that you place an additional statement after your dt=Open statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;     wait(0);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There is a chance that your data table has not finished before the For Each Row starts.&amp;nbsp; The Wait(0); will force the open to complete before running the For Each Row&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 15:21:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35699#M21062</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-06-05T15:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35700#M21063</link>
      <description>&lt;P&gt;Thanks much Jim for the reply! However, it still doesn't work for me with&amp;nbsp;&lt;SPAN&gt;dt=current data table(). Not sure what is going on. BTW, could you send me the output file you generated?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 04:27:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35700#M21063</guid>
      <dc:creator>ILoveJMP</dc:creator>
      <dc:date>2017-02-13T04:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35701#M21064</link>
      <description>&lt;P&gt;Here is the data table after I ran the script&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 05:01:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35701#M21064</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-02-13T05:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35702#M21065</link>
      <description>&lt;P&gt;I have seen some errors which is suspect due to caching. The only way i have gotten around these is by restarting my OS and not JMP itself.&lt;/P&gt;&lt;P&gt;Could you run the updated script but after a restart of the OS and check ?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 05:17:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35702#M21065</guid>
      <dc:creator>DataMojo</dc:creator>
      <dc:date>2017-02-13T05:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35703#M21066</link>
      <description>&lt;P&gt;Thanks Jim! This is what I got and the output isn't correct, for instance, row #1 and #2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 06:11:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35703#M21066</guid>
      <dc:creator>ILoveJMP</dc:creator>
      <dc:date>2017-02-13T06:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35704#M21067</link>
      <description>&lt;P&gt;Thanks Jim! This is what I got and the output isn't correct, for instance, row #1 and #2.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 06:12:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35704#M21067</guid>
      <dc:creator>ILoveJMP</dc:creator>
      <dc:date>2017-02-13T06:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35709#M21071</link>
      <description>&lt;P&gt;OK....my error, I was thinking you were not able to get the code to run, not that you were getting invalid results. &amp;nbsp;The issue is that your list of columns, "colnames" isn't matching the list of columns you are doing the Loc Max on. &amp;nbsp;The first and second column names need to be stripped off of the "colnames" list. &amp;nbsp;The issue also then caused a problem in getting the MaxVal using the statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;MaxVal = dt[r, location];&lt;/P&gt;
&lt;P&gt;since it would be looking at the entire data table, and the location it was returning is based upon a matrix that has 2 less columns than the data table has.&lt;/P&gt;
&lt;P&gt;So I have done a simple rewrite showing one way to over come the issue&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "C:/data.jmp" );
colnames = dt &amp;lt;&amp;lt; getcolumnnames;
For( i = 2, i &amp;gt;= 0, i--,
	colnames = Remove( colnames, i, 1 )
);
For Each Row(
	r = Row();
	location = Loc Max( dt[r, 3 :: 25] ); // location of maximum value in array from Col #3 to #25
	//MaxVal = dt[r, location];
	MaxVal_Col = colnames[location] &amp;lt;&amp;lt; getname;
	MaxVal = as column(eval(MaxVal_Col));
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Feb 2017 12:38:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35709#M21071</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-02-13T12:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35729#M21087</link>
      <description>&lt;P&gt;Thanks Jim again! However, if you exam the output, I think you will notice it isn't correct.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 20:06:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35729#M21087</guid>
      <dc:creator>ILoveJMP</dc:creator>
      <dc:date>2017-02-13T20:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35733#M21090</link>
      <description>&lt;P&gt;&lt;SPAN&gt;OK, I am missing something.....attached is my output. &amp;nbsp;When I check the results, the column MaxVal contains the maximum value found in that row columns 3-25, and the MaxVal_Col is the name of the column where the max value was found.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What am I missing?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 21:20:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/35733#M21090</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-02-13T21:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/38635#M22610</link>
      <description>&lt;P&gt;Hi Craige,&lt;/P&gt;&lt;P&gt;When I run your sample script in JMP 10, I get an error message that says - argument should be matrix{1} in access or evaluation of 'Loc Max' , Bad Argument ...&lt;/P&gt;&lt;P&gt;Is data table indexing not allowed in JMP10?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 23:04:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/38635#M22610</guid>
      <dc:creator>ravi_sasjmp</dc:creator>
      <dc:date>2017-04-28T23:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/38637#M22612</link>
      <description>&lt;P&gt;The data table subscripting is new in JMP 13.&lt;/P&gt;
&lt;P&gt;You can try something like this idea to build an expression that will create a row vector matrix from the current row when evaluated.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "Untitled",
    Add Rows( 3 ),
    New Column( "first", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1, 5, 9] ) ),
    New Column( "second", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [2, 6, 10] ) ),
    New Column( "skip", character, setvalues( {"a", "b", "c"} ) ),
    New Column( "third", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [3, 7, 11] ) ),
    New Column( "fourth", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [4, 8, 12] ) )
);

names = dt &amp;lt;&amp;lt; getcolumnnames( "numeric" ); // returns a list of all numeric column names
Show( names ); // {first, second, third, fourth}
Substitute Into( names, Expr( {} ), Expr( Concat() ) );
Show( Name Expr( names ) ); // first || second || third || fourth

Row() = 2; // names will pull data from the current row
rowvec = (Eval( names )); // [5 6 7 8]&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Given a list of row names, the Substitute Into() function replaces the curly bracket list operator with the concat function. Concat function is the same as the || concatenation operator and can take a lot of arguments. The concatenation evaluates each column reference in the list for the current row. The individual scalar values are concatenated into the row matrix.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Apr 2017 01:01:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/38637#M22612</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-04-29T01:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/38646#M22616</link>
      <description>&lt;P&gt;Is there anything wrong with using the IFMax function in a new column?&amp;nbsp; I realize that if the number of columns is large, this is unweildy, but if there are only 20 columns or less, it is pretty simple to just enter the IFMax formula.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Apr 2017 11:31:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/38646#M22616</guid>
      <dc:creator>dale_lehman</dc:creator>
      <dc:date>2017-04-29T11:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Max value of each row across multiple columns and the corresponding name of the source column</title>
      <link>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/38647#M22617</link>
      <description>&lt;P&gt;(looking up IFMax...) yes, that would be way easier to explain if you can easily list out the columns. Possibly faster too. Thanks for pointing it out!&lt;/P&gt;</description>
      <pubDate>Sat, 29 Apr 2017 12:35:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Max-value-of-each-row-across-multiple-columns-and-the/m-p/38647#M22617</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-04-29T12:35:22Z</dc:date>
    </item>
  </channel>
</rss>

