Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Evaluating an expression with where function and displaying output

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Created:
Apr 16, 2018 9:14 AM
| Last Modified: Apr 16, 2018 9:28 AM
(5064 views)

Hi, I am making a series of graphs from a data table which are separated based off variable names in another table. Basically when I make a bivariate graph of y vs x, the by is selected from another table of names. I put the graphs in a lineup box but I can not get the where to use the actual values which the variables represent. In addition, a separate text box appears above the graphs with the where designated instead of displaying in the graph title. Basically, I see Where(:Parameter == CofA_dt10:Parameter[w]) but I would like to see the expression evaluated for the different values of w so we know which variable the graph represents. I have tried multiple variations of eval, eval expr and parse and can not get the test to display the way I want. My code is below, any suggestions would be greatly appreciated. It doesnt display with the EVAL function included as below, if I delete the EVAL function, the window will display but with the problem described above.

```
CofA_dt10 = Data Table( "GraphData" ) << Summary(
Group( :Parameter ),
Freq( "None" ),
Weight( "None" )
);
output2 = lineup box(Ncol(1));
row_count = nrow(CofA_dt10);
for(w=1, w<=row_count-1, w++,
output2 << append (CofA_dt9 << Bivariate(
Y( :test_value ),
X( :received_date ),
Where( :Parameter == Eval(CofA_dt10:Parameter[w])),
SendToReport(
Dispatch(
{},
"Bivariate Fit of CofA Parameter Value By received_date",
OutlineBox,
{Set Title( "CofA Material Parameter Value By received_date" )}
),
Dispatch( {}, "1", ScaleBox, {Label Row( Label Orientation( "Angled" ) )} ),
Dispatch( {}, "test_value", TextEditBox, {Set Text( "Value" )} )
)
))
); //end row loop
```

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Hi Uday, that did not work; I am unable to evaluate the expression in the

where statement. However, I modified the code you sent me and I am able to

evaluate the expression within the graph title. If I find a way to delete

the text box above the graphs with the following "Where(:Parameter == Eval(

Parse( Eval Insert( "Stmt" ) ) ))" then this should be an acceptable

solution. I am still curious why this works in the graph title but not in

the where statement but that is for my own understanding.

CofA_dt10 = Data Table*(* "GraphData" *)* << *Summary(* Group*(* :Parameter

*)*, Freq*(* "None" *)*, Weight*(* "None" *)* *)*;

output2 = Lineup Box*(* N Col*(* *1* *)* *)*;

row_count = N Row*(* CofA_dt10 *)*;

For*(* w = *1*, w <= row_count - *1*, w++,

Stmt = CofA_dt10:Parameter*[*w*]*;

output2 << *append(*

CofA_dt9 <<

Bivariate*(*

Y*(* :test_value *)*,

X*(* :received_date *)*,

Where*(* :Parameter == Eval*(* Parse*(* Eval Insert*(* "Stmt" *)* *)* *)*

*)*,

SendToReport*(*

Dispatch*(*

*{}*,

"Bivariate Fit of test_value By received_date",

OutlineBox,

*{*Set Title*(* "CofA Parameter Value By received_date" ||" " || Eval*(*

Parse*(* Eval Insert*(* "Stmt" *)* *)* *)* *)}*

*)*,

Dispatch*(* *{}*, "1", ScaleBox, *{*Label Row*(* Label Orientation*(*

"Angled" *)* *)}* *)*,

Dispatch*(*

*{}*,

"test_value",

TextEditBox,

*{*Set Text*(*

"Value"

*)}*

*)*

*)))*

*);*

where statement. However, I modified the code you sent me and I am able to

evaluate the expression within the graph title. If I find a way to delete

the text box above the graphs with the following "Where(:Parameter == Eval(

Parse( Eval Insert( "Stmt" ) ) ))" then this should be an acceptable

solution. I am still curious why this works in the graph title but not in

the where statement but that is for my own understanding.

