Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

converting decimals to seconds

I have an Excel spreadsheet with a column that says 2:49, 2 minutes and 49 seconds. When I try

to pick the minutes and seconds I get a strange result. When formatting the cell in Excel I can see

0,00833333333333333. How do I get this to minutes and seconds in my script? Is there any formula

to convert?

kindly

Håkan

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

A time value is a decimal number of days where the fractional part represent the time of day (1 = 24h or 1440 minutes). As Manish said, Time() will display the value in hh:mm:ss format.

If you need the minutes value for a calculation, then use something like:

     ...

     YourFIeldName * 1440 As Minutes,

     ...

will give you a decimal minute value.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

2 Replies
MK_QSL
MVP
MVP

UI SIDE

TIME(YourFIeldName,'hh:mm:ss') or

TIME(YourFIeldName,'mm:ss')

SCRIPT SIDE

TIME(YourFIeldName,'hh:mm:ss') as YourFIeldName or

TIME(YourFIeldName,'mm:ss') as YourFIeldName

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

A time value is a decimal number of days where the fractional part represent the time of day (1 = 24h or 1440 minutes). As Manish said, Time() will display the value in hh:mm:ss format.

If you need the minutes value for a calculation, then use something like:

     ...

     YourFIeldName * 1440 As Minutes,

     ...

will give you a decimal minute value.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein