## Eval & Expr

Community Trekker

Joined:

Jan 17, 2017

Hi All,

I am trying to use next code:

x = summDt:Slot[1];
y = summDt:Slot[2];
z = summDt:Slot[3];
t = summDt:Slot[4];

New Window( "EtchRate By (Slot) - Bivariate",
V List Box(
Bivariate(
Y( :Name( "Mean(ER)" ) ),
Fit Each Value( {Line Color( {213, 72, 87} )} ),
Where( :Slot == eval(x)),
SendToReport(
Dispatch( {}, "Bivar Plot", FrameBox, {Marker Size( 4 )} )
)
),
Bivariate(
Y( :Name( "Mean(ER)" ) ),
Fit Each Value( {Line Color( {213, 72, 87} )} ),
Where( :Slot== eval(y) ),
SendToReport(
Dispatch( {}, "Bivar Plot", FrameBox, {Marker Size( 4 )} )
)
),
Bivariate(
Y( :Name( "Mean(ER)" ) ),
Fit Each Value( {Line Color( {213, 72, 87} )} ),
Where(:Slot==eval(z) ),
SendToReport(
Dispatch( {}, "Bivar Plot", FrameBox, {Marker Size( 4 )} )
)
),
Bivariate(
Y( :Name( "Mean(ER)" ) ),
Fit Each Value( {Line Color( {213, 72, 87} )} ),
Where(:Slot== eval(t) ),
SendToReport(
Dispatch( {}, "Bivar Plot", FrameBox, {Marker Size( 4 )} )
)
)
)

);

But have issue with Eval function, how can I use it to show specific values from DT? I want to use Slot number without knowing it before each use, I know that I have 4 different Slot numbers and for each one need to build graph.

Thanks.

3 REPLIES

Super User

Joined:

Jun 23, 2011

It should work without Eval(). Make sure that dt is the current data table or send the Bivariate() command to dt explicitly.

Example:

``````dt = Open("\$SAMPLE_DATA/Big Class.jmp");
dtsum = dt << summary(Group(sex));

x = dtsum:sex[1];
y = dtsum:sex[2];

New Window("Height By Weight - Bivariate",
V List Box(
dt << Bivariate(Y(:height), X(:weight), Where(:sex == x)),
dt << Bivariate(Y(:height), X(:weight), Where(:sex == y))
)
);

//Alternative using By(), if all "slots" are to be graphed
New Window("Height By Weight - Bivariate",
V List Box(dt << Bivariate(Y(:height), X(:weight), By(:sex)))
);``````

Community Trekker

Joined:

Jan 17, 2017

Hi,

Instead of number it I am getting :sex==x, my goal to get :sex==Expr(x) ==> :sex==1, in case x=1

Thanks

Community Trekker

Joined:

Oct 6, 2014

Please can you give more details about what your final report should look like? Can you explain why the answer MS gave is not suitable? Have you tried using the Dashboard builder with local data filters on each graph?