Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

gjamila_esq
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!

1 Solution

Accepted Solutions
sujeetsingh
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
sujeetsingh
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

see link

hope this helps you

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

MVP
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.

Community Browser