<?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: Script for Control Charts (all numeric Columns) with saved Limits in one table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-for-Control-Charts-all-numeric-Columns-with-saved-Limits/m-p/41305#M24105</link>
    <description>&lt;P&gt;Thank you very much. It works perfectly. It will save so much time&amp;nbsp; :)&lt;/img&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jun 2017 09:22:40 GMT</pubDate>
    <dc:creator>mkennke</dc:creator>
    <dc:date>2017-06-28T09:22:40Z</dc:date>
    <item>
      <title>Script for Control Charts (all numeric Columns) with saved Limits in one table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-Control-Charts-all-numeric-Columns-with-saved-Limits/m-p/41298#M24102</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to generate one Window/Report with several Control Charts (all numeric columns of the data table). So far I was able to generate this report. But I'm not able to save all Limits in one data table. Can anybody help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following my code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table ();

//Deselection von allen Spalten
cols = dt &amp;lt;&amp;lt; get column names();
For(i = 1, i &amp;lt;= N Col(dt), i++,
    cols[i] &amp;lt;&amp;lt; set selected (0)
);

//Selection 
cc = dt &amp;lt;&amp;lt; Get Column Names( numeric );
ncols = N Items( cc );
For( i = 1, i &amp;lt;= ncols, i++,
cc[i] &amp;lt;&amp;lt; Set Selected( 1 )
);

nw1 = New Window ("Control Charts");

For( i = 1, i &amp;lt;= ncols, i++,
test = cc[i];
conc = Control Chart(
	Group Size( 1 ),
	KSigma( 3 ),
	Chart Col(as Column (test) ),
	Chart Type( Moving Range )
); nw1 &amp;lt;&amp;lt; append (Report(conc)); conc &amp;lt;&amp;lt; Close Window);

nw1 &amp;lt;&amp;lt; in New Table;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Jun 2017 07:24:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-Control-Charts-all-numeric-Columns-with-saved-Limits/m-p/41298#M24102</guid>
      <dc:creator>mkennke</dc:creator>
      <dc:date>2017-06-28T07:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Control Charts (all numeric Columns) with saved Limits in one table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-Control-Charts-all-numeric-Columns-with-saved-Limits/m-p/41304#M24104</link>
      <description>&lt;P&gt;Here is my solution to your code. &amp;nbsp;I commented out code that I did not see was serving any purpose for this specific issue&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

//Deselection von allen Spalten
/*cols = dt &amp;lt;&amp;lt; get column names();
For( i = 1, i &amp;lt;= N Col( dt ), i++,
	cols[i] &amp;lt;&amp;lt; set selected( 0 )
);*/

//Selection 
cc = dt &amp;lt;&amp;lt; Get Column Names( numeric );
/*ncols = N Items( cc );
For( i = 1, i &amp;lt;= ncols, i++,
	cc[i] &amp;lt;&amp;lt; Set Selected( 1 )
);*/

nw1 = New Window( "Control Charts" );

For( i = 1, i &amp;lt;= N Items( cc ), i++, 

	Current Data Table( dt );  // Should not be required, but script would not work without it
	conc = dt &amp;lt;&amp;lt; Control Chart( Group Size( 1 ), KSigma( 3 ), Chart Col( As Column( cc[i] ) ), Chart Type( Moving Range ) );
	concDT = conc &amp;lt;&amp;lt; in New Table;
	concDT &amp;lt;&amp;lt; New Column( "Column", character, set each value( Char( cc[i] ) ) );
	Column( concDT, Char( cc[i] ) ) &amp;lt;&amp;lt; set name( "Value" );
	If( i == 1,
		baseDT = concDT,
		baseDT &amp;lt;&amp;lt; concatenate( concDT, append to first table( 1 ) );
		Close( concDT, nosave );
	);
	nw1 &amp;lt;&amp;lt; append( Report( conc ) );
	
	conc &amp;lt;&amp;lt; Close Window;
				
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Jun 2017 08:59:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-Control-Charts-all-numeric-Columns-with-saved-Limits/m-p/41304#M24104</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-06-28T08:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Control Charts (all numeric Columns) with saved Limits in one table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-Control-Charts-all-numeric-Columns-with-saved-Limits/m-p/41305#M24105</link>
      <description>&lt;P&gt;Thank you very much. It works perfectly. It will save so much time&amp;nbsp; :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 09:22:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-Control-Charts-all-numeric-Columns-with-saved-Limits/m-p/41305#M24105</guid>
      <dc:creator>mkennke</dc:creator>
      <dc:date>2017-06-28T09:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Control Charts (all numeric Columns) with saved Limits in one table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-Control-Charts-all-numeric-Columns-with-saved-Limits/m-p/41307#M24106</link>
      <description>&lt;P&gt;. . . and here's an alternative using column properties:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);
// Make a table with some random data
dt = NewTable("Charts");
n = 5;
dt &amp;lt;&amp;lt; addMultipleColumns("C_", n, Numeric);
dt &amp;lt;&amp;lt; addRows(20);
for(c=1, c&amp;lt;=n, c++, Column(dt, "C_"||Char(c)) &amp;lt;&amp;lt; formula(RandomNormal(0, 1)));
dt &amp;lt;&amp;lt; runFormulas;
// Put the charts into a single window
nw1 = New Window ("Control Charts",
			For( c = 1, c &amp;lt;= n, c++,
					thisCC = dt &amp;lt;&amp;lt; Control Chart(
												Group Size( 1 ),
												KSigma( 3 ),
												Chart Col(Column(dt, "C_"||Char(c))),
												Chart Type( Moving Range )
											);
					// Save the computed limits as a column property
					thisCC &amp;lt;&amp;lt; inColumn;
					);
				);
// Make a blank limits table
dt2 = NewTable("Limts",
				NewColumn("Column", Character),
				NewColumn("Avg", Numeric),
				NewColumn("LCL", Numeric),
				NewColumn("UCL", Numeric),
				&amp;lt;&amp;lt; addRows(n)
				);
// Populate the limits table by parsing the saved column property
For( c = 1, c &amp;lt;= n, c++,
	clExpr = Column(dt, "C_"||Char(c)) &amp;lt;&amp;lt; getProperty("Control Limits");
	Column(dt2, "Column")[c] = "C_"||Char(c);
	Column(dt2, "Avg")[c] = Arg(Arg(Arg(clExpr, 1), 1), 1);
	Column(dt2, "LCL")[c] = Arg(Arg(Arg(clExpr, 1), 2), 1);
	Column(dt2, "UCL")[c] = Arg(Arg(Arg(clExpr, 1), 3), 1);
	);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I suspect this might be simpler with &lt;A href="http://www.jmp.com/support/help/Control_Chart_Builder.shtml" target="_self"&gt;Control Chart Builder&lt;/A&gt;, but I didn't check (and you may have reasons for using the 'old' platform anyway).&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 09:50:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-Control-Charts-all-numeric-Columns-with-saved-Limits/m-p/41307#M24106</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2017-06-28T09:50:13Z</dc:date>
    </item>
  </channel>
</rss>

