cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
maswan
Level I

Column name as expression inside loop doesn't work

Hello Community,

 

I am trying to automatize the generation of some graphs making a loop over some columns of my graph.

 

For example, my Column's names are: H_1 , H_2 ... H_12

I tried

x1_ = Expr( Y( Expr( ":H_" || Char( iAus ) ) ) );

 

I also tried

x1_ = Expr( Y( Column( Expr( "H_" || Char( iAus ) ) ) );

 

and also:

x1_ = Expr( Y( As Column( Expr( "H_" || Char( iAus ) ) ) );

 

and inside the iAus loop

 

Variables( X( :Tag ), Eval( Eval Expr( x1_ ) ), Group X( :NAT ) ),

 

didn't work out. --> Error = Specified Column not found in data table. in access or evaluation of 'Eval' , Eval/*###*/(Eval Expr( x1_ ))

 

I needed to use the column number rather than using an expression, like this:

Variables( X( :Tag ), Y( As Column( 26 + iAus ) ), Group X( :NAT ) ),

 

In another part of my script I got it right:

x1 = Expr( "H_" || Char( iAus ) );

and inside the iAus loop:

Dispatch(
{},
Eval( Eval Expr( x1 ) ),
ScaleBox,
{Format( "Fixed Dec", 15, 1 ), Min( 0 ), Max( 1.4 ), Inc( 0.2 ), Minor Ticks( 1 ), Label Row( Set Font Size( 11 ) )}
),

 

Can someone help me and point out what I'm doing wrong?

 

Thank you in advance

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
pauldeen
Level VI

Re: Column name as expression inside loop doesn't work

You cannot concatenate a string to an expression. Try the substitute or eval insert method.

Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute 

View solution in original post

1 REPLY 1
pauldeen
Level VI

Re: Column name as expression inside loop doesn't work

You cannot concatenate a string to an expression. Try the substitute or eval insert method.

Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute