convert h:mn in mnhi,
I would like to convert time in mn.
ex.: "01:30" in 90 mn; the new column must be in numeric+continuous to make graphs.
best regards
Re: convert h:mn in mnhi,
I use the formula of Mark in a jsl like this:
dt << New Column( "Tps BaF (mn)", formula( { hr, min } = Words( :Tps BaF, ":" );
60 * Num( hr ) + Num( min ) ) );
It's OK.
thank you all for your answers !
best regards
Re: convert h:mn in mnA better form might be:
{ hr, min } = Words( :Tps BaF, ":" );
60 * Num( hr ) + Num( min );Re: convert h:mn in mnFor diagnosis, try this formula in a new column. The result should always be 2.
N Items( Words( :Tps BaF, ":" ) )
Re: convert h:mn in mnplease attach your data table with the new formula column included, and I will take a look at it.....
If in your formula, you are not specifying a ":" in front of the reference to "Tps BaF" that can also be an issue. Because JMP will not think it is column in the data table
Re: convert h:mn in mnA better form might be:
{ hr, min } = Words( :Source, ":" );
60 * Num( hr ) + Num( min );Re: convert h:mn in mnhi,
I don't see where there are missing values:

Re: convert h:mn in mnIt appears that one of the entries for Tps Baf does not have a second values, so that when hr and min is created, there is only 1 subscript value.
Re: convert h:mn in mnHi,
I use the formula to use it with a script but I have this error message. I don't know what this error message means.
best regards

Re: convert h:mn in mnRe: convert h:mn in mnhi,
I've written this in my sql post request:
column(dt,"Tps BaF")<<DATA type=""></DATA>
then I can use nduration.
Thanks for all.
best regards
Re: convert h:mn in mnYou can convert the character column directly into a numeric. I will use a slightly modified version of @gzmorgan0 data table for illustration. So given that table, with a new column added that is a character column with time values

Go to the Column Info for that column

The first thing is to change it to Data Type Numeric

Then you change the Modeling Type to Continuous

Change the format to a Duration format of hr:m

Then click on Apply to apply the changes


So now the column is a numeric column, with a duration format. And the format was used to read the original character strings which were in an hr:m format. But what you really want is to have the data displayed in minutes. So now that is a very simple change since the data are in numeric form. Just change the format to min:s

So now click on OK, and you data table is changed to the format you want

Re: convert h:mn in mnHere is a formula that works.

Here is the corresponding code that youi can copy and then paste into your Formula Editor.
hr and min = Words( :Source, ":" );
60 * Num( hr and min[1] ) + Num( hr and min[2] );
Re: convert h:mn in mnhi,
thanks.
but my duration is in a caracter form....
Re: convert h:mn in mnSee the attached table. Here is the formula. Note In Minutes() converts to seconds, so divide by 60*60
In Minutes( :Duration ) / (60 * 60)