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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
gauravgg
Partner - Creator
Partner - Creator

Convert Time into minute

Hi

i have field as follows

Time

1Day20Hrs30Min25Sec

2Day20Hrs45Min25Sec

1Day24Hrs30Min25Sec

1Day16Hrs30Min25Sec

3Day14Hrs30Min25Sec


I want to convert the above field into HH:MM:SS




Can anyone help me?



Thanks in advance






7 Replies
Anonymous
Not applicable

Hi,

What do you want to see ?  Something like this :

1Day20Hrs30Min25Sec = 44:30:25

2Day20Hrs45Min25Sec = 68:45:25



antoniotiman
Master III
Master III

Hi Gourav

=SubField('1Day20Hrs30Min25Sec','Day',1)*24+TextBetween('1Day20Hrs30Min25Sec','Day','Hrs')&':'
&TextBetween('1Day20Hrs30Min25Sec','Hrs','Min')&':'&TextBetween('1Day20Hrs30Min25Sec','Min','Sec')  -> 44:30:25

Regards,

Antonio

sunny_talwar

I would also add the interval#() function to assign the timestamp a dual representation

Interval#(SubField('1Day20Hrs30Min25Sec','Day',1)*24+TextBetween('1Day20Hrs30Min25Sec','Day','Hrs')&':'

&TextBetween('1Day20Hrs30Min25Sec','Hrs','Min')&':'&TextBetween('1Day20Hrs30Min25Sec','Min','Sec'), 'hh:mm:ss')

migueldelval
Specialist
Specialist

Hi Gaurav,

Try this example

Regards

Miguel del Valle

gauravgg
Partner - Creator
Partner - Creator
Author

yes

gauravgg
Partner - Creator
Partner - Creator
Author

Hi sunny

this code is hard code ,

their are multipal rows in the table , How we can apply for all rows in that field

sunny_talwar

I guess Antonio‌ and I meant for you to replace the hard-coded values with the field name:

Interval#(SubField(FieldName,'Day',1)*24+TextBetween(FieldName,'Day','Hrs')&':'

&TextBetween(FieldName,'Hrs','Min')&':'&TextBetween(FieldName,'Min','Sec'), 'hh:mm:ss')