cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
ariel
Level I

How to change column data type from Numeric to Character?

Hi everyone,

I have a small problem but it seems that no one in the web have a solution for it, not specifically anyway.

I'm trying to change column Data Type from Numeric to Character during JSL run,

Just to be clear - I'm not trying to change Modeling Type - there are a lot of good examples for that in the web.

I'm trying to change the Data Type - (it seems no one manage to do yet).

thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
pmroz
Super User

Re: How to change column data type from Numeric to Character?

Go the Scripting Index, select Objects, and then scroll down to Data Table > Column Scripting.  You'll find the method "Data Type" with the following example:

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Wait( 2 );
dt:Age << Data Type( Character );
dt:Height << Data Type( Numeric, 2 );

 

View solution in original post

Jeff_Perkinson
Community Manager Community Manager

Re: How to change column data type from Numeric to Character?

This OP asked about changing data type using JSL. In case you're looking to do this interactively you can select the column and then choose Cols -> Column Info...

 

JMPScreenSnapz067.png

Then in the Column Info dialog box change the Data Type.

 

JMPScreenSnapz068.png

 

-Jeff

View solution in original post

5 REPLIES 5
pmroz
Super User

Re: How to change column data type from Numeric to Character?

Go the Scripting Index, select Objects, and then scroll down to Data Table > Column Scripting.  You'll find the method "Data Type" with the following example:

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Wait( 2 );
dt:Age << Data Type( Character );
dt:Height << Data Type( Numeric, 2 );

 

ariel
Level I

Re: How to change column data type from Numeric to Character?

Hi, thanks but its not working,

I want to change an exiting column -

according to few guide the commend suppose to look like this:

 

column("VALUE") << Data type( Numeric ) << Set Data Type ( Character)

but still, non is working....

 

pmroz
Super User

Re: How to change column data type from Numeric to Character?

Remove "Data type ( Numeric)", and remove the word SET.  I would also include a variable that points to your dataset.

 

column("VALUE") << Data Type ( Character); 

or better yet:

column(dt, "VALUE") << Data Type ( Character);

where dt points to your data table. 

My original example shortened a bit:

 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
column(dt, "Height") << Data Type( Character );

 

ariel
Level I

Re: How to change column data type from Numeric to Character?

Thanks!, It's working!!

Jeff_Perkinson
Community Manager Community Manager

Re: How to change column data type from Numeric to Character?

This OP asked about changing data type using JSL. In case you're looking to do this interactively you can select the column and then choose Cols -> Column Info...

 

JMPScreenSnapz067.png

Then in the Column Info dialog box change the Data Type.

 

JMPScreenSnapz068.png

 

-Jeff