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.
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 <= NRow(x), i++,
// Need to accumulate selected rows, not adding duplicates
If( Selected(RowState(x[i])) & !Contains(::wasSelected, x[i]),
::wasSelected = VConcat(::wasSelected, x[i])
);
);
);
// Assign the handler to the table
rsh = dt << MakeRowStateHandler(updateWasSelected);
// Do the partition and allow user to make selections vis leaf node LRT
obj = dt << Partition(
Y( :NPN1 ),
X( :PNP1, :PNP2, :PNP3, :PNP4, :NPN2, :NPN3, :NPN4 ),
Method( "Decision Tree" )
);
obj << ShowGraph( 0 );
obj << SplitBest( 4 );
obj << Show Split Count( 1 );
obj << Show Split Prob( 1 );
// Figure out what has been selected and make the auxilliary tables
obj << onClose(
If( NRows(::wasSelected) > 0,
filepath = "$Desktop";
Try(
dtTemp = dt << subset( invisible, rows( ::wasSelected ), selected columns( 0 ) );
Close( dtTemp, save( filepath || "\" || "badpopulation.jmp" ) ),
Print("No rows for table!");
);
dt << invert row selection;
Try(
dtSEG = dt << subset( invisible, selected rows( 1 ), selected columns( 0 ) );
Close( dtSEG, save( filepath || "\" || "goodpopulation.jmp" ) ),
Print("No rows for table!");
);
);
dt << clearRowStates;
);