cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
lukasz
Level IV

Invalid row number when accessing or evaluating of column values

Hello everybody,

after creating a new column Norm_Value I want apply formula to calculate relative values based on the position of "1" in the Base_value_norm column:

		dt << New Column( "Norm_Value",
			Numeric,
			"Continuous",
			formula(
				Eval(
					Eval Expr(
						dt:Value[(:SerialNumber << get data table) << get rows where(
							dt:Base_value_norm == 1 & dt:SerialNumber == Expr( dt:SerialNumber[Row()] )
						)] / dt:Value
					)
				)
			)
		);	

The problem is when I try to execute script I get the following error:

Invalid row number when accessing or evaluating "dt::SerialNumber[ /*###*/Row()]" , dt :: SerialNumber[/*###*/Row()].

 

But If I provide the formula manually after column is created it works as desired. What can be the reason why it is not working in script? I need to do that in script since several new columns need to be created in such a way. The data table with saved formula is attached.

Thank you and best regards

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Invalid row number when accessing or evaluating of column values

Am I missing something, or can you simplify the formula to

dt = :SerialNumber << get data table;
curSerialNumber = dt:SerialNumber;
dt:Value[dt << get rows where( dt:Base_value_norm == 1 & dt:SerialNumber == curSerialNumber )] / dt:Value;
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Invalid row number when accessing or evaluating of column values

Am I missing something, or can you simplify the formula to

dt = :SerialNumber << get data table;
curSerialNumber = dt:SerialNumber;
dt:Value[dt << get rows where( dt:Base_value_norm == 1 & dt:SerialNumber == curSerialNumber )] / dt:Value;
Jim
lukasz
Level IV

Re: Invalid row number when accessing or evaluating of column values

Hi Jim,

thank you for suggestion, works as desired.

Best regards.