Hello,
I'm trying to create a subset table and then show it in a report for different process column values. In this case there are 12 total process values and script working fine for 11 of them and showing the subset result correctly but for final value it is selecting all rows. Don't know why. Tried too many things but not able to figure it out.
Code:
plot=Function({lmts,pmt_path,flg,ppath,hpath},
param_dt=Open(pmt_path,"invisible");
param_summ=param_dt<<Summary(Invisible,
Group(:Group By,:Process,:Sample Label,:By))<<Show Window(0);
For(q=11,q<=NRow(param_summ),q++,Current Data Table(param_summ);
obj=New Window("Trend Analysis Report "||Long Date(Today()),
vlb=V list Box()
);obj<<Show Window(0);
col1=:Group By[q];col2=:Process[q];col3=:Sample Label[q];col4=:By[q];
Current Data Table(lmts);
clms=lmts<<Get Column Names(String);
Remove From(clms,1,3);
Current Data Table(dt);
summ_dt=dt<<Summary(Invisible,Group(As Name(col1),As Name(col2),As Name(col3),As Name(col4)));srt_summ=summ_dt<<Sort(Invisible,By(As Name(col3)),Order(Ascending));
srt_summ<<select where(!Contains(Loc Nonmissing(srt_summ<<get as matrix),Row()));srt_summ<<Delete Rows;srt_summ<<Delete Columns(N Rows);
For(t=1,t<=N Items(clms),t++,Current Data Table(lmts);
indv_lmts=As Column(clms[t])[lmts<<Get Rows Where(:Parameter==col2 & :Chart Type=="Individual")];
cusum_lmts=As Column(clms[t])[lmts<<Get Rows Where(:Parameter==col2 & :Chart Type=="CUSUM")];
ewma_lmts=As Column(clms[t])[lmts<<Get Rows Where(:Parameter==col2 & :Chart Type=="EWMA")];
If(
And(OR(IsMissing(indv_lmts[5]),IsMissing(indv_lmts[6]),IsMissing(indv_lmts[7])),IsMissing(cusum_lmts[5]),IsMissing(ewma_lmts[5])),Continue(),
display(srt_summ,col1,col2,col3,col4,clms[t],indv_lmts,cusum_lmts,ewma_lmts);
);
);
For(y=1,y<=N Items(rws),y++,
rw=rws[y];
tr<<AddRows({:Test Number=rw[1],:Batch Details=rw[2],:Date Processed=rw[3],:Paste Type=rw[4],:Process Name=rw[5],:Process Value=rw[6]});
);
Remove From(rws,1,N Items(rws));
add_win=New Window("",Current Data Table(dt);
summ_mn=dt<<Summary(Invisible,Group(As Name(col1),As Name(col4)),Mean(As Name(col2)));Current Data Table(summ_mn);
hb=H List Box(
Oneway(
Y(Column Name(4)),
X(Eval(NameExpr(col4))),
All Pairs(1,LSD Threshold Matrix(0),Ordered Differences Report(0)),Means and Std Dev(1),Comparison Circles(1),Points Jittered(1),Mean Error Bars(0),Std Dev Lines(0),Grand Mean(0)
);
);
);
tr<<Select Where(:Process Name==col2);tr1=tr<<Subset(Selected);show(tr<<Get Selected Rows);
TB=Table Box(
Number Col Box("Test Number",(Column(tr1,"Test Number")<<get values)),String Col Box("Batch Number",(Column(tr1,"Batch Details")<<get values)),
String Col Box("Paste Type",(Column(tr1,"Paste Type")<<get values)),String Col Box("Process Name",(Column(tr1,"Process Name")<<get values)),
Number Col Box("Process Value",(Column(tr1,"Process Value")<<get values),<<set format(6,1)),<<table style("Heading Separator")
);Close(tr1,No Save);
TB<<set shade alternate rows(1);
hb<<Append(TB);
vlb<<Append(add_win);add_win<<Close Window;
nm=Substitute(col2,"/"," Per ");
If(
flg=="old",obj<<Save PDF(ppath||"/"||nm||".pdf");obj<<Save Interactive HTML(hpath||"/"||nm||".htm"),
flg=="old_new_lim",obj<<Save PDF(ppath||"/"||nm||".pdf");obj<<Save Interactive HTML(hpath||"/"||nm||".htm"),
flg=="new",obj<<Save PDF(ppath||"/"||nm||".pdf");obj<<Save Interactive HTML(hpath||"/"||nm||".htm");
);
obj<<Close Window;
);
);
Red line is where it is selecting in code above.
The show command next to it is giving this output in log:
tr << Get Selected Rows = [](0, 1);
Any help/guidance would be appreciated.