<?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 can I select rows that are the same based on one (first) column but different based on another column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-can-I-select-rows-that-are-the-same-based-on-one-first/m-p/809251#M98897</link>
    <description>&lt;P&gt;The function&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;dt &amp;lt;&amp;lt; Select Where()&lt;/P&gt;
&lt;P&gt;will select all of the rows that match the specified condition all at once, which will eliminate the second For() loop.&amp;nbsp; It will be far more efficient also.&amp;nbsp; Below is an example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = 
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );

For Each Row(
	currHt = :height[Row()];
	currWt = :weight[Row()];

	dt &amp;lt;&amp;lt; select where( :height == currHt &amp;amp; :weight != currWt, current selection( "extend" ) );

);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 30 Oct 2024 09:48:08 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2024-10-30T09:48:08Z</dc:date>
    <item>
      <title>How can I select rows that are the same based on one (first) column but different based on another column</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-select-rows-that-are-the-same-based-on-one-first/m-p/809245#M98893</link>
      <description>&lt;P&gt;Hi everyone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to formulate a script (JMP 13) that will allow me to isolate records (rows) that are the same based on one column but different based on another column. In more detail, I have made two observations/measurements on the same sample but for some samples the outcome is different. How can I isolate these cases? I have tried this (and I am likely missing something very basic - apologies :(&lt;/img&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Assume the columns are "ColumnA" and "ColumnB"
dt = Current Data Table(); // Reference the current data table

// Loop through each row and compare values in the specified columns
For(i = 1, i &amp;lt;= N Row(dt), i++, 
// Compare with every other row to find matches on ColumnA but differences on ColumnB
	For(j = i + 1, j &amp;lt;= N Row(dt), j++,
		If(dt:ColumnA[i] == dt:ColumnA[j] &amp;amp; dt:ColumnB[i] != dt:ColumnB[j],
			dt &amp;lt;&amp;lt; Select Row(i);
			dt &amp;lt;&amp;lt; Select Row(j);
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assistance with this problem will be greatly appreciate.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 09:08:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-select-rows-that-are-the-same-based-on-one-first/m-p/809245#M98893</guid>
      <dc:creator>robin_preston_d</dc:creator>
      <dc:date>2024-10-30T09:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can I select rows that are the same based on one (first) column but different based on another column</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-select-rows-that-are-the-same-based-on-one-first/m-p/809251#M98897</link>
      <description>&lt;P&gt;The function&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;dt &amp;lt;&amp;lt; Select Where()&lt;/P&gt;
&lt;P&gt;will select all of the rows that match the specified condition all at once, which will eliminate the second For() loop.&amp;nbsp; It will be far more efficient also.&amp;nbsp; Below is an example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = 
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );

For Each Row(
	currHt = :height[Row()];
	currWt = :weight[Row()];

	dt &amp;lt;&amp;lt; select where( :height == currHt &amp;amp; :weight != currWt, current selection( "extend" ) );

);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Oct 2024 09:48:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-select-rows-that-are-the-same-based-on-one-first/m-p/809251#M98897</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-10-30T09:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can I select rows that are the same based on one (first) column but different based on another column</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-select-rows-that-are-the-same-based-on-one-first/m-p/809253#M98899</link>
      <description>&lt;P&gt;Excellent, thanks so much Jim.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 09:57:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-select-rows-that-are-the-same-based-on-one-first/m-p/809253#M98899</guid>
      <dc:creator>robin_preston_d</dc:creator>
      <dc:date>2024-10-30T09:57:39Z</dc:date>
    </item>
  </channel>
</rss>

