Hi @vince_faller
a broader version of this question was asked later https://community.jmp.com/t5/Discussions/Finding-the-X-range-that-will-include-a-certain-portion-of-...
my solution is as follows. could anyone chack if it is robust? thank you.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// this is just in case wewant to bring the data back to original row order later.
rowcol = New Column("Row", Numeric, "Continuous", Format("Best", 12), Formula(Row()));
dt << run formulas();
rowcol << suppress eval( true );
// now we start working
dt << Sort( By( :weight ), Order( Ascending ), replace table );
// here is where we define the share of included range (0.5)
difcol = New Column("dif", Numeric, "Continuous", Format("Best", 12), Formula(Abs(:weight - Lag(:weight, -(N Rows() * 0.5)))));
dt << run formulas();
difcol << suppress eval( true );
start = (dt<<get rows where(Col minimum (:dif)==:dif))[1];
// here we also mantion the share of included range (0.5)
end = start + nrows(dt)*0.5 -1;
// new binary column for in or out the range
dt << New Column("inrange", Numeric, "Ordinal");
for each row (:inrange = if (and (row() >= start, row()<=end),1 ,0 ));