Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Convert Seconds into Hours

Hi Everyone,

I need some help here.

I have a field coming in from a SQL database called business_stc and this field is a time it took to close a ticket in seconds.  I have the need to convert this into hours and then somehow convert 8 hours into 1 business day.

1 Solution

Accepted Solutions
MarcoWedel

or for 8 hours per day:

=Dual(Div(business_stc,28800)&' '&Interval(fmod(business_stc,28800)/86400, 'hh:mm:ss'), business_stc)

QlikCommunity_Thread_145508_Pic1.JPG

hope this helps

regards

Marco

View solution in original post

6 Replies
avinashelite

try like this;

secondsfeild/360 this will convert hrs

Days conversion:

(secondsfeild/360)/8 as days

NickHoff
Specialist
Specialist

Why not just multiply it?  Really if you multiply Interval(Interval#(business_stc,'ss'),'d hh:mm:ss') by 3 shouldn't that give you an 8 hour day?

To convert the seconds into hours though you can use the following:

=

FLOOR((AVG(SECONDS)/3600))&'h'&ROUND(MOD(ROUND(AVG(SECONDS)),3600)/60)&'min'

MarcoWedel

Interval(business_stc/86400)

MarcoWedel

or for 8 hours per day:

=Dual(Div(business_stc,28800)&' '&Interval(fmod(business_stc,28800)/86400, 'hh:mm:ss'), business_stc)

QlikCommunity_Thread_145508_Pic1.JPG

hope this helps

regards

Marco

Not applicable
Author

Thank you.  I was able to enter the above in my script and create a new field. 

MarcoWedel

You're welcome

regards

Marco