cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
shuey
Level II

Y Function using data table values

I'm trying to build multiple graph boxes, each one plots a Y Function that takes values from a data table. This should be an easy task however I'm not able to get the plots to show in the graph boxes. It works with hard coded numbers, but not with values from a Data Table

win = New Window("window", vlb = V List Box());
For (i=1, i <= N Rows(dt), i++,
	vlb << Append(Graph Box(Y Function((dt:M)[i] * x ,x)));
);

Any help would be much appreciated

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Y Function using data table values

If you look at the scripts that get created, you see that the values are not there

jthi_0-1750157426355.png

This is because you will have to evaluate them. Something like this should work 

Names Default To Here(1);

dt = open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "height") << Set Name("M");

nw = New Window("window", vlb = V List Box());
For Each Row(dt,
	Eval(EvalExpr(
		vlb << Append(Graph Box(Y Function(Expr(dt[Row(), "M"]) * x ,x)));
	))
);

jthi_1-1750157594825.png

 

Also use for each row when looping over data table as it is meant for it

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: Y Function using data table values

If you look at the scripts that get created, you see that the values are not there

jthi_0-1750157426355.png

This is because you will have to evaluate them. Something like this should work 

Names Default To Here(1);

dt = open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "height") << Set Name("M");

nw = New Window("window", vlb = V List Box());
For Each Row(dt,
	Eval(EvalExpr(
		vlb << Append(Graph Box(Y Function(Expr(dt[Row(), "M"]) * x ,x)));
	))
);

jthi_1-1750157594825.png

 

Also use for each row when looping over data table as it is meant for it

-Jarmo

Recommended Articles