<?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 find max/min values from columns with certain keyword in the column names in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-find-max-min-values-from-columns-with-certain-keyword-in/m-p/847446#M102224</link>
    <description>&lt;P&gt;Hi Jim,&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution gets the max value on those column for the entire number of rows. I am looking for the script to have the column max value populated for each row separately (the number of rows will also differ based on the dataset). Expecting output for each row as in the highlighted column. Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ssg_0-1741744300825.png" style="width: 860px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/73776i692D742639C334DA/image-dimensions/860x43?v=v2" width="860" height="43" role="button" title="ssg_0-1741744300825.png" alt="ssg_0-1741744300825.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Mar 2025 01:54:12 GMT</pubDate>
    <dc:creator>ssg</dc:creator>
    <dc:date>2025-03-12T01:54:12Z</dc:date>
    <item>
      <title>How to find max/min values from columns with certain keyword in the column names</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-max-min-values-from-columns-with-certain-keyword-in/m-p/847288#M102191</link>
      <description>&lt;P&gt;Hi, I am trying to process data sets to find the max values of certain columns(based on certain keyword in the column names). The number of columns may differ for each data set, but the column name "keywords" will remain the same. Trying to create a script that could work on different data sets.&amp;nbsp;Below is a simple example of a data table to illustrate it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Row&lt;/TD&gt;&lt;TD&gt;data1_volt_grp1&lt;/TD&gt;&lt;TD&gt;data1_volt_grp2&lt;/TD&gt;&lt;TD&gt;data2_volt_grp1&lt;/TD&gt;&lt;TD&gt;data2_volt_grp2&lt;/TD&gt;&lt;TD&gt;data_current_A_grp1&lt;/TD&gt;&lt;TD&gt;data_current_A_grp2&lt;/TD&gt;&lt;TD&gt;data2_current_A_grp1&lt;/TD&gt;&lt;TD&gt;data2_current_A_grp2&lt;/TD&gt;&lt;TD&gt;max_volt_grp1&lt;/TD&gt;&lt;TD&gt;max_current_grp2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;0.5&lt;/TD&gt;&lt;TD&gt;0.8&lt;/TD&gt;&lt;TD&gt;0.7&lt;/TD&gt;&lt;TD&gt;0.2&lt;/TD&gt;&lt;TD&gt;1.2&lt;/TD&gt;&lt;TD&gt;1.4&lt;/TD&gt;&lt;TD&gt;0.9&lt;/TD&gt;&lt;TD&gt;1.8&lt;/TD&gt;&lt;TD&gt;0.7&lt;/TD&gt;&lt;TD&gt;1.8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;0.6&lt;/TD&gt;&lt;TD&gt;0.9&lt;/TD&gt;&lt;TD&gt;0.3&lt;/TD&gt;&lt;TD&gt;0.4&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1.1&lt;/TD&gt;&lt;TD&gt;1.5&lt;/TD&gt;&lt;TD&gt;0.8&lt;/TD&gt;&lt;TD&gt;0.6&lt;/TD&gt;&lt;TD&gt;1.1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Need to find max values of columns with column name consisting&amp;nbsp; volt &amp;amp; grp1 in the naming. And populate this data in new column "max_volt_grp1".&lt;/P&gt;&lt;P&gt;2. Need to find max values of columns with column name consisting&amp;nbsp; current &amp;amp; grp2 in the naming.&amp;nbsp;And populate this data in new column "max_current_grp2".&lt;/P&gt;&lt;P&gt;3.&amp;nbsp;The outcome expected are on the last 2 columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 09:05:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-max-min-values-from-columns-with-certain-keyword-in/m-p/847288#M102191</guid>
      <dc:creator>ssg</dc:creator>
      <dc:date>2025-03-11T09:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to find max/min values from columns with certain keyword in the column names</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-max-min-values-from-columns-with-certain-keyword-in/m-p/847315#M102198</link>
      <description>&lt;P&gt;Here is how I would do this to create column Max_volt_grp&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1741697711040.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/73740i082CC73C0705CA3E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1741697711040.png" alt="txnelson_0-1741697711040.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
colNames = dt &amp;lt;&amp;lt; get column names( string );
valueMatrix = [];
//col = "data1_volt_grp1"
For Each( {col}, colNames,
	If( Contains( col, "volt" ) &amp;amp; Contains( col, "grp1" ),
		valueMatrix = valueMatrix |/ Matrix( Column( col ) &amp;lt;&amp;lt; get values )
	)
);
If( Length( valueMatrix ) &amp;gt; 0,
	dt &amp;lt;&amp;lt; New Column( "Max_volt_grp1" );
	:Max_volt_grp1[1] = Max( valueMatrix );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Mar 2025 12:55:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-max-min-values-from-columns-with-certain-keyword-in/m-p/847315#M102198</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-03-11T12:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to find max/min values from columns with certain keyword in the column names</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-max-min-values-from-columns-with-certain-keyword-in/m-p/847446#M102224</link>
      <description>&lt;P&gt;Hi Jim,&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution gets the max value on those column for the entire number of rows. I am looking for the script to have the column max value populated for each row separately (the number of rows will also differ based on the dataset). Expecting output for each row as in the highlighted column. Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ssg_0-1741744300825.png" style="width: 860px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/73776i692D742639C334DA/image-dimensions/860x43?v=v2" width="860" height="43" role="button" title="ssg_0-1741744300825.png" alt="ssg_0-1741744300825.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 01:54:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-max-min-values-from-columns-with-certain-keyword-in/m-p/847446#M102224</guid>
      <dc:creator>ssg</dc:creator>
      <dc:date>2025-03-12T01:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to find max/min values from columns with certain keyword in the column names</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-max-min-values-from-columns-with-certain-keyword-in/m-p/847495#M102228</link>
      <description>&lt;P&gt;My mistake, try this method.&amp;nbsp; I don't like using this Eval(Parse()) methodology, but it was the only way I could make it work.&lt;/P&gt;
&lt;P&gt;The code creates a character string that contains the JSL required to create the new column, and then runs the JSL&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
colNames = dt &amp;lt;&amp;lt; get column names( string );

// Build a list of the columns to be evaluated
theCols = "";
For Each( {col}, colNames,
	If( Contains( col, "volt" ) &amp;amp; Contains( col, "grp1" ),
		theCols = theCols || ", :" || col
	)
);

// Create the new column and formula command, adding in the list of
// columns ceated in the above loop and then executing it
Eval(
	Parse(
		"dt &amp;lt;&amp;lt; new column(\!"max_volt_grp1\!",formula(Max(" ||
		Substr( theCols, 2 ) || ")));"
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Mar 2025 12:46:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-max-min-values-from-columns-with-certain-keyword-in/m-p/847495#M102228</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-03-12T12:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to find max/min values from columns with certain keyword in the column names</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-max-min-values-from-columns-with-certain-keyword-in/m-p/847650#M102251</link>
      <description>&lt;P&gt;Thanks Jim. The scripts works as expected.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 08:23:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-max-min-values-from-columns-with-certain-keyword-in/m-p/847650#M102251</guid>
      <dc:creator>ssg</dc:creator>
      <dc:date>2025-03-13T08:23:13Z</dc:date>
    </item>
  </channel>
</rss>

