cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
shasha_2
Level III

JSL Partition get selected rows

I am using the JMP Partition() function in my JSL script for the decision tree, I wanted to know how to get the selected rows once the user selects the segment for which rows are selected. I tried using the Get Selected Row but it's not able to understand the table. Does anyone has any idea how to code it?

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: JSL Partition get selected rows

You can use 

<< Make Row State Handler()

to trigger when new rows are selected from the Partition() platform

Names Default To Here( 1 );
dt = 
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

f = Function( {a},
	theRows = Current Data Table() << get selected rows;
	Show( theRows );
);

rs = Current Data Table() << make row state handler( f );

dt << Partition(
	Y( :NPN1 ),
	X(
		:PNP1, :PNP2, :NPN2, :PNP3, :IVP1, :PNP4, :NPN3, :IVP2, :NPN4, :SIT1, :INM1, :INM2,
		:VPM1, :VPM2
	)
);
Jim

View solution in original post

3 REPLIES 3
Georg
Level VII

Re: JSL Partition get selected rows

if you select certain columns in the partition tree,

than you will see the selection in your table,

and can get the rows by the command "get selected rows()", see also scripting index for examples:

r = dt << Get Selected Rows();

However I do not know how you would like to control the interaction with the user selecting rows in the decision tree. A simplified example of your code would be very helpful.

Georg
txnelson
Super User

Re: JSL Partition get selected rows

You can use 

<< Make Row State Handler()

to trigger when new rows are selected from the Partition() platform

Names Default To Here( 1 );
dt = 
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

f = Function( {a},
	theRows = Current Data Table() << get selected rows;
	Show( theRows );
);

rs = Current Data Table() << make row state handler( f );

dt << Partition(
	Y( :NPN1 ),
	X(
		:PNP1, :PNP2, :NPN2, :PNP3, :IVP1, :PNP4, :NPN3, :IVP2, :NPN4, :SIT1, :INM1, :INM2,
		:VPM1, :VPM2
	)
);
Jim
shasha_2
Level III

Re: JSL Partition get selected rows

Thanks a lot, it worked.