cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Jaz
Jaz
Level IV

RE: Invalid Row Number Error

Hi, 

 

I was just wondering about this error I got when I ran my script:

Invalid Row Number{92} in access or evaluation of 'Subscript' , colInstructions[q]

The value of q never reaches 92 so I'm not sure where that number came from, or is 92 in relation to something else? Just for some background information I created a new column to which I'm assigning the value of a cell from another data table (colInstructions[q]). 

 

Any help would be appreciated. 

 

5 REPLIES 5
pmroz
Super User

RE: Invalid Row Number Error

Make sure the cell is fully qualified with the table name and column name.  If both tables have the same column name you might get this error, i.e. one table doesn't have 92 rows.

dt1 = data table("Table 1");
dt2 = data table("Table 2");

column(dt2, "Instructions")[92] = column(dt1, "Instructions")[14];
Jaz
Jaz
Level IV

RE: Invalid Row Number Error

Ok thanks, 

 

Both tables don't have the same columns but I have another question related to creating new columns: do you have to specify how many rows the column has when you create a new column and how would you do this? 

 

Thanks again. 

 

txnelson
Super User

RE: Invalid Row Number Error

If you add a new column to an existing data table, the column will have the same number of rows as the data table the new column is being added to.   JMP data tables do not have different number of rows for different columns.  They may have missing values or blank values for character columns, but all columns will have the same number of rows.  If you need to add additional rows, you can use "Add Rows()" function.  See:

     Help==>Scripting Index==>Data Table==>Add Rows

Jim
ENTHU
Level IV

RE: Invalid Row Number Error

I am stuck with a similar problem.

I have a string in the list and trying to assign it to the row of a data table. I get an erroe saying - "Cannot set value for column beacuse row number is invalid".

Param = {};
Param = Concat items({A, B, C,D}, " ");

dt = New Table( "RAWDATA" );

	dt<< New Column( "Line", Character);
Column(dt,"Line")[1] = Param;

	
MichelleG
Level III

RE: Invalid Row Number Error

When you create the new table, it has 0 rows. You need to add some rows to it before you can write data to the first row.