<?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 create a data table subgroup for a control chart using a subset button function in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-create-a-data-table-subgroup-for-a-control-chart-using-a/m-p/423920#M67313</link>
    <description>&lt;P&gt;You've done most of the work. Here's one way to finish it off:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

// Data table with some continuous columns
dt = Open("$SAMPLE_DATA/Big Class.jmp" );
colNamesList = dt &amp;lt;&amp;lt; get Column names (string, Continuous);

// Control chart
gb = dt &amp;lt;&amp;lt; Control Chart Builder(Show Control Panel( 0 ), Variables( Y( eval(colNamesList[1]) ) ));

// Add a column switcher
cs = gb &amp;lt;&amp;lt; Column Switcher(colNamesList[1], Eval( colNamesList ));

// 'Extra' button with subset action
subsetButton = Button Box("Click to Create a Subset of Selected Points",
							If( N Rows( dt &amp;lt;&amp;lt; get selected rows ) &amp;gt; 0,
								currentCol = cs &amp;lt;&amp;lt; getCurrent;
								dt2 = dt &amp;lt;&amp;lt; subset( selected rows( 1 ), Columns(Eval(Column(dt, currentCol))));
								dt2 &amp;lt;&amp;lt; setName("Subset of "||(dt &amp;lt;&amp;lt; getName)||" using "||currentCol);
								,
								Beep();
								);
							);

// Add this button to the control chart report (use 'topParent' so that this is not affected by any column switcher changes)
(Report(gb)[OutlineBox("Control Chart Builder")] &amp;lt;&amp;lt; topParent) &amp;lt;&amp;lt; append(subsetButton);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 06 Oct 2021 15:17:01 GMT</pubDate>
    <dc:creator>ian_jmp</dc:creator>
    <dc:date>2021-10-06T15:17:01Z</dc:date>
    <item>
      <title>How to create a data table subgroup for a control chart using a subset button function</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-create-a-data-table-subgroup-for-a-control-chart-using-a/m-p/423877#M67308</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to create a data table subgroup for a control chart using a subset button function. I found this link&amp;nbsp;&lt;LI-MESSAGE title="Creating a Subset from an Interactive Graph?" uid="114459" url="https://community.jmp.com/t5/Discussions/Creating-a-Subset-from-an-Interactive-Graph/m-p/114459#U114459" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&amp;nbsp;to something similar but it is for rows. I would like to use the Columns instead. I have multiple columns and I am using the column switcher with the control charts. I would like to be able to select specific data points on the control chart and only get the data for those points in that specific column.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the JSL I tried to use and I tried to modify to columns and failed.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt5= Data Table( "SPC Columns" );
colNamesList = dt5 &amp;lt;&amp;lt; get Column names (string, Continuous);

gb= dt5 &amp;lt;&amp;lt; Control Chart Builder(
	Size( 534, 464 ),
	Show Control Panel( 0 ),
	Variables( Y( eval(colNamesList[1]) ) ),
	Chart(
		Position( 1 ),
		Limits( Shade Zones( 1 ) ),
		Warnings(
			Test 1( 1 ),
			Test 2( 1 ),
			Test 3( 1 ),
			Test 4( 1 ),
			Test 5( 1 ),
			Test 6( 1 ),
			Test 7( 1 ),
			Test 8( 1 )
		)),
Column Switcher(colNamesList[1], Eval( colNamesList ))
	
);

subsetButton = Button Box( "Click to Create a Subset of Selected Points",
	If( N Rows( dt5 &amp;lt;&amp;lt; get selected rows ) &amp;gt; 0,
		dt5 &amp;lt;&amp;lt; subset( selected rows( 1 ), selected columns( 0 ) )
	)
);

Report( gb )["Graph Builder"] &amp;lt;&amp;lt; append( subsetButton );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will give me all the columns that have data in the rows I would just like the single column of data when I select those specific data points.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Ryan&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>Fri, 09 Jun 2023 19:58:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-create-a-data-table-subgroup-for-a-control-chart-using-a/m-p/423877#M67308</guid>
      <dc:creator>rmthomas</dc:creator>
      <dc:date>2023-06-09T19:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a data table subgroup for a control chart using a subset button function</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-create-a-data-table-subgroup-for-a-control-chart-using-a/m-p/423920#M67313</link>
      <description>&lt;P&gt;You've done most of the work. Here's one way to finish it off:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

// Data table with some continuous columns
dt = Open("$SAMPLE_DATA/Big Class.jmp" );
colNamesList = dt &amp;lt;&amp;lt; get Column names (string, Continuous);

// Control chart
gb = dt &amp;lt;&amp;lt; Control Chart Builder(Show Control Panel( 0 ), Variables( Y( eval(colNamesList[1]) ) ));

// Add a column switcher
cs = gb &amp;lt;&amp;lt; Column Switcher(colNamesList[1], Eval( colNamesList ));

// 'Extra' button with subset action
subsetButton = Button Box("Click to Create a Subset of Selected Points",
							If( N Rows( dt &amp;lt;&amp;lt; get selected rows ) &amp;gt; 0,
								currentCol = cs &amp;lt;&amp;lt; getCurrent;
								dt2 = dt &amp;lt;&amp;lt; subset( selected rows( 1 ), Columns(Eval(Column(dt, currentCol))));
								dt2 &amp;lt;&amp;lt; setName("Subset of "||(dt &amp;lt;&amp;lt; getName)||" using "||currentCol);
								,
								Beep();
								);
							);

// Add this button to the control chart report (use 'topParent' so that this is not affected by any column switcher changes)
(Report(gb)[OutlineBox("Control Chart Builder")] &amp;lt;&amp;lt; topParent) &amp;lt;&amp;lt; append(subsetButton);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Oct 2021 15:17:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-create-a-data-table-subgroup-for-a-control-chart-using-a/m-p/423920#M67313</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2021-10-06T15:17:01Z</dc:date>
    </item>
  </channel>
</rss>

