I want to create a generic script to create a data table.
In the first part of the Script I have a list to select columns for creation of data table:
nw = New Window("Create data table",
<<TYPE></TYPE>
In the second part the I need a script which creates a data table depending on selected columns (numbers of columns and names of column are different). Below two examples for normal script (not generic):
Example1:
dt_data = Current Data Table();
dt_LimitCalc = dt_data << Summary(
Group(:GROUP, :CHART, :EVALUATION, :NAME),
N(:VALUE),
Mean(:VALUE),
Std Dev(:VALUE),
Mean(:Limit1),
Mean(:Limit2),
Freq("None"),
Weight("None")
);
Example 2:
dt_data = Current Data Table();
dt_LimitCalc = dt_data << Summary(
Group(:GROUP, :CHART, :EVALUATION, :NAME),
N(:VALUE),
Mean(:VALUE),
Std Dev(:VALUE),
Mean(:xy_Limit),
Mean(:Limi_xy),
Mean(:Lim_123),
Freq("None"),
Weight("None")
);

Can somebody helps to create a generic script depending on selected columns? Only the bold part changes. All other parts are the same.
Edit (jthi): Added JSL formatting and image of bolded parts
You can pass your list to Mean with Eval
dt << Summary(
Mean(Eval(list names_limit))
);