Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
mr_novice
Creator II
Creator II

Hours to decimal hours

Hi all,

Sorry for my bad choice of subject. I have a time "stamp" on this format "343:36:12" - This is the result between two timestamps using "interval" function. I would like to have this in decimal form like this - 343,6. Is there an easy way to convert this?

Br

Cris

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

SubField(Time_Fld,':',1) & ',' & (Replace((SubField(Time_Fld,':',2)/60),'.','')+0)

View solution in original post

2 Replies
anbu1984
Master III
Master III

SubField(Time_Fld,':',1) & ',' & (Replace((SubField(Time_Fld,':',2)/60),'.','')+0)

mr_novice
Creator II
Creator II
Author

Thank you Anbu. I did this because I may have negative numbers. I thought there might be a function for or a time-option for converting this...

=if(subfield(vInterval,':',1)<0,

  (subfield(vInterval,':',1)*-1+(SubField(vInterval,':',2)/60))*-1,

  subfield(vInterval,':',1)+ (SubField(vInterval,':',2)/60)

)