<?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 do use JSL to quickly compare two sets of range columns in order to get the minimum of each column? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-use-JSL-to-quickly-compare-two-sets-of-range-columns-in/m-p/270844#M52719</link>
    <description>&lt;P&gt;Thank Jim!&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jun 2020 23:03:19 GMT</pubDate>
    <dc:creator>lwx228</dc:creator>
    <dc:date>2020-06-04T23:03:19Z</dc:date>
    <item>
      <title>How do use JSL to quickly compare two sets of range columns in order to get the minimum of each column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-use-JSL-to-quickly-compare-two-sets-of-range-columns-in/m-p/270667#M52680</link>
      <description>&lt;P&gt;The title is a bit hard to understand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Take this big class as an example:&lt;BR /&gt;1. First, summarize the average values of "height" and "weight" by age.&lt;BR /&gt;2. Then summarize the median of "height" and "weight" by age.&lt;BR /&gt;3. Then compare the mean and median of "height" and take their minimum.&lt;BR /&gt;Finally, compare the mean and median of "body weight" and take their minimum.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-06-04_09-13.png" style="width: 757px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24368i8A3E3B4A1B16A3C4/image-size/large?v=v2&amp;amp;px=999" role="button" title="2020-06-04_09-13.png" alt="2020-06-04_09-13.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll use the following code and finally loop through to get the minimum.&lt;BR /&gt;Is there any good code that minimizes this comparison?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
d1 = dt &amp;lt;&amp;lt; Summary(
	Group( :age ),
	Mean( :height ),
	Mean( :weight ),
	Median( :height ),
	Median( :weight ),
	Freq( "None" ),
	Weight( "None" ),
	Link to original data table( 0 ),
	statistics column name format( "column" )
);
c = N Col( d1 ) / 2 - 1;
For( i = 1, i &amp;lt;= c, i++,
	ca = Column( i + 2 ) &amp;lt;&amp;lt; Get Name || "0";
	d1 &amp;lt;&amp;lt; New Column( ca, formula( Min( As Column( 2 + i ), As Column( 2 + c + i ) ) ) );
	d1 &amp;lt;&amp;lt; run formulas;
	Column( ca ) &amp;lt;&amp;lt; deleteFormula;
	
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:28:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-use-JSL-to-quickly-compare-two-sets-of-range-columns-in/m-p/270667#M52680</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2023-06-09T23:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do use JSL to quickly compare two sets of range columns in order to get the minimum of each column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-use-JSL-to-quickly-compare-two-sets-of-range-columns-in/m-p/270672#M52681</link>
      <description>&lt;P&gt;This looping method is slow when the number of columns and rows that need to be summarized for comparison is large.&lt;BR /&gt;Is the matrix method faster?Or there are other good ways.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Experts!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 12:19:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-use-JSL-to-quickly-compare-two-sets-of-range-columns-in/m-p/270672#M52681</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2020-06-04T12:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do use JSL to quickly compare two sets of range columns in order to get the minimum of each column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-use-JSL-to-quickly-compare-two-sets-of-range-columns-in/m-p/270674#M52682</link>
      <description>And it's inefficient:&lt;BR /&gt;Min( As Column( 2 + i ), As Column( 2 + c + i ) ) )</description>
      <pubDate>Thu, 04 Jun 2020 12:21:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-use-JSL-to-quickly-compare-two-sets-of-range-columns-in/m-p/270674#M52682</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2020-06-04T12:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do use JSL to quickly compare two sets of range columns in order to get the minimum of each column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-use-JSL-to-quickly-compare-two-sets-of-range-columns-in/m-p/270780#M52708</link>
      <description>&lt;P&gt;Here is a possible quicker solution for you&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dtOrig = open("$SAMPLE_DATA/semiconductor capability.jmp");
colNames = dtOrig &amp;lt;&amp;lt; get column names(continuous);
dt = dtOrig &amp;lt;&amp;lt; Summary(
	Group( :SITE ),
	mean(colnames),median(colnames),
	link to original data table(0)
);

half = N Col( dt ) / 2 - 1;
For( i = 3, i &amp;lt;= half, i++,
	mat = dt[0, i];
	mat = mat || dt[0, i + half];
	v = Transpose( V Min( Transpose( mat ) ) );

	dt &amp;lt;&amp;lt; New Column( "Min" || Substr( Column( dt, i ) &amp;lt;&amp;lt; get name, Contains( Column( dt, i ) &amp;lt;&amp;lt; get name, "(" ) ),
		set values( v )
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Jun 2020 18:22:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-use-JSL-to-quickly-compare-two-sets-of-range-columns-in/m-p/270780#M52708</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-06-04T18:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do use JSL to quickly compare two sets of range columns in order to get the minimum of each column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-use-JSL-to-quickly-compare-two-sets-of-range-columns-in/m-p/270844#M52719</link>
      <description>&lt;P&gt;Thank Jim!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 23:03:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-use-JSL-to-quickly-compare-two-sets-of-range-columns-in/m-p/270844#M52719</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2020-06-04T23:03:19Z</dc:date>
    </item>
  </channel>
</rss>

