@psundar6 ,
Another approach to your problem is to update table selections using table row state handler functions. Using @txnelson example, the script below creates these handlers. Then any graph you create from this two tables will have linked selection states, unless a local data filter is deployed.
names default to here(1);
dt=open("$SAMPLE_DATA/blood pressure.jmp");
dt<<new column("Row",formula(row()));
dt:row<<delete formula;
dtStack = dt << Stack(
columns( :BP 8M, :BP 12M ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" )
);
//Create functions to handle row state changes
//if dt selected row state is changed, change dtStack selected state
f1 = Function({a}, {dtr1={}},
if(Is Scriptable(dtStack),
dtr1 = AsList(dt << get selected rows);
If(nitems(dtr1)>0,
dtStack << select where(contains(dtr1,dtStack:row) ),
nitems(dtr1)==0,
dtStack << clear select
);
); //end if
);
//if dtStack selected row state is changed, change dt selected state
f2 = Function({a}, {dtr2={}},
If( Is Scriptable(dt),
dtr2 = Associative Array(AsList(dtStack:row[dtStack << get selected rows])) <<get keys;
If(nitems(dtr2)>0,
dt << select rows(dtr2) ,
nitems(dtr2)==0,
dt << clear select
);
); //end if
);
//create the row state handlers
rs1 = dt << Make Row State Handler(f1);
rs2 = dtStack << Make Row State Handler(f2);
//any graph created from these two tables will be linked, unless a local filter is deployed
nw = new window("", HListBox(
biv = dt << Bivariate( Y( :BP 8M ), X( :BP 12M ) ),
vc = dtStack << Variability Chart( Y( :Data ), X( :Label ) )
)// end Hlist Box
);