CofA_dt10 = Data Table*(* "GraphData" *)* << *Summary(* Group*(* :Parameter

*)*, Freq*(* "None" *)*, Weight*(* "None" *)* *)*;

output2 = Lineup Box*(* N Col*(* *1* *)* *)*;

row_count = N Row*(* CofA_dt10 *)*;

For*(* w = *1*, w <= row_count - *1*, w++,

Stmt = CofA_dt10:Parameter*[*w*]*;

output2 << *append(*

CofA_dt9 <<

Bivariate*(*

Y*(* :test_value *)*,

X*(* :received_date *)*,

Where*(* :Parameter == Eval*(* Parse*(* Eval Insert*(* "Stmt" *)* *)* *)*

*)*,

SendToReport*(*

Dispatch*(*

*{}*,

"Bivariate Fit of test_value By received_date",

OutlineBox,

*{*Set Title*(* "CofA Parameter Value By received_date" ||" " || Eval*(*

Parse*(* Eval Insert*(* "Stmt" *)* *)* *)* *)}*

*)*,

Dispatch*(* *{}*, "1", ScaleBox, *{*Label Row*(* Label Orientation*(*

"Angled" *)* *)}* *)*,

Dispatch*(*

*{}*,

"test_value",

TextEditBox,

*{*Set Text*(*

"Value"

*)}*

*)*

*)))*

*);*

4 REPLIES 4

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Evaluating an expression with where function and displaying output

@tsolomon,

What you might want to try is this:

```
CofA_dt10 = Data Table( "GraphData" ) << Summary( Group( :Parameter ), Freq( "None" ), Weight( "None" ) );
output2 = Lineup Box( N Col( 1 ) );
row_count = N Row( CofA_dt10 );
For( w = 1, w <= row_count - 1, w++,
Stmt = CofA_dt10:Parameter[w];
output2 << append(
CofA_dt9 << Bivariate(
Y( :test_value ),
X( :received_date ),
Where( :Parameter == Eval(Parse(Eval Insert("\[Stmt]\")) ) ),
SendToReport(
Dispatch(
{},
"Bivariate Fit of CofA Parameter Value By received_date",
OutlineBox,
{Set Title( "CofA Material Parameter Value By received_date" )}
),
Dispatch( {}, "1", ScaleBox, {Label Row( Label Orientation( "Angled" ) )} ),
Dispatch( {}, "test_value", TextEditBox, {Set Text( "Value" )} )
)
)
)
); //end row loop
```

You essentially want to wrap the eval with an Eval Insert and Parse

Best

Uday

Uday

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Evaluating an expression with where function and displaying output

Thank you Uday but unfortunately, that still doesn't work for me. the title

of the graph appears as "

Where(:Parameter == Eval( Parse( Eval Insert( "Stmt" ) ) ))" instead of

displaying Stmt for each graph. I am using JMP 12 if that makes a

difference.

Cheers,

Tesfu

of the graph appears as "

Where(:Parameter == Eval( Parse( Eval Insert( "Stmt" ) ) ))" instead of

displaying Stmt for each graph. I am using JMP 12 if that makes a

difference.

Cheers,

Tesfu

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Evaluating an expression with where function and displaying output

One edit, I think this might work, if not please let me know and I will take a look at it

```
CofA_dt10 = Data Table( "GraphData" ) << Summary( Group( :Parameter ), Freq( "None" ), Weight( "None" ) );
output2 = Lineup Box( N Col( 1 ) );
row_count = N Row( CofA_dt10 );
For( w = 1, w <= row_count - 1, w++,
Stmt = CofA_dt10:Parameter[w];
output2 << append(
CofA_dt9 << Bivariate(
Y( :test_value ),
X( :received_date ),
Eval(Parse(Eval Insert("\[Where( :Parameter == [^Stmt^]\")) ) ),
SendToReport(
Dispatch(
{},
"Bivariate Fit of CofA Parameter Value By received_date",
OutlineBox,
{Set Title( "CofA Material Parameter Value By received_date" )}
),
Dispatch( {}, "1", ScaleBox, {Label Row( Label Orientation( "Angled" ) )} ),
Dispatch( {}, "test_value", TextEditBox, {Set Text( "Value" )} )
)
)
)
); //end row loop
```

