<?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 Control Limit refreshing for Control Charts in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Control-Limit-refreshing-for-Control-Charts/m-p/943038#M109540</link>
    <description>&lt;P&gt;I am very novice when it comes to JMP pro, JMP live and JSL. Here is my issue, I have a refresh script that successfully pulls spec limits from a database in ssms and applies them to the properties of the columns; I want to start pulling from another table to apply individual control limits for all process variables in the data set. When I add what I believe to be the correct blocks to accomplish this it still sets the spec limits, but the control limits do not make it through. No errors or anything in the log so I know it's silently ignoring the new blocks but that in itself I have no idea what it means.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If anyone can point me in the right direction that would be greatly appreciated!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;sql_query_main = " SELECT * FROM jmpTop30WideView WHERE Product LIKE '1/2 RS' AND TestType IN ('Retest', 'Hot')";
sql_query_limits = "SELECT Property AS Variable, LSL, Target, USL FROM ProductSpecsLongView WHERE [Product] LIKE '1/2 RS' ";
sql_query_Control = "SELECT Property AS Variable, Avg, LCL, UCL FROM ControlLimitsTable WHERE [Product] LIKE '1/2 RS' ";

main = Open Database(
	"DATABASE=XXXXXXXXXXXXXX;
DRIVER={SQL Server};
PWD=%_PWD_%;
SERVER=XXX-XXXXX;
TRUSTSERVERCERTIFICATE=Yes;
UID=%_UID_%;",
	sql_query_main
);

limits = Open Database(
	"DATABASE=XXXXXXXXXXXXXX;
DRIVER={SQL Server};
PWD=%_PWD_%;
SERVER=XXX-XXX-XXXXX;;
TRUSTSERVERCERTIFICATE=Yes;
UID=%_UID_%;",
	sql_query_limits
);

Control = Open Database(
	"DATABASE=XXXXXXXXXXXXXX;
DRIVER={SQL Server};
PWD=%_PWD_%;
SERVER=XXX-XXXXXX;;
TRUSTSERVERCERTIFICATE=Yes;
UID=%_UID_%;",
	sql_query_Control
);

Column(main, "DateTimeStampUnique") &amp;lt;&amp;lt; Set Property("Label", 1);
main &amp;lt;&amp;lt; Set Label Columns(:DateTimeStampUnique);

// References
dtMain = main;
dtLimits = limits;
dtControl = Control;

For Each Row(
	dtLimits,
	variable = dtLimits:Variable[];
	lsl = dtLimits:LSL[];
	target = dtLimits:Target[];
	usl = dtLimits:USL[];

	Eval(Eval Expr(Column(dtMain, variable) &amp;lt;&amp;lt; Set Property("Spec Limits", {LSL(Expr(lsl)), Target(Expr(target)), USL(Expr(usl)), Show Limits(1)})));

	If(Contains(dtMain &amp;lt;&amp;lt; Get Column Names, variable),
		Column(dtMain, variable) &amp;lt;&amp;lt; Set Property("Spec Limits", {LSL(lsl), Target(target), USL(usl)})
	);
);

For Each Row(
	dtControl,
	variable = dtControl:Variable[];
	Avg = dtControl:Avg[];
	LCL = dtControl:LCL[];
	UCL = dtControl:UCL[];

	Eval(Eval Expr(Column(dtMain, variable) &amp;lt;&amp;lt; Set Property("Control Limits", {Avg(Expr(Avg)), LCL(Expr(LCL)), UCL(Expr(UCL)), Show Limits(1)})));

	If(Contains(dtMain &amp;lt;&amp;lt; Get Column Names, variable),
		Column(dtMain, variable) &amp;lt;&amp;lt; Set Property(
			"Control Limits",
			{AVG(), LCL(), UCL()}

		)
	);
);

