<?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: Re-binning based on new spec limits in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/333537#M58161</link>
    <description>&lt;P&gt;I am not aware of a JMP binning tool based upon Spec Limits, but here is a very efficient piece of code that does the binning.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

colNames = dt &amp;lt;&amp;lt; get column names( continuous, string );

For( i = 1, i &amp;lt;= N Items( colNames ), i++,
	Clear Symbols( specs );
	specs = Column( dt, colNames[i] ) &amp;lt;&amp;lt; get property( "Spec Limits" );
	If( Is Empty( specs ) == 0,
		dt &amp;lt;&amp;lt; New Column( colNames[i] || " Pass_Fail", character, set each value( "Fail" ) );
		theRows = dt &amp;lt;&amp;lt; get rows where( Eval( specs["LSL"] ) &amp;lt;= As Column( dt, colNames[i] ) &amp;lt;= Eval( specs["USL"] ) );
		If( N Rows( theRows ),
			Column( dt, colNames[i] || " Pass_Fail" )[theRows] = "Pass"
		);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 13 Nov 2020 22:54:21 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2020-11-13T22:54:21Z</dc:date>
    <item>
      <title>Re-binning based on new spec limits</title>
      <link>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/333514#M58159</link>
      <description>&lt;P&gt;I have a table with a number of parameters with spec limits and a pass fail column.&lt;/P&gt;&lt;P&gt;I use manage Spec limits to change some of the limits and reload them to the columns of the table.&lt;/P&gt;&lt;P&gt;OK so far.&lt;/P&gt;&lt;P&gt;But now I want to re-bin all the devices (i.e. re-determine Pass &amp;amp; Fail) based on the new spec limits.&lt;/P&gt;&lt;P&gt;Since there are many, many parameters writing a formula to do this would be unwieldy and take quite a bit of time.&lt;/P&gt;&lt;P&gt;I could write a script to do it (determining the columns with spec limits and creating a formula column based on that).&lt;/P&gt;&lt;P&gt;But is there anything built into JMP to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:22:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/333514#M58159</guid>
      <dc:creator>pcarroll1</dc:creator>
      <dc:date>2023-06-10T23:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Re-binning based on new spec limits</title>
      <link>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/333537#M58161</link>
      <description>&lt;P&gt;I am not aware of a JMP binning tool based upon Spec Limits, but here is a very efficient piece of code that does the binning.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

colNames = dt &amp;lt;&amp;lt; get column names( continuous, string );

For( i = 1, i &amp;lt;= N Items( colNames ), i++,
	Clear Symbols( specs );
	specs = Column( dt, colNames[i] ) &amp;lt;&amp;lt; get property( "Spec Limits" );
	If( Is Empty( specs ) == 0,
		dt &amp;lt;&amp;lt; New Column( colNames[i] || " Pass_Fail", character, set each value( "Fail" ) );
		theRows = dt &amp;lt;&amp;lt; get rows where( Eval( specs["LSL"] ) &amp;lt;= As Column( dt, colNames[i] ) &amp;lt;= Eval( specs["USL"] ) );
		If( N Rows( theRows ),
			Column( dt, colNames[i] || " Pass_Fail" )[theRows] = "Pass"
		);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Nov 2020 22:54:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/333537#M58161</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-11-13T22:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Re-binning based on new spec limits</title>
      <link>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/333605#M58171</link>
      <description>Thanks. This worked well.&lt;BR /&gt;I also built up an expression in the script loop to use as a formula to calculate the overall pass-fail result.</description>
      <pubDate>Sun, 15 Nov 2020 22:52:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/333605#M58171</guid>
      <dc:creator>pcarroll1</dc:creator>
      <dc:date>2020-11-15T22:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Re-binning based on new spec limits</title>
      <link>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/575735#M78390</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hey Jim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to modify the script you provided here.&lt;/P&gt;&lt;P&gt;I'm failing...&lt;/P&gt;&lt;P&gt;I'd like to have one single additional column which collects the fail categories. The fail category should show the first failing column. Therefore, I loop reverse with the intention to overwrite all the subsequent fail categories.&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/semiconductor capability.jmp" );
dt &amp;lt;&amp;lt; New Column( "First_Failed_Test", character, set each value( "Pass" ) );

colNames = dt &amp;lt;&amp;lt; get column names( continuous, string );

For( i = N Items( colNames ), i &amp;gt;= 1, i--,
	Clear Symbols( specs );
	specs = Column( dt, colNames[i] ) &amp;lt;&amp;lt; get property( "Spec Limits" );
	If( Is Empty( specs ) == 0 | Eval( specs["LSL"] ) != Eval( specs["USL"]) ,

		theRows = dt &amp;lt;&amp;lt; get rows where( Eval( specs["LSL"] ) &amp;gt;= As Column( dt, colNames[i] ) &amp;gt;= Eval( specs["USL"] ) );
		If( N Rows( theRows ),
			Column( dt, "First_Failed_Test" )[theRows] = colNames[i]
		);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Do you see what is wrong with the script?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 14:51:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/575735#M78390</guid>
      <dc:creator>Greenhorn</dc:creator>
      <dc:date>2022-12-01T14:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Re-binning based on new spec limits</title>
      <link>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/575780#M78396</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;		theRows = dt &amp;lt;&amp;lt; get rows where( Eval( specs["LSL"] ) &amp;gt;= As Column( dt, colNames[i] ) | As Column( dt, colNames[i] ) &amp;gt;= Eval( specs["USL"] ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I got it!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 15:41:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/575780#M78396</guid>
      <dc:creator>Greenhorn</dc:creator>
      <dc:date>2022-12-01T15:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Re-binning based on new spec limits</title>
      <link>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/576038#M78417</link>
      <description>&lt;P&gt;I think the following script is a better approach for you to take in finding the First Fail test.&amp;nbsp; This script creates a new column, and populates the column with the name of the First Fail Column&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1669924154108.png" style="width: 670px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/47846iABD06BEE4D5F26D9/image-dimensions/670x303?v=v2" width="670" height="303" role="button" title="txnelson_0-1669924154108.png" alt="txnelson_0-1669924154108.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt=open("$SAMPLE_DATA/semiconductor capability.jmp");
USLVals = LSLVals = [];
For( i = 5, i &amp;lt;= N Cols( dt ), i++,
	USLVals = USLVals || Matrix( (Column( dt, i ) &amp;lt;&amp;lt; get property( spec limits ))["USL"] );
	LSLVals = LSLVals || Matrix( (Column( dt, i ) &amp;lt;&amp;lt; get property( spec limits ))["LSL"] );
);
dt &amp;lt;&amp;lt; New Column( "First Fail", character );

For( i = 1, i &amp;lt;= N Rows( dt ), i++,
	theMin = Min(
		Min( Loc( (USLVals &amp;lt; dt[i, Index( 5, N Cols( dt ) - 1 )]) ) ),
		Min( Loc( (dt[i, Index( 5, N Cols( dt ) - 1 )]) &amp;lt; LSLVals ) )
	);
	:First Fail[i] = Column( dt, theMin + 4 ) &amp;lt;&amp;lt; get name;
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 19:50:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/576038#M78417</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-12-01T19:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Re-binning based on new spec limits</title>
      <link>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/576438#M78435</link>
      <description>&lt;P&gt;Thanks, Jim! It is definitely much faster.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this approach with matrix able to handle exceptions like "Don't consider columns where USL=LSL" or " Columns with No Spec Limits"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I need to create a sub table with valid columns (custom subset of columns and automatic excluding of columns by "non-valid" conditions) first and then apply the proposed script and update the origin the with the result column? --&amp;gt; Is it an efficient way to code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 08:29:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/576438#M78435</guid>
      <dc:creator>Greenhorn</dc:creator>
      <dc:date>2022-12-02T08:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Re-binning based on new spec limits</title>
      <link>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/576461#M78437</link>
      <description>&lt;P&gt;Your observation is correct.&amp;nbsp; The code I provided assumes that all columns have spec limits.&amp;nbsp; Your suggestion of creating a subset containing only fully qualified columns is one way of handling it.&amp;nbsp; And it would be a good way.&lt;/P&gt;
&lt;P&gt;Another alternative would be to add into the provided code, the ability to identify the columns that do not have spec limits, and to just bypass them.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Either way will work.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 09:19:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Re-binning-based-on-new-spec-limits/m-p/576461#M78437</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-12-02T09:19:03Z</dc:date>
    </item>
  </channel>
</rss>

