<?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 the Max difference between two tests by counting number of cells between events. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-find-the-Max-difference-between-two-tests-by-counting/m-p/586693#M79222</link>
    <description>&lt;P&gt;First, it checks to see if there is a column called "CellNum" and if not, create it.&lt;/P&gt;
&lt;P&gt;Second, set the values for the column.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jan 2023 17:40:49 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2023-01-04T17:40:49Z</dc:date>
    <item>
      <title>How to find the Max difference between two tests by counting number of cells between events.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-the-Max-difference-between-two-tests-by-counting/m-p/586313#M79194</link>
      <description>&lt;P&gt;I have attached a mini file.&lt;/P&gt;&lt;P&gt;If the cell of a lot passes TEST 1 and TEST 2 its status is PASS.&lt;/P&gt;&lt;P&gt;If a cell fails TEST 1 and TEST 2 its status is SAME.&lt;/P&gt;&lt;P&gt;If a cell fails a test but passes the other test its status is DIFF.&lt;/P&gt;&lt;P&gt;For each lot I am trying to determine the Max distance by cell count from a DIFF to its nearest SAME.&lt;/P&gt;&lt;P&gt;What would be the best way to go about this?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Fiona&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 16:44:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-the-Max-difference-between-two-tests-by-counting/m-p/586313#M79194</guid>
      <dc:creator>fionaweston</dc:creator>
      <dc:date>2023-06-08T16:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the Max difference between two tests by counting number of cells between events.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-the-Max-difference-between-two-tests-by-counting/m-p/586363#M79196</link>
      <description>&lt;P&gt;Here is a little script that calculates the new columns you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
dt &amp;lt;&amp;lt; New Column( "Calculated Status",
	character,
	set each value(
		If(
			:Test 1 || :Test 2 == "PP", "PASS",
			:Test 1 || :Test 2 == "FF", "SAME",
			"DIFF"
		)
	)
);


If( Try( dt:cellNum &amp;lt;&amp;lt; get name, "" ) == "",
	dt &amp;lt;&amp;lt; New Column( "cellNum" )
);
dt:cellNum &amp;lt;&amp;lt; set each value( Num( :CELL ) );

dt &amp;lt;&amp;lt; New Column( "Calculated Distance",
	set each value(
		If( :Calculated Status == "DIFF",
			currLot = :LOT;
			cells = dt:cellNum[dt &amp;lt;&amp;lt;
			get rows where(
				:LOT == currLot &amp;amp; :Calculated Status == "SAME"
			)];
			dif = Min( Abs( Num( :CELL ) - cells ) );
		,
			dif = .
		)
	)
);

dt &amp;lt;&amp;lt; delete columns( "cellNum" );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1672803697063.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/48786i969C0BA51D69F24C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1672803697063.png" alt="txnelson_0-1672803697063.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 03:41:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-the-Max-difference-between-two-tests-by-counting/m-p/586363#M79196</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-01-04T03:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the Max difference between two tests by counting number of cells between events.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-the-Max-difference-between-two-tests-by-counting/m-p/586643#M79214</link>
      <description>&lt;P&gt;Thanks Jim, this is perfect.&lt;/P&gt;&lt;P&gt;Can you explain what is happening at part of script below?&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;If( Try( dt:cellNum &amp;lt;&amp;lt; get name, "" ) == "",
	dt &amp;lt;&amp;lt; New Column( "cellNum" )
);
dt:cellNum &amp;lt;&amp;lt; set each value( Num( :CELL ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 16:21:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-the-Max-difference-between-two-tests-by-counting/m-p/586643#M79214</guid>
      <dc:creator>fionaweston</dc:creator>
      <dc:date>2023-01-04T16:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the Max difference between two tests by counting number of cells between events.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-the-Max-difference-between-two-tests-by-counting/m-p/586693#M79222</link>
      <description>&lt;P&gt;First, it checks to see if there is a column called "CellNum" and if not, create it.&lt;/P&gt;
&lt;P&gt;Second, set the values for the column.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 17:40:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-the-Max-difference-between-two-tests-by-counting/m-p/586693#M79222</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-01-04T17:40:49Z</dc:date>
    </item>
  </channel>
</rss>

