<?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 use JSL to Get Limits in IR Control Chart in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/276862#M53770</link>
    <description>Hello I have come across this solution and tried to implement it but it’s not working for me it opens the files I specify at the top of the script but doesn’t continue on with the rest of the script. It might be something to do with the Phase part but I don’t completely understand where it comes from? Thank you for your help</description>
    <pubDate>Sat, 04 Jul 2020 08:08:49 GMT</pubDate>
    <dc:creator>AlexS</dc:creator>
    <dc:date>2020-07-04T08:08:49Z</dc:date>
    <item>
      <title>How to use JSL to Get Limits in IR Control Chart</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/219935#M44012</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming I have a limits table saved with multiple parameter columns like shown below. Is there a&amp;nbsp;way to read in this file and apply the limits to an IR chart for the matching parameters using JSL?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 521px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18557iC2A221C21C66063B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to the following post there is no way to invoke the "Get Limits"&amp;nbsp;function from the Control Chart dialog using JSL. In this case it was suggested to hard code the limits.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/How-to-Get-Limits-for-Capability-on-IR-Control-Chart/td-p/57814" target="_blank" rel="noopener"&gt;How-to-Get-Limits-for-Capability-on-IR-Control-Chart&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am thinking I need to read the limits file in, capture the Sigma, Avg, LCL, and UCL as variables then pass them to the Chart Col for each parameter.&amp;nbsp; If this is the only way to do it, what would be the most efficient way to approach it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See below example of the code for a single control chart parameter with phase level and limits hard coded:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Control Chart(
	Sample Label( :WEEK ),
	Phase( :YEAR ),
	Group Size( 1 ),
	KSigma( 3 ),
	Chart Col(
		:P1,
		Individual Measurement(
			Test 1( 1 ),
			Test 2( 1 ),
			Test 5( 1 ),
			Test 6( 1 ),
			Phase Level(
				"2019",
				Sigma( 0.0106958422036977 ),
				Avg( 5.59766666666667 ),
				LCL( 5.56557914005557 ),
				UCL( 5.62975419327776 )
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ry&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Aug 2019 00:02:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/219935#M44012</guid>
      <dc:creator>RyMcQeN</dc:creator>
      <dc:date>2019-08-03T00:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to Get Limits in IR Control Chart</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/219946#M44014</link>
      <description>&lt;P&gt;There are 2 basic ways to do this.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Read the data from the limits table, and then save the limits as Column Properties. Then run the charts desired.&lt;/LI&gt;
&lt;LI&gt;Loop across the columns to be charted, reading in the limits from the limits table and inserting them into the JSL to generate the charts.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;It is the second of these methods I have used for the script below.&amp;nbsp; It should be a working script, but without actually having your limits table, and the actual data table, it is possible there may be some glitches.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "path to data table" );
dtLimits = Open( "path to limits table" );

// Get list of columns to chart
colNameList = dt &amp;lt;&amp;lt; get column names( continuous, string );

// Loop across all of the columns and create the charts
For( i = 1, i &amp;lt;= N Items( colNameList ), i++, 

	// If limits exist for the current column, then process
	If( Try( Column( dtLimits, colNameList[i] ) &amp;lt;&amp;lt; get name ) != "", 

		// get the limits needed
		// sigma

		theSigma = Column( dtLimits, colNameList[i] )[(dtLimits &amp;lt;&amp;lt;
		get rows where( _LimitsKey == "_Std Dev" ))[1]];
		theAvg = Column( dtLimits, colNameList[i] )[(dtLimits &amp;lt;&amp;lt;
		get rows where( _LimitsKey == "_Mean" ))[1]];
		theLCL = Column( dtLimits, colNameList[i] )[(dtLimits &amp;lt;&amp;lt;
		get rows where( _LimitsKey == "_LCL" ))[1]];
		theUCL = Column( dtLimits, colNameList[i] )[(dtLimits &amp;lt;&amp;lt;
		get rows where( _LimitsKey == "_UCL" ))[1]];

		Eval(
			Substitute(
					Expr(
						Control Chart(
							Sample Label( :WEEK ),
							Phase( :YEAR ),
							Group Size( 1 ),
							KSigma( 3 ),
							Chart Col(
								__process__,
								Individual Measurement(
									Test 1( 1 ),
									Test 2( 1 ),
									Test 5( 1 ),
									Test 6( 1 ),
									Phase Level(
										"2019",
										Sigma( __sigma__ ),
										Avg( __avg__ ),
										LCL( __LCL__ ),
										UCL( __UCL__ )
									)
								)
							)
						)
					),
				Expr( __process__ ), Parse( ":" || colNameList[i] ),
				Expr( __sigma__ ), theSigma,
				Expr( __avg__ ), theAvg,
				Expr( __LCL__ ), theLCL,
				Expr( __UCL__ ), theUCL
			)
		);
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 03 Aug 2019 01:52:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/219946#M44014</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-08-03T01:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to Get Limits in IR Control Chart</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/220292#M44059</link>
      <description>Thank you Jim. I had to make a small edit to the Get Rows Where( _LimitsKey == ...) sections. Just added the colon ":" so it becomes Get Rows Where( :_LimitsKey == ...) then everything worked. One question though. The script is generating individual windows for each parameter control chart. Is there a way to generate one window with the control charts of each parameter stacked (as if I selected multiple parameters in the IR Control chart dialog)?</description>
      <pubDate>Wed, 07 Aug 2019 00:51:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/220292#M44059</guid>
      <dc:creator>RyMcQeN</dc:creator>
      <dc:date>2019-08-07T00:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to Get Limits in IR Control Chart</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/224950#M44694</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you show me how to approach the first method you mentioned? Reading in the limits from the limits table then applying them as column properties.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ry&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 22:46:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/224950#M44694</guid>
      <dc:creator>RyMcQeN</dc:creator>
      <dc:date>2019-09-05T22:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to Get Limits in IR Control Chart</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/224951#M44695</link>
      <description>&lt;P&gt;If you interactively set the Control Limits for an IR chart and then use the following JSL to retrieve the limits,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:columnname &amp;lt;&amp;lt;get property("control limits");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The structure that is stored for the Column Property will be shown&lt;/P&gt;
&lt;PRE&gt;{Individual Measurement(
	Avg( 62.55 ),
	LCL( 51.574420384821 ),
	UCL( 73.525579615179 )
)}&lt;/PRE&gt;
&lt;P&gt;So all that has to be done, is to read the info from your limits data table, and then build the above structure and pass it to the measurement data table column.&amp;nbsp; Below is a modification of my previous script, except that it populates the Control Limits, rather than running the control charts&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "path to data table" );
dtLimits = Open( "path to limits table" );

// Get list of columns to chart
colNameList = dt &amp;lt;&amp;lt; get column names( continuous, string );

// Loop across all of the columns and create the charts
For( i = 1, i &amp;lt;= N Items( colNameList ), i++, 

	// If limits exist for the current column, then process
	If( Try( Column( dtLimits, colNameList[i] ) &amp;lt;&amp;lt; get name ) != "", 

		// get the limits needed
		
		theAvg = Column( dtLimits, colNameList[i] )[(dtLimits &amp;lt;&amp;lt; get rows where( _LimitsKey == "_Mean" ))[1]];
		theLCL = Column( dtLimits, colNameList[i] )[(dtLimits &amp;lt;&amp;lt; get rows where( _LimitsKey == "_LCL" ))[1]];
		theUCL = Column( dtLimits, colNameList[i] )[(dtLimits &amp;lt;&amp;lt; get rows where( _LimitsKey == "_UCL" ))[1]];

		Eval(
			Substitute(
				Expr(
					__Process__ &amp;lt;&amp;lt; set property(
						"Control Limits",
						{Individual Measurement( Avg( __avg__ ), LCL( __LCL__ ), UCL( __UCL__ ) )}
					)
				),
				Expr( __process__ ), Parse( ":" || colNameList[i] ),
				Expr( __avg__ ), theAvg,
				Expr( __LCL__ ), theLCL,
				Expr( __UCL__ ), theUCL
			)
		);
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Sep 2019 00:09:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/224951#M44695</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-09-06T00:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to Get Limits in IR Control Chart</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/224952#M44696</link>
      <description>&lt;P&gt;Thank you for the fast reply Jim.&amp;nbsp; I was trying to set the Control Limits and the Sigma property and was getting an error for:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;too many arguments in access or evaluation of 'Expr' , Expr/*###*/(Column( finalDt, colNamesList[i] ) &amp;lt;&amp;lt;
Set Property(
	"Control Limits",
	{Individual Measurement( Avg( __avg__ ), LCL( __LCL__ ), UCL( __UCL__ ) )}
), Column( finalDt, colNamesList[i] ) &amp;lt;&amp;lt; Set Property( "Sigma", __sigma__ ))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The problem was that I was trying to define two different column properties in the same substitute expression.&amp;nbsp; After breaking it up into 2 Evals, it works.&amp;nbsp; See below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	Current Data Table( finalDt );
	Wait(0);

	// Get list of columns to chart
	colNameList = finalDt &amp;lt;&amp;lt; get column names( continuous, string );

	// Loop across all of the columns and create the charts
	For( i = 2, i &amp;lt;= N Items( colNameList ), i++, 

		// If limits exist for the current column, then process
		If( Try( Column( dtLimits, colNameList[i] ) &amp;lt;&amp;lt; get name ) != "", 

			// get the limits needed
			// sigma

			theSigma = Column( dtLimits, colNameList[i] )[(dtLimits &amp;lt;&amp;lt; get rows where( :_LimitsKey == "_Std Dev" ))[1]];
			theAvg = Column( dtLimits, colNameList[i] )[(dtLimits &amp;lt;&amp;lt; get rows where( :_LimitsKey == "_Mean" ))[1]];
			theLCL = Column( dtLimits, colNameList[i] )[(dtLimits &amp;lt;&amp;lt; get rows where( :_LimitsKey == "_LCL" ))[1]];
			theUCL = Column( dtLimits, colNameList[i] )[(dtLimits &amp;lt;&amp;lt; get rows where( :_LimitsKey == "_UCL" ))[1]];

			Eval(
				Substitute(
					Expr( __process__ &amp;lt;&amp;lt; Set Property("Control Limits", {Individual Measurement( Avg( __avg__ ), LCL( __LCL__ ), UCL( __UCL__ ))})),
					Expr( __process__ ), Parse( ":" || colNameList[i] ),
					Expr( __avg__ ), theAvg,
					Expr( __LCL__ ), theLCL,
					Expr( __UCL__ ), theUCL
				)
			);
			Eval(
				Substitute(
					Expr( __process__ &amp;lt;&amp;lt; Set Property("Sigma", __sigma__)),
					Expr( __process__ ), Parse( ":" || colNameList[i] ),
					Expr( __sigma__ ), theSigma,
				)
			);
		)
	);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks again for your quick help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ry&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 00:38:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/224952#M44696</guid>
      <dc:creator>RyMcQeN</dc:creator>
      <dc:date>2019-09-06T00:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to Get Limits in IR Control Chart</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/276862#M53770</link>
      <description>Hello I have come across this solution and tried to implement it but it’s not working for me it opens the files I specify at the top of the script but doesn’t continue on with the rest of the script. It might be something to do with the Phase part but I don’t completely understand where it comes from? Thank you for your help</description>
      <pubDate>Sat, 04 Jul 2020 08:08:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/276862#M53770</guid>
      <dc:creator>AlexS</dc:creator>
      <dc:date>2020-07-04T08:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to Get Limits in IR Control Chart</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/276870#M53774</link>
      <description>What error messages are you getting in the log?</description>
      <pubDate>Sat, 04 Jul 2020 13:03:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/276870#M53774</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-04T13:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to Get Limits in IR Control Chart</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/276886#M53784</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Not Found in access or evaluation of 'Control Chart' , Bad Argument( {:Month Alerted, :YEAR} ), Control Chart(/*###*/Sample Label( :Month Alerted ),
	Phase( :YEAR ),
	Group Size( 1 ),
	KSigma( 3 ),
	Chart Col(
		:Grand Total,
		Individual Measurement(
			Test 1( 1 ),
			Test 2( 1 ),
			Test 5( 1 ),
			Test 6( 1 ),
			Phase Level(
				"2019",
				Sigma( 9843.52246062887 ),
				Avg( 54802.5935983333 ),
				LCL( 25272.0262164467 ),
				UCL( 84333.1609802199 )
			)
		)
	)
)&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;My columns are Month Alerted the column data content is 12 months in this format 2019-04 so I changed the sample label to :Month Alerted.&lt;/P&gt;&lt;P&gt;the next part is the YEAR and Phase which doesn't match my data so i think that's where it doesn't work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The limits are multiple columns but each with a different header ideally i don't want to write every column header.&lt;/P&gt;&lt;P&gt;i also need the size (500,175) but unsure where this fits in the code&amp;nbsp;and save to the data table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did try using the Control chart builder but i couldn't get the limits to be added. I select the file but it did nothing after it. Which meant i couldn't get some sort of script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks - I have attached the script&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jul 2020 08:10:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/276886#M53784</guid>
      <dc:creator>AlexS</dc:creator>
      <dc:date>2020-07-05T08:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to Get Limits in IR Control Chart</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/277143#M53862</link>
      <description>&lt;P&gt;You can use JSL with the Get Limits command for an IR Control Chart.&amp;nbsp; The post you referenced was about Specification Limits and not Control Limits.&amp;nbsp; If you have control limits, you can use the following JSL with the Get Limits command.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Quality Control/Coating.jmp");
obj = Control Chart(
	Sample Size( Column(dt, "Sample") ),
	Chart Col( :Weight, XBar, R ),
	Get Limits(
		"$SAMPLE_DATA/Quality Control/CoatingLimits.jmp"
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 18:37:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/277143#M53862</guid>
      <dc:creator>tonya_mauldin</dc:creator>
      <dc:date>2020-07-07T18:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to use JSL to Get Limits in IR Control Chart</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/277298#M53879</link>
      <description>&lt;P&gt;Excellent! That put me on the right track.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 08:56:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-JSL-to-Get-Limits-in-IR-Control-Chart/m-p/277298#M53879</guid>
      <dc:creator>AlexS</dc:creator>
      <dc:date>2020-07-08T08:56:33Z</dc:date>
    </item>
  </channel>
</rss>

