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: 
gauravgg
Partner - Creator
Partner - Creator

convert to time ?

Hi , i have the following field in to HH:MM:SS

example:---0 days 0Hr 0Min 14Sec into 00:00:14

0 days 0Hr 0Min 0Sec ->00:00:00
0 days 0Hr 0Min 36Sec->00:00:36
0 days 0Hr 0Min 0Sec
0 days 0Hr 0Min 19Sec
0 days 0Hr 1Min 42Sec
0 days 0Hr 2Min 14Sec
0 days 0Hr 0Min 29Sec
0 days 0Hr 1Min 45Sec
0 days 0Hr 0Min 0Sec

Thanks in Advance

11 Replies
Vegar
MVP
MVP

If you could assume that all numbers are negative if you are able to find at least one minus sign in your string then you could try something like this.

If(FindOneOf(yourField,'-'),-1,1)*

Interval(Interval#(Keepchar(yourField, '0123456789 '), 'D  h m s'), 'hh:mm:ss')

Cheers,

Vegar Lie Arntsen 

--

Sent from my Oneplus using K-9 Mail. Please excuse my brevity.

Anonymous
Not applicable

Hi Gaurav,

PFA. hope this helps you.

Table:

LOAD *,

     Time(TextBetween(Hour,'days ','Hr') & ':' & TextBetween(Hour,'Hr ','Min') & ':' & TextBetween(Hour,'Min ', 'Sec')) as Time;

LOAD * INLINE [

    Hour

    0 days 0Hr 0Min 0Sec

    0 days 0Hr 0Min 19Sec

    0 days 0Hr 1Min 42Sec

    0 days 0Hr 2Min 14Sec

    0 days 0Hr 0Min 29Sec

    0 days 0Hr 1Min 45Sec

    0 days 0Hr 0Min 0Sec

];