It looks like the logic for selecting the flagged rows might need to be a little more specific?
If( :Person == Lag( :Person, 1 ) & :Compound == Lag( :Compound, 1 ), 0, 1)
Try running this script against the dose table in Jeff's post, then run the sort script first, followed by the subset script.
dt=current data table();
dt<<New Script( "Sort First", dt = Current Data Table(); dt << Sort( replace table,
By( :Person, :Compound, :Dose ), Order( Ascending, Ascending, Ascending )););
dt<<New Script( "subset flagged rows", dt = Current Data Table(); dt << Select Where( :Flag == 1 );
dt << Subset( Output Table( "Subset of dose bw" ), Selected Rows( 0 ), Rows( [1, 3, 5, 6] ), Selected columns only( 0 )););
dt<<New Column( "Flag",
Numeric, Nominal, Format( "Best", 12 ),
Formula( If( :Person == Lag( :Person, 1 ) & :Compound == Lag( :Compound, 1 ),
0, 1 ) ));
JMP Systems Engineer, Health and Life Sciences (Pharma)