<?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 selection of partition segments in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Multiple-selection-of-partition-segments/m-p/475726#M72022</link>
    <description>&lt;P&gt;I want to select multiple segments when the partition model is shown. The selected segments will go into the badpopulation jmp file and the rest will go to the good population jmp file. But I don't know how to code it for multiple selection of the segments.&lt;/P&gt;&lt;P&gt;My code is as follows where it can make the separation into two categories:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\semiconductor capability.jmp" );

obj = Partition(
	Y( :NPN1 ),
	X( :PNP1, :PNP2, :PNP3, :PNP4, :NPN2, :NPN3, :NPN4 ),
	Method( "Decision Tree" ),
	Validation Portion( .2 )
);
obj &amp;lt;&amp;lt; ShowGraph( 0 );
obj &amp;lt;&amp;lt; SplitBest( 4 );
obj &amp;lt;&amp;lt; Show Split Count( 1 );
obj &amp;lt;&amp;lt; Show Split Prob( 1 );
Wait( .5 );
obj &amp;lt;&amp;lt; on close(
If( N Items( dt &amp;lt;&amp;lt; get selected rows() ) &amp;gt; 0,
dtTemp = dt &amp;lt;&amp;lt; subset( invisible, selected rows( 1 ), selected columns( 0 ) );
dt &amp;lt;&amp;lt; invert row selection;
dtSEG = dt &amp;lt;&amp;lt; subset(  invisible, selected rows( 1 ), selected columns( 0 ) );
filepath = "$Desktop";
Close( dtTemp, save( filepath || "\" || "badpopulation.jmp" ) );
Close(dtSEG, save(filepath || "\" || "goodpopulation.jmp"));
)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I want to add for multiple segments,suppose the highlighted ones and get them into one jmp file&amp;nbsp;&lt;/P&gt;&lt;P&gt;(badpopulation) and rest data into other jmp file(goodpopulation) can anyone help me regarding this coding?&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snapseg.PNG" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41451i2009B57D79EDEA0E/image-size/large?v=v2&amp;amp;px=999" role="button" title="snapseg.PNG" alt="snapseg.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:46:41 GMT</pubDate>
    <dc:creator>shasha_2</dc:creator>
    <dc:date>2023-06-10T23:46:41Z</dc:date>
    <item>
      <title>Multiple selection of partition segments</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-selection-of-partition-segments/m-p/475726#M72022</link>
      <description>&lt;P&gt;I want to select multiple segments when the partition model is shown. The selected segments will go into the badpopulation jmp file and the rest will go to the good population jmp file. But I don't know how to code it for multiple selection of the segments.&lt;/P&gt;&lt;P&gt;My code is as follows where it can make the separation into two categories:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\semiconductor capability.jmp" );

obj = Partition(
	Y( :NPN1 ),
	X( :PNP1, :PNP2, :PNP3, :PNP4, :NPN2, :NPN3, :NPN4 ),
	Method( "Decision Tree" ),
	Validation Portion( .2 )
);
obj &amp;lt;&amp;lt; ShowGraph( 0 );
obj &amp;lt;&amp;lt; SplitBest( 4 );
obj &amp;lt;&amp;lt; Show Split Count( 1 );
obj &amp;lt;&amp;lt; Show Split Prob( 1 );
Wait( .5 );
obj &amp;lt;&amp;lt; on close(
If( N Items( dt &amp;lt;&amp;lt; get selected rows() ) &amp;gt; 0,
dtTemp = dt &amp;lt;&amp;lt; subset( invisible, selected rows( 1 ), selected columns( 0 ) );
dt &amp;lt;&amp;lt; invert row selection;
dtSEG = dt &amp;lt;&amp;lt; subset(  invisible, selected rows( 1 ), selected columns( 0 ) );
filepath = "$Desktop";
Close( dtTemp, save( filepath || "\" || "badpopulation.jmp" ) );
Close(dtSEG, save(filepath || "\" || "goodpopulation.jmp"));
)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I want to add for multiple segments,suppose the highlighted ones and get them into one jmp file&amp;nbsp;&lt;/P&gt;&lt;P&gt;(badpopulation) and rest data into other jmp file(goodpopulation) can anyone help me regarding this coding?&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snapseg.PNG" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41451i2009B57D79EDEA0E/image-size/large?v=v2&amp;amp;px=999" role="button" title="snapseg.PNG" alt="snapseg.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:46:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-selection-of-partition-segments/m-p/475726#M72022</guid>
      <dc:creator>shasha_2</dc:creator>
      <dc:date>2023-06-10T23:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple selection of partition segments</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-selection-of-partition-segments/m-p/475751#M72029</link>
      <description>&lt;P&gt;It looks like you want to allow the selection of the rows associated with multiple leaf nodes via the 'Select Rows' LRT option. If that's the case, you might be able to use a row state handler, and the code below should get you started. Note this assumes that the user does not make row selections other than via the Partition report.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA\semiconductor capability.jmp" );

// Matrix of all rows that were selected
::wasSelected = [];

// Row state handler function
updateWasSelected = Function({x}, {Default Local},
						// 'x' is a column vector of row states that have CHANGED. We just need those that are now selected . . .
						For( i = 1, i &amp;lt;= NRow(x), i++,
							// Need to accumulate selected rows, not adding duplicates
							If( Selected(RowState(x[i])) &amp;amp; !Contains(::wasSelected, x[i]),
								::wasSelected = VConcat(::wasSelected, x[i]) 
								);
							);
						);
// Assign the handler to the table
rsh = dt &amp;lt;&amp;lt; MakeRowStateHandler(updateWasSelected);

// Do the partition and allow user to make selections vis leaf node LRT
obj = dt &amp;lt;&amp;lt; Partition(
					Y( :NPN1 ),
					X( :PNP1, :PNP2, :PNP3, :PNP4, :NPN2, :NPN3, :NPN4 ),
					Method( "Decision Tree" )
				);
obj &amp;lt;&amp;lt; ShowGraph( 0 );
obj &amp;lt;&amp;lt; SplitBest( 4 );
obj &amp;lt;&amp;lt; Show Split Count( 1 );
obj &amp;lt;&amp;lt; Show Split Prob( 1 );

// Figure out what has been selected and make the auxilliary tables
obj &amp;lt;&amp;lt; onClose(
			If( NRows(::wasSelected) &amp;gt; 0,
				filepath = "$Desktop";
				Try(
					dtTemp = dt &amp;lt;&amp;lt; subset( invisible, rows( ::wasSelected ), selected columns( 0 ) );
					Close( dtTemp, save( filepath || "\" || "badpopulation.jmp" ) ),
					Print("No rows for table!");
					);
				dt &amp;lt;&amp;lt; invert row selection;
				Try(
					dtSEG = dt &amp;lt;&amp;lt; subset( invisible, selected rows( 1 ), selected columns( 0 ) );
					Close( dtSEG, save( filepath || "\" || "goodpopulation.jmp" ) ),
					Print("No rows for table!");
					 );
				);
			dt &amp;lt;&amp;lt; clearRowStates;
		);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Apr 2022 09:52:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-selection-of-partition-segments/m-p/475751#M72029</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2022-04-04T09:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple selection of partition segments</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-selection-of-partition-segments/m-p/475894#M72041</link>
      <description>Thank you so much. I will try this one out.</description>
      <pubDate>Mon, 04 Apr 2022 13:49:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-selection-of-partition-segments/m-p/475894#M72041</guid>
      <dc:creator>shasha_2</dc:creator>
      <dc:date>2022-04-04T13:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple selection of partition segments</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-selection-of-partition-segments/m-p/476054#M72058</link>
      <description>&lt;P&gt;Without using scripting there is a nice solution using the point and click features in JMP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First select the rows in the leaf that has "Bad" values, using the Red Triangle Menu (RTM) in the leaf.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-04-04 at 2.32.52 PM.png" style="width: 137px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41480iA567201EB83EB311/image-dimensions/137x206?v=v2" width="137" height="206" role="button" title="Screen Shot 2022-04-04 at 2.32.52 PM.png" alt="Screen Shot 2022-04-04 at 2.32.52 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Next Name the Selection in Column from the Rows menu tab&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-04-04 at 2.33.31 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41483i0DCC7BCF1B1F09E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-04-04 at 2.33.31 PM.png" alt="Screen Shot 2022-04-04 at 2.33.31 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;Enter a title for your new column and a label for your "bad" rows.&lt;/P&gt;
&lt;P&gt;Don't enter a value for the unselected rows. Just leave it blank&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-04-04 at 2.33.17 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41484i08DE48D805B62858/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-04-04 at 2.33.17 PM.png" alt="Screen Shot 2022-04-04 at 2.33.17 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;Repeat this step for each "Bad" Leaf&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 18:40:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-selection-of-partition-segments/m-p/476054#M72058</guid>
      <dc:creator>Byron_JMP</dc:creator>
      <dc:date>2022-04-04T18:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple selection of partition segments</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-selection-of-partition-segments/m-p/476057#M72059</link>
      <description>&lt;P&gt;Maybe an even better or easier solution:&lt;/P&gt;
&lt;P&gt;After you build your tree. Use the RTM to Save the Leaf Numbers&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Byron_JMP_0-1649097687831.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41485iAD5F410EB4563B23/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Byron_JMP_0-1649097687831.png" alt="Byron_JMP_0-1649097687831.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;Then use Fit YbyX to do an ANOVA using Leaf Number as the X and your response at the Y, and pick the "Bad" leaves off the tree.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-04-04 at 2.43.44 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41486iDE88BD898E928452/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-04-04 at 2.43.44 PM.png" alt="Screen Shot 2022-04-04 at 2.43.44 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 18:43:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-selection-of-partition-segments/m-p/476057#M72059</guid>
      <dc:creator>Byron_JMP</dc:creator>
      <dc:date>2022-04-04T18:43:57Z</dc:date>
    </item>
  </channel>
</rss>

