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
Boaz
Level I

calculation using data from 2 tables

Hi all,

wandering if you can help...

I'm trying to create new columns in a table from a calculation of a transposed summary but I keep getting errors

with defining some constants from the table.

any idea what I'm doing wrong?

 

 

src_tran = src_sum << Transpose(
		Label( :Label )
	);
Current Data Table( src_tran );	

src_tran << new column("N", Formula(If( Substr( :Label, 0, 1 ) == "M",
	Substr( Substr( :Label, 6 ), 0, Length( :Label ) - 6 ),
	Substr( Substr( :Label, 9 ), 0, Length( :Label ) - 9 )
)));

g = (Col Number( :Label) -2 );	
for( i = 3, i = g, i++,

a = Char(N[i]) || "_Cv";
d =  Char(N[i]);
b = as column(Row 1)[i];
c = as column(Row 1)[i+1969];


Current Data Table( src );	
src << new column( a, Numeric, continuous, 
Formula( (b - :d) / (nsigma*c))); );

Log shows:

 

Column SEBV-D_CLK_A Cluster Size RsltF32_Pln00 (365) -1::21205_Cv Formula Interrupted Name Unresolved: d at row 1 in access or evaluation of 'd' , :d/*###*/ Formula evaluation errors have been ignored Name Unresolved: N in access or evaluation of 'N' , :N/*###*/

 

2 REPLIES 2
txnelson
Super User

Re: calculation using data from 2 tables

It appears that you have several scoping and syntax issues, however, it is difficult to precisely guide you without seeing what the data table you are transforming contains.  Could you please attach a sample of what that table looks like?

Jim
ac7872
Level II

Re: calculation using data from 2 tables

It seems you don't have a column name "d" for the Formula to work.

Try

src << new column( a, Numeric, continuous, Formula( (b - :Name( d ) ) / (nsigma*c)));

If that does not work you can try to create the line of code as text and parse it for each loop interaction.