Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted

word function changing a String into separate numeric values

I currently and trying to separate out numberic values that are stored in a single column as a string in this format: "9@12.5@32"

 

I am trying to use the word function to create new columns with single numeric values with this jsl:

 

dt<<New Column("New", Numeric, Continuous,
Formula(word(1,:Column,"@")));

 

but jmp will automatically change this to a categorical column. Is there a way to force it to be numeric?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Jeff_Perkinson
Community Manager Community Manager

Re: word function changing a String into separate numeric values

JMP changes the data type of the column to a character because the Word() function returns a character string.

 

You can use the Num() function to convert a character string to a numeric value.

 

dt<<New Column("New", Numeric, Continuous,
Formula(num(word(1,:Column,"@"))));
-Jeff

View solution in original post

2 REPLIES 2
Highlighted
Jeff_Perkinson
Community Manager Community Manager

Re: word function changing a String into separate numeric values

JMP changes the data type of the column to a character because the Word() function returns a character string.

 

You can use the Num() function to convert a character string to a numeric value.

 

dt<<New Column("New", Numeric, Continuous,
Formula(num(word(1,:Column,"@"))));
-Jeff

View solution in original post

Highlighted
MathStatChem
Level VI

Re: word function changing a String into separate numeric values

Try this:

 

dt<<New Column("New", Numeric, Continuous,
Formula(Num(word(1,:Column,"@"))));
Article Labels

    There are no labels assigned to this post.