Script to assign Row states to unique Columns valuesHi JMP experts! I need your help:
I am trying to open a groups of files with variable length of data rows. I need to add a new column to each file while it is opened, with the value in the new column filled with the row numbers. For example, if I am opening a file with 10 rows, the new column added will be filled with 1,2,3,...10.
How do I achieve that with a script?
Thank you so much!
JMPstart
Re: Script to assign Row states to unique Columns valuesHi uday_guntupalli!
Thank you so much for your help. I tried your script, and it worked great!
Re: Script to assign Row states to unique Columns values@JMPstart,
You can use the row() function, independent of how many rows you have in the data table. You can implement it as shown below
Clear Log(); Clear Globals();
// Open Sample Data
dt = Open( "$SAMPLE_DATA/Cities.jmp" );
// Add a column with row number
dt << New column("RowNum",Numeric,Continuous,Formula(Row()));