dtMain;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edit (jthi): Added jsl formatting (I left original script in spoiler block as there were many missing brackets which I had to fix)&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;P&gt;&amp;lt;jsl&amp;gt;&lt;/P&gt;
&lt;P&gt;sql_query_main = " SELECT * FROM jmpTop30WideView WHERE Product LIKE '1/2 RS' AND TestType IN ('Retest', 'Hot')";&lt;BR /&gt;sql_query_limits = "SELECT Property AS Variable, LSL, Target, USL FROM ProductSpecsLongView WHERE [Product] LIKE '1/2 RS' ";&lt;BR /&gt;sql_query_Control = "SELECT Property AS Variable, Avg, LCL, UCL FROM ControlLimitsTable WHERE [Product] LIKE '1/2 RS' ";&lt;/P&gt;
&lt;P&gt;main = Open Database(&lt;BR /&gt;"DATABASE=XXXXXXXXXXXXXX;&lt;BR /&gt;DRIVER={SQL Server};&lt;BR /&gt;PWD=%_PWD_%;&lt;BR /&gt;SERVER=XXX-XXXXX;&lt;BR /&gt;TRUSTSERVERCERTIFICATE=Yes;&lt;BR /&gt;UID=%_UID_%;",&lt;BR /&gt;sql_query_main&lt;BR /&gt;);&lt;/P&gt;
&lt;P&gt;limits = Open Database(&lt;BR /&gt;"DATABASE=XXXXXXXXXXXXXX;&lt;BR /&gt;DRIVER={SQL Server};&lt;BR /&gt;PWD=%_PWD_%;&lt;BR /&gt;SERVER=XXX-XXX-XXXXX;;&lt;BR /&gt;TRUSTSERVERCERTIFICATE=Yes;&lt;BR /&gt;UID=%_UID_%;",&lt;BR /&gt;sql_query_limits&lt;BR /&gt;);&lt;/P&gt;
&lt;P&gt;Control = Open Database(&lt;BR /&gt;"DATABASE=XXXXXXXXXXXXXX;&lt;BR /&gt;DRIVER={SQL Server};&lt;BR /&gt;PWD=%_PWD_%;&lt;BR /&gt;SERVER=XXX-XXXXXX;;&lt;BR /&gt;TRUSTSERVERCERTIFICATE=Yes;&lt;BR /&gt;UID=%_UID_%;",&lt;BR /&gt;sql_query_Control&lt;BR /&gt;);&lt;/P&gt;
&lt;P&gt;Column( main, "DateTimeStampUnique" ) &amp;lt;&amp;lt; Set Property( "Label", 1 );&lt;BR /&gt;main &amp;lt;&amp;lt; Set Label Columns( :DateTimeStampUnique );&lt;/P&gt;
&lt;P&gt;// References&lt;BR /&gt;dtMain = main;&lt;BR /&gt;dtLimits = limits;&lt;BR /&gt;dtControl = Control;&lt;/P&gt;
&lt;P&gt;For Each Row( dtLimits,&lt;BR /&gt;variable = dtLimits:Variable[];&lt;BR /&gt;lsl = dtLimits:LSL[];&lt;BR /&gt;target = dtLimits:Target[];&lt;BR /&gt;usl = dtLimits:USL[];&lt;/P&gt;
&lt;P&gt;Eval( Eval Expr(&lt;BR /&gt;Column( dtMain, variable ) &amp;lt;&amp;lt;&lt;BR /&gt;Set Property(&lt;BR /&gt;"Spec Limits",&lt;BR /&gt;{LSL( Expr( lsl ) ), Target( Expr( target ) ), USL( Expr( usl ) ), Show Limits( 1 )}&lt;BR /&gt;)&lt;BR /&gt;));&lt;/P&gt;
&lt;P&gt;If(&lt;BR /&gt;Contains( dtMain &amp;lt;&amp;lt; Get Column Names, variable ),&lt;BR /&gt;Column( dtMain, variable ) &amp;lt;&amp;lt; Set Property(&lt;BR /&gt;"Spec Limits",&lt;BR /&gt;{LSL( lsl ), Target( target ), USL( usl )}&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;For Each Row( dtControl,&lt;BR /&gt;variable = dtControl:Variable[];&lt;BR /&gt;Avg = dtControl:Avg[];&lt;BR /&gt;LCL = dtControl:LCL[];&lt;BR /&gt;UCL = dtControl:UCL[];&lt;/P&gt;
&lt;P&gt;Eval( Eval Expr(&lt;BR /&gt;Column( dtMain, variable ) &amp;lt;&amp;lt;&lt;BR /&gt;Set Property(&lt;BR /&gt;"Control Limits",&lt;BR /&gt;{Avg( Expr( Avg ) ), LCL( Expr( LCL ) ), UCL( Expr( UCL ) ), Show Limits( 1 )}&lt;BR /&gt;)&lt;BR /&gt;));&lt;/P&gt;
&lt;P&gt;If(&lt;BR /&gt;Contains( dtMain &amp;lt;&amp;lt; Get Column Names, variable ),&lt;BR /&gt;Column( dtMain, variable ) &amp;lt;&amp;lt; Set Property(&lt;BR /&gt;"Control Limits",&lt;BR /&gt;{AVG(), LCL(), UCL()}&lt;/P&gt;
&lt;P&gt;)&lt;BR /&gt;);&lt;BR /&gt;);&lt;/P&gt;
&lt;P&gt;dtMain;&lt;/P&gt;
&lt;/LI-SPOILER&gt;</description>
    <pubDate>Mon, 20 Apr 2026 17:03:37 GMT</pubDate>
    <dc:creator>WFzw</dc:creator>
    <dc:date>2026-04-20T17:03:37Z</dc:date>
    <item>
      <title>Control Limit refreshing for Control Charts</title>
      <link>https://community.jmp.com/t5/Discussions/Control-Limit-refreshing-for-Control-Charts/m-p/943038#M109540</link>
      <description>&lt;P&gt;I am very novice when it comes to JMP pro, JMP live and JSL. Here is my issue, I have a refresh script that successfully pulls spec limits from a database in ssms and applies them to the properties of the columns; I want to start pulling from another table to apply individual control limits for all process variables in the data set. When I add what I believe to be the correct blocks to accomplish this it still sets the spec limits, but the control limits do not make it through. No errors or anything in the log so I know it's silently ignoring the new blocks but that in itself I have no idea what it means.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If anyone can point me in the right direction that would be greatly appreciated!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;sql_query_main = " SELECT * FROM jmpTop30WideView WHERE Product LIKE '1/2 RS' AND TestType IN ('Retest', 'Hot')";
sql_query_limits = "SELECT Property AS Variable, LSL, Target, USL FROM ProductSpecsLongView WHERE [Product] LIKE '1/2 RS' ";
sql_query_Control = "SELECT Property AS Variable, Avg, LCL, UCL FROM ControlLimitsTable WHERE [Product] LIKE '1/2 RS' ";

main = Open Database(
	"DATABASE=XXXXXXXXXXXXXX;
DRIVER={SQL Server};
PWD=%_PWD_%;
SERVER=XXX-XXXXX;
TRUSTSERVERCERTIFICATE=Yes;
UID=%_UID_%;",
	sql_query_main
);

limits = Open Database(
	"DATABASE=XXXXXXXXXXXXXX;
DRIVER={SQL Server};
PWD=%_PWD_%;
SERVER=XXX-XXX-XXXXX;;
TRUSTSERVERCERTIFICATE=Yes;
UID=%_UID_%;",
	sql_query_limits
);

Control = Open Database(
	"DATABASE=XXXXXXXXXXXXXX;
DRIVER={SQL Server};
PWD=%_PWD_%;
SERVER=XXX-XXXXXX;;
TRUSTSERVERCERTIFICATE=Yes;
UID=%_UID_%;",
	sql_query_Control
);

Column(main, "DateTimeStampUnique") &amp;lt;&amp;lt; Set Property("Label", 1);
main &amp;lt;&amp;lt; Set Label Columns(:DateTimeStampUnique);

// References
dtMain = main;
dtLimits = limits;
dtControl = Control;

For Each Row(
	dtLimits,
	variable = dtLimits:Variable[];
	lsl = dtLimits:LSL[];
	target = dtLimits:Target[];
	usl = dtLimits:USL[];

	Eval(Eval Expr(Column(dtMain, variable) &amp;lt;&amp;lt; Set Property("Spec Limits", {LSL(Expr(lsl)), Target(Expr(target)), USL(Expr(usl)), Show Limits(1)})));

	If(Contains(dtMain &amp;lt;&amp;lt; Get Column Names, variable),
		Column(dtMain, variable) &amp;lt;&amp;lt; Set Property("Spec Limits", {LSL(lsl), Target(target), USL(usl)})
	);
);

For Each Row(
	dtControl,
	variable = dtControl:Variable[];
	Avg = dtControl:Avg[];
	LCL = dtControl:LCL[];
	UCL = dtControl:UCL[];

	Eval(Eval Expr(Column(dtMain, variable) &amp;lt;&amp;lt; Set Property("Control Limits", {Avg(Expr(Avg)), LCL(Expr(LCL)), UCL(Expr(UCL)), Show Limits(1)})));

	If(Contains(dtMain &amp;lt;&amp;lt; Get Column Names, variable),
		Column(dtMain, variable) &amp;lt;&amp;lt; Set Property(
			"Control Limits",
			{AVG(), LCL(), UCL()}

		)
	);
);

dtMain;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edit (jthi): Added jsl formatting (I left original script in spoiler block as there were many missing brackets which I had to fix)&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;P&gt;&amp;lt;jsl&amp;gt;&lt;/P&gt;
&lt;P&gt;sql_query_main = " SELECT * FROM jmpTop30WideView WHERE Product LIKE '1/2 RS' AND TestType IN ('Retest', 'Hot')";&lt;BR /&gt;sql_query_limits = "SELECT Property AS Variable, LSL, Target, USL FROM ProductSpecsLongView WHERE [Product] LIKE '1/2 RS' ";&lt;BR /&gt;sql_query_Control = "SELECT Property AS Variable, Avg, LCL, UCL FROM ControlLimitsTable WHERE [Product] LIKE '1/2 RS' ";&lt;/P&gt;
&lt;P&gt;main = Open Database(&lt;BR /&gt;"DATABASE=XXXXXXXXXXXXXX;&lt;BR /&gt;DRIVER={SQL Server};&lt;BR /&gt;PWD=%_PWD_%;&lt;BR /&gt;SERVER=XXX-XXXXX;&lt;BR /&gt;TRUSTSERVERCERTIFICATE=Yes;&lt;BR /&gt;UID=%_UID_%;",&lt;BR /&gt;sql_query_main&lt;BR /&gt;);&lt;/P&gt;
&lt;P&gt;limits = Open Database(&lt;BR /&gt;"DATABASE=XXXXXXXXXXXXXX;&lt;BR /&gt;DRIVER={SQL Server};&lt;BR /&gt;PWD=%_PWD_%;&lt;BR /&gt;SERVER=XXX-XXX-XXXXX;;&lt;BR /&gt;TRUSTSERVERCERTIFICATE=Yes;&lt;BR /&gt;UID=%_UID_%;",&lt;BR /&gt;sql_query_limits&lt;BR /&gt;);&lt;/P&gt;
&lt;P&gt;Control = Open Database(&lt;BR /&gt;"DATABASE=XXXXXXXXXXXXXX;&lt;BR /&gt;DRIVER={SQL Server};&lt;BR /&gt;PWD=%_PWD_%;&lt;BR /&gt;SERVER=XXX-XXXXXX;;&lt;BR /&gt;TRUSTSERVERCERTIFICATE=Yes;&lt;BR /&gt;UID=%_UID_%;",&lt;BR /&gt;sql_query_Control&lt;BR /&gt;);&lt;/P&gt;
&lt;P&gt;Column( main, "DateTimeStampUnique" ) &amp;lt;&amp;lt; Set Property( "Label", 1 );&lt;BR /&gt;main &amp;lt;&amp;lt; Set Label Columns( :DateTimeStampUnique );&lt;/P&gt;
&lt;P&gt;// References&lt;BR /&gt;dtMain = main;&lt;BR /&gt;dtLimits = limits;&lt;BR /&gt;dtControl = Control;&lt;/P&gt;
&lt;P&gt;For Each Row( dtLimits,&lt;BR /&gt;variable = dtLimits:Variable[];&lt;BR /&gt;lsl = dtLimits:LSL[];&lt;BR /&gt;target = dtLimits:Target[];&lt;BR /&gt;usl = dtLimits:USL[];&lt;/P&gt;
&lt;P&gt;Eval( Eval Expr(&lt;BR /&gt;Column( dtMain, variable ) &amp;lt;&amp;lt;&lt;BR /&gt;Set Property(&lt;BR /&gt;"Spec Limits",&lt;BR /&gt;{LSL( Expr( lsl ) ), Target( Expr( target ) ), USL( Expr( usl ) ), Show Limits( 1 )}&lt;BR /&gt;)&lt;BR /&gt;));&lt;/P&gt;
&lt;P&gt;If(&lt;BR /&gt;Contains( dtMain &amp;lt;&amp;lt; Get Column Names, variable ),&lt;BR /&gt;Column( dtMain, variable ) &amp;lt;&amp;lt; Set Property(&lt;BR /&gt;"Spec Limits",&lt;BR /&gt;{LSL( lsl ), Target( target ), USL( usl )}&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;For Each Row( dtControl,&lt;BR /&gt;variable = dtControl:Variable[];&lt;BR /&gt;Avg = dtControl:Avg[];&lt;BR /&gt;LCL = dtControl:LCL[];&lt;BR /&gt;UCL = dtControl:UCL[];&lt;/P&gt;
&lt;P&gt;Eval( Eval Expr(&lt;BR /&gt;Column( dtMain, variable ) &amp;lt;&amp;lt;&lt;BR /&gt;Set Property(&lt;BR /&gt;"Control Limits",&lt;BR /&gt;{Avg( Expr( Avg ) ), LCL( Expr( LCL ) ), UCL( Expr( UCL ) ), Show Limits( 1 )}&lt;BR /&gt;)&lt;BR /&gt;));&lt;/P&gt;
&lt;P&gt;If(&lt;BR /&gt;Contains( dtMain &amp;lt;&amp;lt; Get Column Names, variable ),&lt;BR /&gt;Column( dtMain, variable ) &amp;lt;&amp;lt; Set Property(&lt;BR /&gt;"Control Limits",&lt;BR /&gt;{AVG(), LCL(), UCL()}&lt;/P&gt;
&lt;P&gt;)&lt;BR /&gt;);&lt;BR /&gt;);&lt;/P&gt;
&lt;P&gt;dtMain;&lt;/P&gt;
&lt;/LI-SPOILER&gt;</description>
      <pubDate>Mon, 20 Apr 2026 17:03:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Control-Limit-refreshing-for-Control-Charts/m-p/943038#M109540</guid>
      <dc:creator>WFzw</dc:creator>
      <dc:date>2026-04-20T17:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Control Limit refreshing for Control Charts</title>
      <link>https://community.jmp.com/t5/Discussions/Control-Limit-refreshing-for-Control-Charts/m-p/943050#M109542</link>
      <description>&lt;P&gt;I'm betting this would work if you specify the Control Chart type, so instead of&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt; &amp;lt;&amp;lt; Set Property( "Control Limits", {Avg( Expr( Avg ) ), LCL( Expr( LCL ) ), UCL( Expr( UCL ) ), Show Limits( 1 )} )t&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;try&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;lt;&amp;lt; Set Property( "Control Limits", {XBar( Avg( Expr( Avg ) ), LCL( Expr( LCL ) ), UCL( Expr( UCL ) ), Show Limits( 1 ) )} )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(replacing "XBar" with your intended Control Chart type)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I think you should try commenting out your redundant If() statements that attempt to assign the Spec Limits and Control Limits after you already did it.&amp;nbsp; See if it works the way you'd like it to.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2026 16:47:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Control-Limit-refreshing-for-Control-Charts/m-p/943050#M109542</guid>
      <dc:creator>mmarchandFSLR</dc:creator>
      <dc:date>2026-04-20T16:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Control Limit refreshing for Control Charts</title>
      <link>https://community.jmp.com/t5/Discussions/Control-Limit-refreshing-for-Control-Charts/m-p/943056#M109543</link>
      <description>&lt;P&gt;The JSL you provided has syntax errors.&amp;nbsp; When I attempted to Reformat it, it fails at line 67 for not having a ";" ending the previous line.&amp;nbsp; With that corrected it then fails for not finding closing ")" for the various For Each Row blocks.&amp;nbsp; That is a stopper for my debugging since without having the For blocks correctly closed, it is very tough to guess at what the program flow logic is.&lt;/P&gt;
&lt;P&gt;Please correct these errors and then resubmit.&lt;/P&gt;
&lt;P&gt;Also, please use the JSL icon at the top of the input window to place your JSL into the Discussion.&amp;nbsp; It allows for the reader to better evaluate your code.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2026 16:59:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Control-Limit-refreshing-for-Control-Charts/m-p/943056#M109543</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2026-04-20T16:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Control Limit refreshing for Control Charts</title>
      <link>https://community.jmp.com/t5/Discussions/Control-Limit-refreshing-for-Control-Charts/m-p/943073#M109545</link>
      <description>&lt;P&gt;This on top of another reply has helped. Now the warning triage in JMP live is still throwing a fit saying the limits need to be static but they are set as user defined.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2026 18:20:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Control-Limit-refreshing-for-Control-Charts/m-p/943073#M109545</guid>
      <dc:creator>WFzw</dc:creator>
      <dc:date>2026-04-20T18:20:30Z</dc:date>
    </item>
  </channel>
</rss>

