There aren't really any easy options of doing this outside of using a button. You might be able to use duplicate tables and row state handlers but I would suggest doing this, as Row State Handler is very buggy in JMP
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
dt2 = dt << Subset(All Rows, Selected Columns(0), private);
f = Function({a},
selages = dt[a, "age"];
rowstoselect = dt2 << Get Rows Where(Contains(selages, :age));
rowstates = J(1, N Rows(dt2), 0);
rowstates[rowstoselect] = 1;
dt2 << Set Row States(rowstates);
);
rs = dt << make row state handler(f);
nw = New Window("",
H List Box(
gb = dt << Graph Builder(
Size(525, 490),
Show Control Panel(0),
Variables(X(:age), Y(:height), Group X(:sex)),
Elements(Bar(X, Y, Legend(12)))
),
gb2 = dt2 << Graph Builder(
Size(525, 448),
Show Control Panel(0),
Variables(X(:age), Y(:height)),
Elements(Bar(X, Y, Legend(4))),
SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox,
{Fill Selection Mode("Selected Outlined")}
)
)
)
)
);
I will create wish list item regarding this type of cases but until that here is wish list item in hopes that JMP will improve different handlers we have
Improve JMP's state handlers (hover label, row state handler, filter state handler, scheduler, ...)
-Jarmo