cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
JanneI
Level III

Time durations with milliseconds - custom Format pattern

Hello,

 

Any suggestion how to use custom Format pattern for time or duration format in the following scenario? As example, I have following data imported (as character):

 

42.336
51.858
01:17.9

 

This data should be understood as time durations in format mm:ss.000. I would like to have advices how to get data above to be shown as in (numeric) format ss.000 like below

 

42.336
51.858
77.900

 

or alternatevily in numeric time format

 

0:42.336
0:51.858
1:17.900

 

I hope that this can be done without any scripting. Any advices are highly appreciated! I am running JMP 16.2

2 REPLIES 2
txnelson
Super User

Re: Time durations with milliseconds - custom Format pattern

I was not able to come up with a Format Pattern that worked, however, the following simple script works

For Each Row(
	If( Contains( :column 1, ":" ),
		:column 1 = Char(
			Num( Word( 1, :column 1, ":" ) ) * 60 + Num( Word( 2, :column 1, ":" ) )
		)
	)
);
:column 1 << data type( numeric ) << modeling type( continuous );

txnelson_0-1697892266545.png

 

Jim
jthi
Super User

Re: Time durations with milliseconds - custom Format pattern

If you had "properly" formatted data JMP could handle this (those rows which have no minutes should have 0: at the start). Column 3 is a copy of Column 2 with format pattern applied with three decimals

jthi_0-1697895480520.png

I think you have to create formula to convert your strings to either directly to seconds or to some format which JMP could understand

-Jarmo