Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
apthansh
Creator
Creator

Convert Minutes/Hours to number

Hi - I have hours in the below format.When I do sum of hours I get zero.Do I have to convert this format ??

Hours.JPG

Thanks much.

1 Solution

Accepted Solutions
sunny_talwar

With slight modifications in the script... I am seeing the same result

Capture.PNG

View solution in original post

10 Replies
Anil_Babu_Samineni

Simply Num(FieldName) not working for you?

I mean Sum(Num(FieldName)) is not working for you?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Yes, it would be better if you use Interval() on top of Sum()

Interval(Sum(...), 'D hh:mm:ss')

sasiparupudi1
Master III
Master III

Sum(Time(Time#(YourField,'hh:mm'),'hh'))

apthansh
Creator
Creator
Author

Thank you all but all these expressions are giving me 3 in Qliksense where as 13 in Qlikview with the same expression.

Should be same in both correct ?

stalwar1sasiparupudi1anilbabu

sunny_talwar

Without seeing qvw and qvf... it would be difficult to say... but the difference could be because of many different things. Just to list few

1) Different field formats

2) Different soruces

3) Different data

4) Different expressions

5) Different environmental variables

etc etc....

jmvilaplanap
Specialist
Specialist

Hi,

Probably you must to convert the time to number with "time#(field, 'hh:mm')", try this.

apthansh
Creator
Creator
Author

stalwar1‌ - I have attached the source file ,QVW & QVF ....

sunny_talwar

With slight modifications in the script... I am seeing the same result

Capture.PNG

apthansh
Creator
Creator
Author

As always you are awesome