<?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: Maximum value of several variable columns to specific rows in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108082#M39327</link>
    <description>I appreciate your feedback.</description>
    <pubDate>Mon, 28 Jan 2019 12:08:46 GMT</pubDate>
    <dc:creator>Botzal</dc:creator>
    <dc:date>2019-01-28T12:08:46Z</dc:date>
    <item>
      <title>Maximum value of several variable columns to specific rows</title>
      <link>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108081#M39326</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to create a formula column to find the maximum of several variable columns to specific rows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;colList = dt &amp;lt;&amp;lt; get column names;&lt;BR /&gt;colList = remove( colList, 1,2);
Show( colList );

	New Column( "Column 15",
		Numeric,
		Continuous,
		Format( "Best", 8 ),
		Formula( Maximum(colList[1]), colList[2],colList[3] ) ),
		Set Selected
	);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 12:05:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108081#M39326</guid>
      <dc:creator>Botzal</dc:creator>
      <dc:date>2019-01-28T12:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum value of several variable columns to specific rows</title>
      <link>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108082#M39327</link>
      <description>I appreciate your feedback.</description>
      <pubDate>Mon, 28 Jan 2019 12:08:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108082#M39327</guid>
      <dc:creator>Botzal</dc:creator>
      <dc:date>2019-01-28T12:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum value of several variable columns to specific rows</title>
      <link>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108083#M39328</link>
      <description>&lt;P&gt;Below is a script that calculates what you want two different ways.&amp;nbsp; The first, is a correction to your code.&amp;nbsp; Some "(" had to be moved since they were not in the correct place, and also, the As Column() function had to be added to tell JMP to treat the colList[] values as columns.&amp;nbsp; While this code works, if you ever quit JMP and then come back into JMP, the formula would not work, because, there would not be a list called "colList" to use in the formula.&amp;nbsp; So what you really need to use is what I have put in as a new column, "Column 16".&amp;nbsp; Run the script on your data, and then look at the actual formulas for the two columns, and you will see the difference.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

colList = dt &amp;lt;&amp;lt; get column names;
colList = Remove( colList, 1, 2 );
Show( colList );

New Column( "Column 15",
	Numeric,
	Continuous,
	Format( "Best", 8 ),
	Formula(
		Max(
			As Column( colList[1] ),
			As Column( colList[2] ),
			As Column( colList[3] )
		),
		Set Selected
	)
);

Eval(
	Substitute(
			Expr(
				New Column( "Column 16",
					Numeric,
					Continuous,
					Format( "Best", 8 ),
					Formula(
						Max( __col1__, __col2__, __col3__ ),
						Set Selected
					)
				)
			),
		Expr( __col1__ ), Parse( ":" || Char( colList[1] ) ),
		Expr( __col2__ ), Parse( ":" || Char( colList[2] ) ),
		Expr( __col3__ ), Parse( ":" || Char( colList[3] ) )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Jan 2019 13:01:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108083#M39328</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-01-28T13:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum value of several variable columns to specific rows</title>
      <link>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108100#M39334</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thx mate for your quick answer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please, see the answers below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;* The first solution (Colmun 15) it's working good&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;* The second&amp;nbsp;(Colmun 16) not working very well&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 187px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15242i28BA7E560DCF50DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 15:22:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108100#M39334</guid>
      <dc:creator>Botzal</dc:creator>
      <dc:date>2019-01-28T15:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum value of several variable columns to specific rows</title>
      <link>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108129#M39342</link>
      <description>&lt;P&gt;Here is my script, with the only change that it is pointing to the the SAMPLE data table "Blood Presure".&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="column16.PNG" style="width: 948px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15255iF6FE87CE20B85C1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="column16.PNG" alt="column16.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open("$SAMPLE_DATA/Blood Pressure.jmp");

colList = dt &amp;lt;&amp;lt; get column names;
colList = Remove( colList, 1, 2 );
Show( colList );

New Column( "Column 15",
	Numeric,
	Continuous,
	Format( "Best", 8 ),
	Formula(
		Max(
			As Column( colList[1] ),
			As Column( colList[2] ),
			As Column( colList[3] )
		),
		Set Selected
	)
);

Eval(
	Substitute(
			Expr(
				New Column( "Column 16",
					Numeric,
					Continuous,
					Format( "Best", 8 ),
					Formula(
						Max( __col1__, __col2__, __col3__ ),
						Set Selected
					)
				)
			),
		Expr( __col1__ ), Parse( ":" || Char( colList[1] ) ),
		Expr( __col2__ ), Parse( ":" || Char( colList[2] ) ),
		Expr( __col3__ ), Parse( ":" || Char( colList[3] ) )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The issue may be that you have complex column names, that have characters in them that JMP is trying to do calculations on.&amp;nbsp; If that is the case, you need to change the Substitution to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Expr( __col1__ ), Parse( ":Name\!"(" || Char( colList[1] ) || "\!")" ) &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of course, change if for all 3 Substitutions&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 18:28:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108129#M39342</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-01-28T18:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum value of several variable columns to specific rows</title>
      <link>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108433#M39445</link>
      <description>&lt;P&gt;Sorry, but it's still not working (solution 2).&lt;/P&gt;&lt;P&gt;My coulmns names - Date, format -01/30/2019 .&lt;/P&gt;&lt;P&gt;Thx.&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: 480px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15320i1B1B5E74C8B22604/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 224px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15321iC17C495D3CA6F350/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 11:21:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108433#M39445</guid>
      <dc:creator>Botzal</dc:creator>
      <dc:date>2019-01-31T11:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum value of several variable columns to specific rows</title>
      <link>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108442#M39447</link>
      <description>&lt;P&gt;Does the sample code that I provided work, just as I have provided it?&amp;nbsp; It should work without change.&lt;/P&gt;
&lt;P&gt;The error statement indicates that you are having a problem with the recognition of the word "Name" . Could you provide a sample of your data, and your script that is failing?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 12:36:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/108442#M39447</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-01-31T12:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum value of several variable columns to specific rows</title>
      <link>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/254718#M50014</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 am running across a similar issue, but instead of knowing my column length, like op knows his length of 3. How do I modify it so it will do the max of n length?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 23:58:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/254718#M50014</guid>
      <dc:creator>GabeM27</dc:creator>
      <dc:date>2020-03-27T23:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum value of several variable columns to specific rows</title>
      <link>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/254728#M50018</link>
      <description>&lt;P&gt;See the following Discussion&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/How-to-create-a-formula-column-to-find-the-maximum-of-several/m-p/8059#M8053" target="_self"&gt;here.&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 02:36:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Maximum-value-of-several-variable-columns-to-specific-rows/m-p/254728#M50018</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-03-28T02:36:09Z</dc:date>
    </item>
  </channel>
</rss>

