Hi JMP experts,
Somehow I think my post just got deleted, post it again
I have a DOE table with many predicted formula, these formulae have X, Y axis relationship
I would like to rearrange data table into below format so that I can draw surface plot (X, Y, Value) to see how it changes as I change parameter
Two issues:
1. I can get formulae then concate to below format if ( row == 1, formula 1, if( row == 2, formula 2, ......etc)
But eventually the formula is a long char with "", I need to manully remove "' for the formula to work
2. I use H list box to get value and set each row to change parameters, so that I can see how surface plot changes. But ideally I would like to use scorll bar to change the parameter so that I can see the changes more smoothly
dt = data table("example DOE table");
dt2 = current data table();
colname = dt << get column names();
colnamelist = {};
formulalist = {};
loopword = char("If( Row() == ");
mid = char("");
final = char("");
//Get column names with predicted formula
for (i = 1, i <= N items(colname),i++,
pos = Contains (colname[i], "Pred F");
if(pos == 1 , insert into(colnamelist, colname[i]), continue())
);
//Get formula from columns and save into list
for each({colval}, colnamelist,
eval(evalexpr(
formula = Char(Expr(Name Expr(As Column(dt,colval))) << get formula());
));
insert into (formulalist, formula)
);
//Concat formulas to below format: If( row == 1, Formula 1, If( row ==2, Forumla 2, If( row == 3, formula 3)))......etc
for (i=1, i <= N rows() , i++,
mid = mid || loopword || char(i) || ", " || char(formulalist[i]) || ", "
);
final = mid || char("0");
for (i=1, i <= N rows() , i++,
final = final || char(")")
);
eval(evalexpr(
:height << set formula(expr(final))
));
nw = New Window( "process paramaeter setting",
H List Box( Text Box( " Input Parameter A " ), A = Number Edit Box() ),
H List Box( Text Box( " Input Parameter B " ), B = Number Edit Box() ),
H List Box( Text Box( " Input Parameter C " ), C = Number Edit Box() ),
H List Box( Text Box( " Input Parameter D " ), D = Number Edit Box() ),
Button Box( "OK",
theA = A << get;
theB = B << get;
theC = C << get;
theD = D << get;
:Parameter A << set each value(theA);
:Parameter B << set each value(theB);
:Parameter C << set each value(theC);
:Parameter D << set each value(theD);
//Somehow the column with formula cannot draw into surface plot directly, so I have to copy and paste value to anohter column to draw
newheight = :height << get values;
:newheight<< set values(newheight);
)
)