<?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 Multiple control charts with user defined K value where the number and names of the Y variables are unknown in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Multiple-control-charts-with-user-defined-K-value-where-the/m-p/893007#M105397</link>
    <description>&lt;P&gt;I'm trying to write a robust script that will allow the user to specify a Sigma K value and select Y columns from a list of all the continuous columns and create the L-J charts for each and save the limits to a tall data table.&lt;/P&gt;
&lt;P&gt;The script isn't creating any errors but isn't creating the graphical output.&lt;/P&gt;
&lt;P&gt;I can't see where I'm going wrong, script below and attached&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Current Data Table();

// Get list of continuous columns
contCols = {};
For(i = 1, i &amp;lt;= N Cols(dt), i++,
	col = Column(dt, i);
	If(col &amp;lt;&amp;lt; Get Modeling Type == "Continuous",
		Insert Into(contCols, col &amp;lt;&amp;lt; Get Name)
	);
);

If(N Items(contCols) == 0,
	Show Message(
		"No continuous columns found.", "Please ensure your data table has continuous columns."
	);
	Stop();
);

// Dialog for selecting columns and k
colList = .;
kNum = .;
dialogResult = .;

nw = New Window("Levey-Jennings Chart Setup",
	&amp;lt;&amp;lt;Modal,
	V List Box(
		Text Box("Select up to 50 continuous columns:"),
		colList = List Box(contCols, maxSelected(50)),
		Text Box("Enter k (number of SDs for Shewhart control limits):"),
		kNum = Number Edit Box(3)
	),
	H List Box(
		Button Box("OK",
			Expr(
				dialogResult = 1;
				nw &amp;lt;&amp;lt; Close Window;
			)
		),
		Button Box("Cancel",
			Expr(
				dialogResult = 0;
				nw &amp;lt;&amp;lt; Close Window;
			)
		)
	)
);

