Hello, I am working on an automated script for outputting control charts based on a list of parameters. I have a stacked data table like below

which I am trying to generate control charts from. As far as the scripting goes I have this so far
Rcols = dt_final << Get Column Names();
id = dt_final << get kets;
tb = tabbox();
for(i, i<=nitems(id), i++,
cols = Rcols;
dt = dt_final << subset(by(id[i]));
dt << sort(by(dt, :DATE_TIME_START), Order(Ascending), Replace Table);
ccExpr = Expr(Control Chart(
Sample Label( column(dt,:DATE_TIME_START) ),
KSigma( 3 ),
For( i = 1, i <= N Items( cols ), i++,
insert into(ccExpr, EvalExpr(Chart Col( Column( dt_final, Expr(cols[i]) ), Levey Jennings )))
);
cc = Eval(EvalExpr(
platform(dt_final,
Expr(
nameexpr(ccExpr)
)
)
));
);
tb << Append(group, cc);
// Create the display window
));
nw = New Window( "Control Charts", Outlinebox("Control Charts By Process ID", tb));I know I am probably off of the best way of going about this but this is ultimately what i need to do:
- Subset dt_final by the grouping
- change the date column to numeric -> continuous -> time -> m/d/y h:m (just for uniformity)
- sort the subsets by date_time_start
- generate levey jennings control charts for each column and append it to the tabbox
- and since not every group has all the columns delete the charts with no data
There are a few steps still missing in here as far as like changing the date data type, however, if someone could give me some direction on this loop.
Thanks.