cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
fitri
Level II

Create New Column with variables

Hi all,

I am trying to create a new column with formula, which represented by 2 variables as below:

dt << New Column("myNewColumn", Numeric, Continuous, Formula(:Ceiling( XXColumn / Size) * Size));

where:

XXColumn is one of column name in dt, selected in column dialog

Size = numeric value from column dialog

My attempt resulted a new column with formula with no value as formula create as below:

Ceiling(Column(XXColumn ) / Size) * Size

without actually assign it.

Any idea how I can accomplish this?

12 REPLIES 12
fitri
Level II

Re: Create New Column with variables

finally the magic happened !!!

here is the code i used..

col = dts << New Column("Binning", Numeric, Continuous);

Eval( Parse( Eval Insert( "col << Set Formula(:Ceiling( ^n_Bin^ / ^BinSize^) * ^BinSize^)<< eval formula" )) );

Thank You MS for the guidance; what is the diff on f_bin and n_bin i used?

ms
Super User (Alumni) ms
Super User (Alumni)

Re: Create New Column with variables

As far as I could tell from reading your code f_Bin refers to a column whereas n_Bin is a string, which is the data type that is safest to use here.

fitri
Level II

Re: Create New Column with variables

Thank you again, MS. I shall take note on this.

Recommended Articles