If(dialogResult == 1,
	selectedCols = colList &amp;lt;&amp;lt; Get Selected;
	k = kNum &amp;lt;&amp;lt; Get;
	If(N Items(selectedCols) == 0,
		Show Message("No columns selected.", "Please select at least one column.");
		Stop();
	);

// Build an array of column references for Y()
	yColsArray = {};
	For(i = 1, i &amp;lt;= N Items(selectedCols), i++,
		Insert Into(yColsArray, Column(dt, selectedCols[i]))
	);

// Launch Control Chart Builder with expanded array using Eval List()
	dt &amp;lt;&amp;lt; Control Chart Builder(
		Show Two Shewhart Charts(0),
		K Sigma(k),
		Variables(Y(Eval List(yColsArray))),
		Chart(Points(Statistic("Individual")), Limits(Sigma("Levey Jennings"))),
		Show Control Panel(0)
	);
,
	Print("Dialog canceled.")
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edit (jthi): added jsl formatting&lt;/P&gt;</description>
    <pubDate>Thu, 07 Aug 2025 11:25:55 GMT</pubDate>
    <dc:creator>NBrammer</dc:creator>
    <dc:date>2025-08-07T11:25:55Z</dc:date>
    <item>
      <title>Multiple control charts with user defined K value where the number and names of the Y variables are unknown</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-control-charts-with-user-defined-K-value-where-the/m-p/893007#M105397</link>
      <description>&lt;P&gt;I'm trying to write a robust script that will allow the user to specify a Sigma K value and select Y columns from a list of all the continuous columns and create the L-J charts for each and save the limits to a tall data table.&lt;/P&gt;
&lt;P&gt;The script isn't creating any errors but isn't creating the graphical output.&lt;/P&gt;
&lt;P&gt;I can't see where I'm going wrong, script below and attached&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Current Data Table();

// Get list of continuous columns
contCols = {};
For(i = 1, i &amp;lt;= N Cols(dt), i++,
	col = Column(dt, i);
	If(col &amp;lt;&amp;lt; Get Modeling Type == "Continuous",
		Insert Into(contCols, col &amp;lt;&amp;lt; Get Name)
	);
);

If(N Items(contCols) == 0,
	Show Message(
		"No continuous columns found.", "Please ensure your data table has continuous columns."
	);
	Stop();
);

// Dialog for selecting columns and k
colList = .;
kNum = .;
dialogResult = .;

nw = New Window("Levey-Jennings Chart Setup",
	&amp;lt;&amp;lt;Modal,
	V List Box(
		Text Box("Select up to 50 continuous columns:"),
		colList = List Box(contCols, maxSelected(50)),
		Text Box("Enter k (number of SDs for Shewhart control limits):"),
		kNum = Number Edit Box(3)
	),
	H List Box(
		Button Box("OK",
			Expr(
				dialogResult = 1;
				nw &amp;lt;&amp;lt; Close Window;
			)
		),
		Button Box("Cancel",
			Expr(
				dialogResult = 0;
				nw &amp;lt;&amp;lt; Close Window;
			)
		)
	)
);

If(dialogResult == 1,
	selectedCols = colList &amp;lt;&amp;lt; Get Selected;
	k = kNum &amp;lt;&amp;lt; Get;
	If(N Items(selectedCols) == 0,
		Show Message("No columns selected.", "Please select at least one column.");
		Stop();
	);

// Build an array of column references for Y()
	yColsArray = {};
	For(i = 1, i &amp;lt;= N Items(selectedCols), i++,
		Insert Into(yColsArray, Column(dt, selectedCols[i]))
	);

// Launch Control Chart Builder with expanded array using Eval List()
	dt &amp;lt;&amp;lt; Control Chart Builder(
		Show Two Shewhart Charts(0),
		K Sigma(k),
		Variables(Y(Eval List(yColsArray))),
		Chart(Points(Statistic("Individual")), Limits(Sigma("Levey Jennings"))),
		Show Control Panel(0)
	);
,
	Print("Dialog canceled.")
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edit (jthi): added jsl formatting&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 11:25:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-control-charts-with-user-defined-K-value-where-the/m-p/893007#M105397</guid>
      <dc:creator>NBrammer</dc:creator>
      <dc:date>2025-08-07T11:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple control charts with user defined K value where the number and names of the Y variables are unknown</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-control-charts-with-user-defined-K-value-where-the/m-p/893017#M105398</link>
      <description>&lt;P&gt;There are plenty of mistakes in the script and I assume it was created by some LLM. If you wish to do scripting in JMP outside of JMP created scripts, I suggest you check out&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/en/18.2/jmp/introduction-to-writing-jsl-scripts.shtml" target="_blank" rel="noopener"&gt;Scripting Guide&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Current Data Table();

nw = New Window("Levey-Jennings Chart Setup", &amp;lt;&amp;lt; Type("Modal Dialog"),
	H List Box(
		Lineup Box(N Col(1),
			Text Box("Select up to 50 continuous columns:"),
			fcs = Filter Col Selector(dt, &amp;lt;&amp;lt; Nominal(0), &amp;lt;&amp;lt; Ordinal(0), &amp;lt;&amp;lt; Continuous(1), Character(0), &amp;lt;&amp;lt; Set Max Selected(50)),
			Text Box("Enter k (number of SDs for Shewhart control limits):"),
			neb = Number Edit Box(3)
		),	
		Lineup Box(N Col(1),
			Button Box("OK",
				selcols = fcs &amp;lt;&amp;lt; get selected;
				ksig = neb &amp;lt;&amp;lt; get;
			),
			Button Box("Cancel")
		)
	)
);

If(nw["Button"] != 1,
	Throw("Cancelled");
);

If(N Items(selcols) == 0,
	Throw("No columns selected");
);

collist = Transform Each({colname}, selcols, Name Expr(AsColumn(dt, colname)));
Substitute Into(collist, Expr(List), Expr(Y));

ccb = Eval(EvalExpr(dt &amp;lt;&amp;lt; Control Chart Builder(
	Show Two Shewhart Charts(0),
	K Sigma(Expr(ksig)),
	Variables(Expr(Name Expr(collist))),
	Chart(Points(Statistic("Individual")), Limits(Sigma("Levey Jennings"))),
	Show Control Panel(0)
)));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;</description>
      <pubDate>Thu, 07 Aug 2025 11:39:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-control-charts-with-user-defined-K-value-where-the/m-p/893017#M105398</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-08-07T11:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple control charts with user defined K value where the number and names of the Y variables are unknown</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-control-charts-with-user-defined-K-value-where-the/m-p/893018#M105399</link>
      <description>&lt;P&gt;Thank you - perfect&lt;/P&gt;
&lt;P&gt;I'll go through line by line and try and understand what's happening&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 12:03:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-control-charts-with-user-defined-K-value-where-the/m-p/893018#M105399</guid>
      <dc:creator>NBrammer</dc:creator>
      <dc:date>2025-08-07T12:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple control charts with user defined K value where the number and names of the Y variables are unknown</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-control-charts-with-user-defined-K-value-where-the/m-p/893020#M105400</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/54113"&gt;@NBrammer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really like this guide from Don McCormack about running platforms without knowing the column names or number of:&amp;nbsp;&lt;A href="https://community.jmp.com/t5/JSL-Cookbook/Run-a-Platform-without-Knowing-the-Number-or-Names-of-Columns/ta-p/464407" target="_blank"&gt;https://community.jmp.com/t5/JSL-Cookbook/Run-a-Platform-without-Knowing-the-Number-or-Names-of-Columns/ta-p/464407&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Ben&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 12:06:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-control-charts-with-user-defined-K-value-where-the/m-p/893020#M105400</guid>
      <dc:creator>Ben_BarrIngh</dc:creator>
      <dc:date>2025-08-07T12:06:30Z</dc:date>
    </item>
  </channel>
</rss>

