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

Referencing a Column by Column Number in Formula

I am creating a new column in my script and would like to populate the column by a simple formula.  Instead of referencing by name, I would like to reference by column number in the formula because the column name will change depending on the work week, but it will always be the same column number.

 

dt<<New Column("New", formula(:Goal - :Column Name(36)));

The above expression does not work, but should give the gist of what I am trying to do.

Could not find any info on how to reference a column by number in the formula.

1 ACCEPTED SOLUTION

Accepted Solutions
uday_guntupalli
Level VIII

Re: Referencing a Column by Column Number in Formula

@pacificdune , 

I believe you should be expressing it as : 
 As Column(Column Number) i.e. As Column(36) in your case for what you are trying to acheive 

 

 

dt<<New Column("New", formula(:Goal - As Column(36)));
Best
Uday

View solution in original post

2 REPLIES 2
uday_guntupalli
Level VIII

Re: Referencing a Column by Column Number in Formula

@pacificdune , 

I believe you should be expressing it as : 
 As Column(Column Number) i.e. As Column(36) in your case for what you are trying to acheive 

 

 

dt<<New Column("New", formula(:Goal - As Column(36)));
Best
Uday
pacificdune
Level I

Re: Referencing a Column by Column Number in Formula

Tried it both with and without the colon, but unfortunaltely does not work either way.

dt<<New Column("New", formula(:Goal - :Column(36)));