Wonderful, thanks @danschikore
I will use it a hundred times and more!
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Selection Filter",
Data Filter Context Box(
H List Box(
dfsb = Data Filter Source Box(
gb = Graph Builder(
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :age ), Y( :sex ) ),
Elements( Heatmap( X, Y, Legend( 4 ) ) )
)
),
Graph Builder(
Size( 534, 464 ),
Show Control Panel( 0 ),
Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
Elements( Points( X, Y, Legend( 11 ) ), Smoother( X, Y, Legend( 12 ) ) )
)
)
)
);
Wait( 1 );
t0=hptime();
f= Function({x},
rs = dfsb << Get Row States();
myrows = loc(rs,0);
myages= associative array(dt[myrows,"age"]) << get keys;
myrows = dt << get rows where(:age == myages[1]);
rs[1::Nitems(rs)]=0;
rs[myrows] = 1;
dfsb << Set Row States( dt,rs );
Print(rs);
rsh = dfsb << Make RowState Handler (dt,f); // sometimes I have to set the rowstate handler again - loop detection?
);
rsh = dfsb << Make RowState Handler (dt,f);