For Loops and Column ListsHi,
I am intending to build a Graph Builder for visualizing different columns of data each time. The Graph Builder should be able to take whatever many inputs columns (as long as it's less than 8). I built an input GUI but I dont think the y-values are recorded. How can I correctly pass the selected Y column data to the graph builder? Thanks!


Automation and ScriptingData AccessWindowsRe: For Loops and Column ListsPlease use the
icon to display your JSL. It allows for the reader to test your code and provide responses. Pasting in images of your code will not allow this, and therefore many possible responders will opt not to respond because of the time it would take to retype in your JSL
Re: For Loops and Column ListsThe embedded log is showing "Specified Column not found in data table. in access or evaluation of 'For' , For/*###*/(j = 1, j <= Min( 8, N Items( yCol ) ), j++, Y( Eval( yCol[j] ) ))"
But I used the column is clearly in my data table.
Re: For Loops and Column Listsnames Default To Here(1);
MyGraph = Function ({yCol,xCol},{default local},
vlb = VListBox(
Graph Builder(
Size( 1255, 981 ),
Show Control Panel( 0 ),
Variables(
X( Eval(xCol) ),
For(j = 1, j <= Min(8, N Items(yCol)), j++,
Y( Eval(yCol[j])) // Evaluate each yVar
),
Group X( :Temperature )
),
Elements( Points( X, Y( 1 ), Y( 2 ), Y( 3 ), Y( 4 ), Y( 5 ), Y( 6 ), Y( 7 ), Y( 8 ), Legend( 11 ) ) ),
Local Data Filter(
Add Filter(
columns( :Test Stage, :Sublot, :Temperature, :Soft Bin ),
Display( :Test Stage, N Items( 4 ) ),
Display( :Soft Bin, N Items( 15 ) )
)
)
)
);
return(vlb);
);
dt = CurrentDatatable();
nw = NewWindow("Column Selection", <<MODAL></MODAL>Re: For Loops and Column ListsThanks for the advice, here is my full script.
Re: For Loops and Column ListsYou could prepare your Variables first and then use insert into to put them into Graph builder.
MyGraph = Function ({yCol,xCol},{default local},
vars= Eval Expr(Variables(
X( Expr(xCol) ),
Group X( :Temperature )
));
pts= Expr(Points( X));
For(j = 1, j <= Min(8, N Items(yCol)), j++,
Insert Into(vars, Eval Expr(Y( Expr(yCol[j]))));
);
gb = Expr(
Graph Builder(
));
Insert Into(gb, Name Expr(vars));
VListBox(gb)
);Re: For Loops and Column ListsThings like this will get easier once :folded_hands: Expression Indexing: read and write access will be available in future version of JMP ...
Then you don't have to prepare the different parts and then construct your final expression, you can directly create a draft of the final expression and then manipulate it on any level you want.
e.g. add an additional Y variable via
Insert Into ( gbExpression["Variables"], Expr(Y(:age)))
Re: For Loops and Column ListsIt worked! Thank you so much!