cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
nm1
nm1
Level I

Change format to duration with script

I am importing data from an excel spreadsheet. I have one column that exists in this excel as a duration (format=min:s). This is imported automatically as character. I would like to change it to a duration within a script. As suggested in lots of posts (eg here:  

 

I tried the following:

column(dt,"Cycle Time")<<data type(Numeric)<<Modeling Type(Continuous)<<Format( "min:s",12,0);

but this gives me a column of only missing values. (dt is my imported data table, "Cycle Time" is the name of the column). The conversion works when I do it manually, using the Column Info dialog.

I am using Jmp15.1.0 on Windows. Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Change format to duration with script

There is an optional form of the << Data Type message that combines all three steps:

 

Capture.JPG

 

So your code might change to:

 

Column( dt, "Cycle Time" ) << Data Type( "Numeric", Format( "min:s" ) ) << Modeling Type( "Continuous" );

See if that form works better.

View solution in original post

2 REPLIES 2

Re: Change format to duration with script

There is an optional form of the << Data Type message that combines all three steps:

 

Capture.JPG

 

So your code might change to:

 

Column( dt, "Cycle Time" ) << Data Type( "Numeric", Format( "min:s" ) ) << Modeling Type( "Continuous" );

See if that form works better.

nm1
nm1
Level I

Re: Change format to duration with script

Yep, that did the trick - thanks for the quick response!