Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Convert Numbers of seconds in Hours

Hi,

I have a problem with the time in Qlikview. I Have a field which is the numbers of seconds.

In the dashboard I want see the average of this number for each dimension. But this average must be in Hours (19h27 min for example)

Have you an idea for the expression which I must used please?[:)]

Thanks for your help

1 Solution

Accepted Solutions
ManuelRühl
Partner - Specialist
Partner - Specialist

The Average-Funktion returns decimals !

The modulo-function only works without.

So do:

=

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





Manuel Rühl

View solution in original post

10 Replies
Not applicable
Author

Hi,

You can convert the second to hours/minutes using time function.

Eg Time(a,'hh:mm:ss')

regards

Regards

ManuelRühl
Partner - Specialist
Partner - Specialist

TRY THIS:

=

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



Manuel Rühl
Not applicable
Author

Thanks for your help,

Time don't succeed because I have a number of Seconds.

For the second answer, I have the good result for Hour, but not for the minutes I don't know why, I don't have any minutes

ManuelRühl
Partner - Specialist
Partner - Specialist

i checked it and it worked for me .....

maybe copy & paste mistake ?

Manuel Rühl
Not applicable
Author

There is my line:

FLOOR((avg([CRM_STATS.response time])/3600))&' h '& ROUND((MOD(avg([CRM_STATS.response time]),3600)/60))&' min '


I try other copy past but He doesn't work

ManuelRühl
Partner - Specialist
Partner - Specialist

The Average-Funktion returns decimals !

The modulo-function only works without.

So do:

=

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





Manuel Rühl
Not applicable
Author

Thank you it's work perfectly Big Smile

Not applicable
Author

Hi

Please can you place a set analysis example in this formula as I'm struggling pull these together.

Thanks

fred_randon
Contributor III
Contributor III

Hello,

I need your help cause I have the same problem, but with a sum and it does not work

FLOOR((AVG(sum({<disposition= {'ANSWERED'}> } duration))/3600))&'h'&ROUND(MOD(ROUND(AVG(sum({<disposition= {'ANSWERED'}> } duration))),3600)/60)&'min'

the set "count({<disposition= {'ANSWERED'}> } duration)" is ok,

Could you help me please?