cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

Change format to duration with script

nm1
nm1
Level I

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!