- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Change format to duration with script
There is an optional form of the << Data Type message that combines all three steps:
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Change format to duration with script
There is an optional form of the << Data Type message that combines all three steps:
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Change format to duration with script
Yep, that did the trick - thanks for the quick response!