<?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 script to apply spec limit values appearing in a column to its own property based on labels on other columns? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699405#M88429</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;I am studying your code and thanks for explaining how Word () works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far the script is not working for my actual data (which only has difference in the actual column names i.e. with more underscores).&lt;/P&gt;&lt;P&gt;The trouble is the script runs without throwing any errors on my actual data and there is nothing in the log unlike when I run the same script on the example data table attached here. So there is nothing for me to latch on to for debugging.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had already tried show (1) to show the limits to enable&amp;nbsp;&lt;SPAN&gt;"Show As Graph Reference Lines"&amp;nbsp;programmatically. It&amp;nbsp;&lt;/SPAN&gt;does not work for me in JMP 16.2 using the example data posted here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try to debug the script and come back to you if I find anything. It would be useful to get some pointers for debugging in the absence of anything in the log.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Nov 2023 17:57:50 GMT</pubDate>
    <dc:creator>Neo</dc:creator>
    <dc:date>2023-11-16T17:57:50Z</dc:date>
    <item>
      <title>How to script to apply spec limit values appearing in a column to its own property based on labels on other columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699206#M88415</link>
      <description>&lt;P&gt;I have incoming data similar to the attached data table.&lt;/P&gt;&lt;P&gt;I would like to (as an example)&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;save the row values appearing (first/top) in column Breakdown_5 against rows USL/LSL (under Label) for T5 (under TestStage) as limits in Breakdown_5 column property, similarly&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;save the row values appearing&amp;nbsp;(first/top) in column Resistance_7 against rows USL/LSL (under Label) for S7 (under TestStage) as limits in Resistance_7 column property&lt;/LI&gt;&lt;LI&gt;save the row values appearing (first/top) in column Current_7 against rows USL/LSL (under Label) for S7 (under TestStage) as limits in Current_7 column property&lt;/LI&gt;&lt;LI&gt;save the row values appearing&amp;nbsp;(first/top) in column Current_11 against rows USL/LSL (under Label) for W11 (under TestStage) as limits in Current_11 column property&lt;/LI&gt;&lt;LI&gt;save the row values&amp;nbsp;appearing&amp;nbsp;(first/top) in column Capacitance_6 against rows USL/LSL (under Label) for U6 (under TestStage) as limits in Capacitance_6 column property&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;In general, how do I write a script in JSL to apply spec limits corresponding to the LSL/USL rows (under Label) appearing (first/at the top) under columns of measured data (Breakdown_#, Resistance_#, Current_# and so on) corresponding to correct TestStage#, where # refers to the test stage number.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Neo_1-1700138913472.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58790i128D604785BB4E83/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Neo_1-1700138913472.png" alt="Neo_1-1700138913472.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 12:55:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699206#M88415</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-11-16T12:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to script to apply spec limit values appearing in a column to its own property based on labels on other columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699361#M88421</link>
      <description>&lt;P&gt;Here is a script that works with your sample data&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Data Table( "exampleDataSummary" );

// Find all numeric columns and place in a list
numColList = dt &amp;lt;&amp;lt; get column names( numeric, string );

// Find the unique values of TestStage
Summarize( dt, tstStage = By( :TestStage ) );

// Loop across all test stages and match with response column
stageNumber = "";
For Each( {Stage}, tstStage,
	stageNumber = Substr( Stage, 2 );
	resCol = "";
	For Each( {col}, numColList,
		If( Word( -1, col, "_" ) == stageNumber,
			resCol = col
		);
		// Get LSL and USL
		If( resCol != "",
			theLSL = Column( dt, resCol )[(dt &amp;lt;&amp;lt; get rows where( :TestStage == Stage &amp;amp; :label == "LSL" ))[1]];
			theUSL = Column( dt, resCol )[(dt &amp;lt;&amp;lt; get rows where( :TestStage == Stage &amp;amp; :label == "USL" ))[1]];
			Show( theLSL, theUSL );
			Eval(
				Substitute(
						Expr(
							Column( dt, resCol ) &amp;lt;&amp;lt; set property( "Spec Limits", {LSL( _LSL_ ), USL( _USL_ )} )
						),
					Expr( _LSL_ ), theLSL,
					Expr( _USL_ ), theUSL				
						
					)
			);
		);
	 	
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Nov 2023 14:56:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699361#M88421</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-16T14:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to script to apply spec limit values appearing in a column to its own property based on labels on other columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699373#M88423</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp; Yes, Thanks. The script works with the example data file. I have two questions.&lt;/P&gt;&lt;P&gt;1. Just realized that my measured parameter (column) names can be of the form Resistance_Null_Port_7, Capacitance_Full_Plate_6 etc. How to change the script when there are more than one underscores in the column names before the TestStage number comes at the end. I guess the implementation of the Word () function needs to change, but I am struggling with it (its a bit confusing not having used it before).&lt;/P&gt;&lt;P&gt;2. How to enable "Show As Graph Reference Lines" programmatically for each column once the Limits are applied? I know how to do this manually via Manage Spec Limits (). I am on JMP 16.2.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 15:41:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699373#M88423</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-11-16T15:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to script to apply spec limit values appearing in a column to its own property based on labels on other columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699391#M88424</link>
      <description>&lt;P&gt;Please go to the Scripting Index to find the details on the various functions that I used in the script I provided.&amp;nbsp; The Word() function, as I used it, does not care how many "_" are in the names.&amp;nbsp; The first term in the Word() function, as I am using it, is a -1, which instructs the function to take the first word, starting from the end of the string.&lt;/P&gt;
&lt;P&gt;To tell JMP to automatically display the values as reference lines, the "Show()" parameter in the Spec Limits specification.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Column( dt, resCol ) &amp;lt;&amp;lt; set property( "Spec Limits", {LSL( _LSL_ ), USL( _USL_ ), Show(1)} )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please take the time to study the script I provided, to help you move ahead to becoming a more efficient scripter.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 16:45:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699391#M88424</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-16T16:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to script to apply spec limit values appearing in a column to its own property based on labels on other columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699405#M88429</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;I am studying your code and thanks for explaining how Word () works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far the script is not working for my actual data (which only has difference in the actual column names i.e. with more underscores).&lt;/P&gt;&lt;P&gt;The trouble is the script runs without throwing any errors on my actual data and there is nothing in the log unlike when I run the same script on the example data table attached here. So there is nothing for me to latch on to for debugging.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had already tried show (1) to show the limits to enable&amp;nbsp;&lt;SPAN&gt;"Show As Graph Reference Lines"&amp;nbsp;programmatically. It&amp;nbsp;&lt;/SPAN&gt;does not work for me in JMP 16.2 using the example data posted here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try to debug the script and come back to you if I find anything. It would be useful to get some pointers for debugging in the absence of anything in the log.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 17:57:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699405#M88429</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-11-16T17:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to script to apply spec limit values appearing in a column to its own property based on labels on other columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699833#M88467</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;Needed to change&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Substr( )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for the script to work for my actual data. However,&amp;nbsp;&lt;SPAN&gt;show (1)&amp;nbsp; still does not show the limits when a distribution is plotted for any measured parameter.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The following also does not work on my JMP16.2 i.e. show limits does not enable&amp;nbsp;&lt;SPAN&gt;"Show As Graph Reference Lines" in column properties.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=Open("$SAMPLE_DATA/Process Measurements.jmp");
Column(dt, "Process 2")&amp;lt;&amp;lt;Set Property(
			"Spec Limits",
			{LSL( 5 ), USL( 17 ), Target( 10 ), Show Limits( 1 )}
		);
Column(dt, "Process 3")&amp;lt;&amp;lt;Set Property(
			"Process Capability Distribution",
			Process Capability Distribution( Weibull )
		);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;However, this does the job.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Column( dt, resCol ) &amp;lt;&amp;lt; set property( "Spec Limits", {LSL( _LSL_ ), USL( _USL_ ), Show Limits( 1 )})&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Nov 2023 12:56:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699833#M88467</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-11-17T12:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to script to apply spec limit values appearing in a column to its own property based on labels on other columns?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699851#M88471</link>
      <description>&lt;P&gt;My mistake,&amp;nbsp; change&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;show(1)&lt;/P&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;show limits(1)&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 12:54:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-to-apply-spec-limit-values-appearing-in-a-column/m-p/699851#M88471</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-17T12:54:58Z</dc:date>
    </item>
  </channel>
</rss>

