And I figured it out somehow......Don't know it's efficient or not but do the needful....
Re-Coded:
unique_val=Associative Array(
sorted_summary:"ISB Paste Source/Plasma Type"<<GetValues
)<<GetKeys;
disp=Function({key,value},
result_win=New Window("Control Charts For"|| key,
H List Box(
Panel Box("Individual & Moving Range",Current Data Table(sorted_summary);
cc=Control Chart(
Sample Label(:ISB Date Manf.),
Group Size(1),KSigma(3),
process_clmn,Individual Measurement),
Where(:Name("ISB Paste Source/Plasma Type")==key)
);
If(
value==1,IR_dt1=cc<<In New Table("invisible");IR_dt1<<New Column("Chart Type",Character,Nominal);:Chart Type<<Set Each Value("Individual");IR_dt1<<New Column("Parameter",Character,Nominal);
:Parameter<<Set Each Value(clmn_nm);Column(clmn_nm)<<Set Name(key),
value==2,IR_dt=cc<<In New Table("invisible");Column(clmn_nm)<<Set Name(key);IR_dt2=IR_dt<<Join(With(IR_dt1),Merge Same Name Columns,Drop multiples(0,0),Preserve main table order(1));
Close(IR_dt1,No Save);Close(IR_dt,No Save),
value==3,IR_dt=cc<<In New Table("invisible");Column(clmn_nm)<<Set Name(key);IR_dt3=IR_dt<<Join(With(IR_dt2),Merge Same Name Columns,Drop multiples(0,0),Preserve main table order(1));
Close(IR_dt2,No Save);Close(IR_dt,No Save),
value==4,IR_dt=cc<<In New Table("invisible");Column(clmn_nm)<<Set Name(key);IR_dt4=IR_dt<<Join(With(IR_dt3),Merge Same Name Columns,Drop multiples(0,0),Preserve main table order(1));
Close(IR_dt3,No Save);Close(IR_dt,No Save),
value==5,IR_dt=cc<<In New Table("invisible");Column(clmn_nm)<<Set Name(key);IR_dt5=IR_dt<<Join(With(IR_dt4),Merge Same Name Columns,Drop multiples(0,0),Preserve main table order(1));
Close(IR_dt4,No Save);Close(IR_dt,No Save),
value==6,IR_dt=cc<<In New Table("invisible");Column(clmn_nm)<<Set Name(key);IR_dt6=IR_dt<<Join(With(IR_dt5),Merge Same Name Columns,Drop multiples(0,0),Preserve main table order(1));
Close(IR_dt5,No Save);Close(IR_dt,No Save),
value==7,IR_dt=cc<<In New Table("invisible");Column(clmn_nm)<<Set Name(key);IR_dt7=IR_dt<<Join(With(IR_dt6),Merge Same Name Columns,Drop multiples(0,0),Preserve main table order(1));
IR_dt7<<Move Selected Columns({"Chart Type"},To First);IR_dt7<<Move Selected Columns({"Parameter"},To First);Close(IR_dt6,No Save);Close(IR_dt,No Save);
);
),
.........Continued same as above for other Control Charts and concatenated the 7th table of each chart to generate final limit table and closed all other.
)
result_win<<Close Window;
);<<<<<<<Function Ends Here
For(i=1,i<=N Items(unique_val),i++,
disp(unique_val[i],i);
);
** (Might miss some other variables so just to update regarding it)
clmn_nm is a variable which I'm getting from user input using this
New Window( "Select Process/Parameter Column",<<Modal,Panel Box("Select Columns",clmn=Col List Box(all)));