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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
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)

)