- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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)))
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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)))
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content