cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
RosDima
Level II

Eval & Expr

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)" ) ),
X( :Radius ),
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)" ) ),
X( :Radius ),
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)" ) ),
X( :Radius ),
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)" ) ),
X( :Radius ),
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.

1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Eval & Expr

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)))
);

View solution in original post

3 REPLIES 3
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Eval & Expr

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)))
);
RosDima
Level II

Re: Eval & Expr

Hi,

 

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

 

Thanks

Re: Eval & Expr

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?