Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert alphanumeric uration into HH:MM:SS

Hi ,

I have a excel having the time duration in alphanumeric (e.g. 1h30m , 2h) . I want to convert duration into HH:MM format .

Please help me on the same .


Thanks,

Vals

1 Solution

Accepted Solutions
adamdavi3s
Master
Master

Hi Vals,

Not that easy to do, can you provide a sample dataset?

I am sure it can be done though

View solution in original post

11 Replies
adamdavi3s
Master
Master

Hi Vals,

Not that easy to do, can you provide a sample dataset?

I am sure it can be done though

adamdavi3s
Master
Master

Tell a lie, I found an example of where I have done this before:

Please remember to mark this as helpful or the correct answer if I have helped you or answered your question.

This will help users identify the answers should they come across this thread in the future.

sdmech81
Specialist
Specialist

PLss send sample data..Hope we need to use string functions to arrive at that

Sachin

Anonymous
Not applicable
Author

Capture.PNG

Anonymous
Not applicable
Author

This is the format of the xlsx  and in qlikview workbook i want it in HH:MM format . I tried to use SUBFIELD and TRIM function to make it happen but unfortunately no result .

Thanks

adamdavi3s
Master
Master

Hi Vals,


Not a problem I can write this for you.

What happens when the time is < 1hour?

Anonymous
Not applicable
Author

Hi Adam,

Actually its the master file given by user . So manually inserted data and time is not less than 1 hr  each and every events are having duration more than 1 hr .

adamdavi3s
Master
Master

Here is my sample script which loads:

Capture.PNG

LOAD rowno() as id,*,

subfield(time,'h',1)&':'&if(len(subfield(time,'h',2))<1,00,subfield(time,'h',2)) as timestamp

;

LOAD * INLINE [

time

1h

2h30

1h

1h30

1h

1h

3h30

1h

1h

1h

];

MarcoWedel

Hi,

maybe helpful:

Convert string to the timestamp

regards

Marco