Evaluating an expression with where function and displaying outputHi, 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
Re: Evaluating an expression with where function and displaying outputHi 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"
*)}*
*)*
*)))*
*);*
Re: Evaluating an expression with where function and displaying output@tsolomon,
One edit, I think this might work, if not please let me know and I will take a look at it
CofA_dt10 <SPAN class="token operator">=</SPAN> <SPAN class="token function">Data Table</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"GraphData"</SPAN> <SPAN class="token punctuation">)</SPAN> <SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN> Summary<SPAN class="token punctuation">(</SPAN> Group<SPAN class="token punctuation">(</SPAN> <SPAN class="token punctuation">:</SPAN><SPAN class="token function">Parameter</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN> Freq<SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"None"</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN> Weight<SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"None"</SPAN> <SPAN class="token punctuation">)</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
output2 <SPAN class="token operator">=</SPAN> <SPAN class="token function">Lineup Box</SPAN><SPAN class="token punctuation">(</SPAN> N Col<SPAN class="token punctuation">(</SPAN> <SPAN class="token number">1</SPAN> <SPAN class="token punctuation">)</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
row_count <SPAN class="token operator">=</SPAN> <SPAN class="token function">N Row</SPAN><SPAN class="token punctuation">(</SPAN> CofA_dt10 <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
<SPAN class="token function">For</SPAN><SPAN class="token punctuation">(</SPAN> w <SPAN class="token operator">=</SPAN> <SPAN class="token number">1</SPAN><SPAN class="token punctuation">,</SPAN> w <SPAN class="token operator"><=</SPAN> row_count <SPAN class="token operator">-</SPAN> <SPAN class="token number">1</SPAN><SPAN class="token punctuation">,</SPAN> w<SPAN class="token operator">++</SPAN><SPAN class="token punctuation">,</SPAN>
Stmt <SPAN class="token operator">=</SPAN> CofA_dt10<SPAN class="token punctuation">:</SPAN><SPAN class="token function">Parameter</SPAN><SPAN class="token punctuation">[</SPAN>w<SPAN class="token punctuation">]</SPAN><SPAN class="token punctuation">;</SPAN>
output2 <SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN> append<SPAN class="token punctuation">(</SPAN>
CofA_dt9 <SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN> Bivariate<SPAN class="token punctuation">(</SPAN>
Y<SPAN class="token punctuation">(</SPAN> <SPAN class="token punctuation">:</SPAN>test_value <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN>
X<SPAN class="token punctuation">(</SPAN> <SPAN class="token punctuation">:</SPAN>received_date <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN>
Eval(Parse(Eval Insert("\[Where<SPAN class="token punctuation">(</SPAN> <SPAN class="token punctuation">:</SPAN><SPAN class="token function">Parameter</SPAN> <SPAN class="token operator">==</SPAN> <SPAN class="token punctuation">[^</SPAN>Stmt^<SPAN class="token punctuation">]</SPAN>\"<SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">)</SPAN> <SPAN class="token punctuation">)</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN>
SendToReport<SPAN class="token punctuation">(</SPAN>
Dispatch<SPAN class="token punctuation">(</SPAN>
<SPAN class="token punctuation">{</SPAN><SPAN class="token punctuation">}</SPAN><SPAN class="token punctuation">,</SPAN>
<SPAN class="token string">"Bivariate Fit of CofA Parameter Value By received_date"</SPAN><SPAN class="token punctuation">,</SPAN>
<SPAN class="token function">OutlineBox</SPAN><SPAN class="token punctuation">,</SPAN>
<SPAN class="token punctuation">{</SPAN>Set Title<SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"CofA Material Parameter Value By received_date"</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">}</SPAN>
<SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN>
Dispatch<SPAN class="token punctuation">(</SPAN> <SPAN class="token punctuation">{</SPAN><SPAN class="token punctuation">}</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"1"</SPAN><SPAN class="token punctuation">,</SPAN> ScaleBox<SPAN class="token punctuation">,</SPAN> <SPAN class="token punctuation">{</SPAN>Label <SPAN class="token function">Row</SPAN><SPAN class="token punctuation">(</SPAN> Label Orientation<SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"Angled"</SPAN> <SPAN class="token punctuation">)</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">}</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN>
Dispatch<SPAN class="token punctuation">(</SPAN> <SPAN class="token punctuation">{</SPAN><SPAN class="token punctuation">}</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"test_value"</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token function">TextEditBox</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token punctuation">{</SPAN>Set <SPAN class="token function">Text</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"Value"</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">}</SPAN> <SPAN class="token punctuation">)</SPAN>
<SPAN class="token punctuation">)</SPAN>
<SPAN class="token punctuation">)</SPAN>
<SPAN class="token punctuation">)</SPAN>
<SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN> <SPAN class="token comment">//end row loop</SPAN>
Re: Evaluating an expression with where function and displaying outputThank 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
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 loopYou essentially want to wrap the eval with an Eval Insert and Parse