Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
gauravgg
Not applicable

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:MMSmiley FrustratedS




Can anyone help me?



Thanks in advance






Tags (1)
7 Replies
filip_duchateau
Not applicable

Re: Convert Time into minute

Hi,

What do you want to see ?  Something like this :

1Day20Hrs30Min25Sec = 44:30:25

2Day20Hrs45Min25Sec = 68:45:25



antoniotiman
Not applicable

Re: Convert Time into minute

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
Not applicable

Re: Convert Time into minute

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
Not applicable

Re: Convert Time into minute

Hi Gaurav,

Try this example

Regards

Miguel del Valle

gauravgg
Not applicable

Re: Convert Time into minute

yes

gauravgg
Not applicable

Re: Convert Time into minute

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
Not applicable

Re: Convert Time into minute

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')