# QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Contributor

## Convert seconds in decimal hour

Hi all,

I have a field in the format seconds and I need to put it in a pivot table (I have to sum hours). Convert it to hh: mm: ss is not a problem (sum (Interval (hour_field / (3600 * 24), 'hh: mm: ss')))

but I would like to convert it to decimal hours.

For example, if I have 4 hours and 30 minutes I dont want to see 4.3 but I want to see 4.5.  Is it possible?

Thanks!

Tags (8)
1 Solution

Accepted Solutions
Honored Contributor III

## Re: Convert seconds in decimal hour

Hi,

Let the field be TimeSecond then you can easily convert it as

(TimeSecond /3600) it will give you what u want

3 Replies
Honored Contributor III

## Re: Convert seconds in decimal hour

Hi,

Let the field be TimeSecond then you can easily convert it as

(TimeSecond /3600) it will give you what u want

Not applicable

## Re: Convert seconds in decimal hour

hope this helps you

http://community.qlik.com/message/324471

MVP

## Re: Convert seconds in decimal hour

Hi,

Try like this

=(Hour('04:30:50') * 60 * 60 +  Minute('04:30:50') * 60 + Second('04:30:50')) / (60 * 60)

Use this in you expression or script like this

=(Hour(TimeFieldName) * 60 * 60 +  Minute(TimeFieldName) * 60 + Second(TimeFieldName)) / (60 * 60)

Hope this helps you.

Regards,

Jagan.