<?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: Control charts Alarm Script: identify rows into data table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Control-charts-Alarm-Script-identify-rows-into-data-table/m-p/192612#M41183</link>
    <description>&lt;P&gt;Yes, it looks like the alarm script seems to be a blunt instrument in that there's no obvious way (to me . . . ) that the values of 'qc_sample' can be related to the levels of the 'By' variable, and thence to the appropriate row in the data table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, depending on what else is going on in your script, you might be able to use 'Process Screening' to get what you need. The script below should get you started: Run it and inspect the log and the two 'detail' tables it makes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

// Make some data
dt = NewTable("Alarms",
		NewColumn("By", Numeric, Nominal, Formula(RandomInteger(1,2))),
		NewColumn("Data", Numeric, Continuous, Formula(RandomNormal(0,1)))
		);
dt &amp;lt;&amp;lt; addRows(1000);

// Use process screening invisibly to get the details of all alarms (one table for each level of the 'By' variable)
ps = dt &amp;lt;&amp;lt; Process Screening( Y(Column(dt, "Data")), By(Column(dt, "By")), Invisible );
dtList = ps &amp;lt;&amp;lt; saveDetailsTable;
Report(ps[1]) &amp;lt;&amp;lt; closeWindow;

// Control chart with alarm script
cc = dt &amp;lt;&amp;lt; Control Chart(
						Chart Col( :Data, Individual Measurement, Moving Range ),
						By( :By ),
						Alarm Script(
							Write(
								"Out of Control for test ",
								qc_test,
								" in column ",
								qc_col,
								" in sample ",
								qc_sample,
								"\!N"
							)
						)
					);
// Turn on Test 1
cc &amp;lt;&amp;lt; Test 1(1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 11 Apr 2019 14:14:58 GMT</pubDate>
    <dc:creator>ian_jmp</dc:creator>
    <dc:date>2019-04-11T14:14:58Z</dc:date>
    <item>
      <title>Control charts Alarm Script: identify rows into data table</title>
      <link>https://community.jmp.com/t5/Discussions/Control-charts-Alarm-Script-identify-rows-into-data-table/m-p/192598#M41178</link>
      <description>&lt;P&gt;I would identify the rows associated with the triggered alarms. The handler that is called when alarms are triggered receive the information about the points, in particular qc_sample (and qc_firstRow qc_lastRow). This should be perfect if there is just one chart. The sample identify the row of the table if we have individual measurements. Unfortunately, I have a BY column that splits into many charts. In this case the qc_sample refers to the sample of each chart and this make difficult to retrive the corresponding rows into the table. Is there a simple way to get them?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 12:14:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Control-charts-Alarm-Script-identify-rows-into-data-table/m-p/192598#M41178</guid>
      <dc:creator>antonio-domenic</dc:creator>
      <dc:date>2019-04-11T12:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Control charts Alarm Script: identify rows into data table</title>
      <link>https://community.jmp.com/t5/Discussions/Control-charts-Alarm-Script-identify-rows-into-data-table/m-p/192612#M41183</link>
      <description>&lt;P&gt;Yes, it looks like the alarm script seems to be a blunt instrument in that there's no obvious way (to me . . . ) that the values of 'qc_sample' can be related to the levels of the 'By' variable, and thence to the appropriate row in the data table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, depending on what else is going on in your script, you might be able to use 'Process Screening' to get what you need. The script below should get you started: Run it and inspect the log and the two 'detail' tables it makes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

// Make some data
dt = NewTable("Alarms",
		NewColumn("By", Numeric, Nominal, Formula(RandomInteger(1,2))),
		NewColumn("Data", Numeric, Continuous, Formula(RandomNormal(0,1)))
		);
dt &amp;lt;&amp;lt; addRows(1000);

// Use process screening invisibly to get the details of all alarms (one table for each level of the 'By' variable)
ps = dt &amp;lt;&amp;lt; Process Screening( Y(Column(dt, "Data")), By(Column(dt, "By")), Invisible );
dtList = ps &amp;lt;&amp;lt; saveDetailsTable;
Report(ps[1]) &amp;lt;&amp;lt; closeWindow;

// Control chart with alarm script
cc = dt &amp;lt;&amp;lt; Control Chart(
						Chart Col( :Data, Individual Measurement, Moving Range ),
						By( :By ),
						Alarm Script(
							Write(
								"Out of Control for test ",
								qc_test,
								" in column ",
								qc_col,
								" in sample ",
								qc_sample,
								"\!N"
							)
						)
					);
// Turn on Test 1
cc &amp;lt;&amp;lt; Test 1(1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Apr 2019 14:14:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Control-charts-Alarm-Script-identify-rows-into-data-table/m-p/192612#M41183</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2019-04-11T14:14:58Z</dc:date>
    </item>
  </channel>
</rss>