Best

Uday

Uday

Highlighted
Hi Uday, that did not work; I am unable to evaluate the expression in the

where statement. However, I modified the code you sent me and I am able to

evaluate the expression within the graph title. If I find a way to delete

the text box above the graphs with the following "Where(:Parameter == Eval(

Parse( Eval Insert( "Stmt" ) ) ))" then this should be an acceptable

solution. I am still curious why this works in the graph title but not in

the where statement but that is for my own understanding.

CofA_dt10 = Data Table*(* "GraphData" *)* << *Summary(* Group*(* :Parameter

*)*, Freq*(* "None" *)*, Weight*(* "None" *)* *)*;

output2 = Lineup Box*(* N Col*(* *1* *)* *)*;

row_count = N Row*(* CofA_dt10 *)*;

For*(* w = *1*, w <= row_count - *1*, w++,

Stmt = CofA_dt10:Parameter*[*w*]*;

output2 << *append(*

CofA_dt9 <<

Bivariate*(*

Y*(* :test_value *)*,

X*(* :received_date *)*,

Where*(* :Parameter == Eval*(* Parse*(* Eval Insert*(* "Stmt" *)* *)* *)*

*)*,

SendToReport*(*

Dispatch*(*

*{}*,

"Bivariate Fit of test_value By received_date",

OutlineBox,

*{*Set Title*(* "CofA Parameter Value By received_date" ||" " || Eval*(*

Parse*(* Eval Insert*(* "Stmt" *)* *)* *)* *)}*

*)*,

Dispatch*(* *{}*, "1", ScaleBox, *{*Label Row*(* Label Orientation*(*

"Angled" *)* *)}* *)*,

Dispatch*(*

*{}*,

"test_value",

TextEditBox,

*{*Set Text*(*

"Value"

*)}*

*)*

*)))*

*);*

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

where statement. However, I modified the code you sent me and I am able to

evaluate the expression within the graph title. If I find a way to delete

the text box above the graphs with the following "Where(:Parameter == Eval(

Parse( Eval Insert( "Stmt" ) ) ))" then this should be an acceptable

solution. I am still curious why this works in the graph title but not in

the where statement but that is for my own understanding.

CofA_dt10 = Data Table*(* "GraphData" *)* << *Summary(* Group*(* :Parameter

*)*, Freq*(* "None" *)*, Weight*(* "None" *)* *)*;

output2 = Lineup Box*(* N Col*(* *1* *)* *)*;

row_count = N Row*(* CofA_dt10 *)*;

For*(* w = *1*, w <= row_count - *1*, w++,

Stmt = CofA_dt10:Parameter*[*w*]*;

output2 << *append(*

CofA_dt9 <<

Bivariate*(*

Y*(* :test_value *)*,

X*(* :received_date *)*,

Where*(* :Parameter == Eval*(* Parse*(* Eval Insert*(* "Stmt" *)* *)* *)*

*)*,

SendToReport*(*

Dispatch*(*

*{}*,

"Bivariate Fit of test_value By received_date",

OutlineBox,

*{*Set Title*(* "CofA Parameter Value By received_date" ||" " || Eval*(*

Parse*(* Eval Insert*(* "Stmt" *)* *)* *)* *)}*

*)*,

Dispatch*(* *{}*, "1", ScaleBox, *{*Label Row*(* Label Orientation*(*

"Angled" *)* *)}* *)*,

Dispatch*(*

*{}*,

"test_value",

TextEditBox,

*{*Set Text*(*

"Value"

*)}*

*)*

*)))*

*);*

Article Labels

There are no labels assigned to this post.