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 time format

Hello

in my excel file, I have data in the format hh: mm: ss that I want to transform in the format hh, m in the script when loading data.

today I can not transform my data into the desired format.

Thanks for your help

13 Replies
dwforest
Specialist II
Specialist II

Typo should be 4,2 for mid, not 3,3. This also "assumes" the hour part of your string is always 2 digits.

Time(MakeTime(num(left(FieldName,2)), num(mid(FieldName,4,2))),'hh, m')


Rob's answer of interval does not have this restriction so I would go with that.

sunny_talwar

Or may be this

Table:

LOAD RowNo() as RowNum,

Time,

Num(Interval#(Time, 'h:mm:ss'))*24 as [Time in hour];

LOAD * INLINE [

    Time

    0:02:53

    0:16:48

    0:10:00

    0:14:51

    0:10:00

    0:10:00

    1:19:17

    0:00:00

    0:00:00

    239:00:00

];

Capture.PNG

Anonymous
Not applicable
Author

Thank you it works perfectly!

It was easy in fact..

Anonymous
Not applicable
Author

Thank you it works perfectly!

It was easy in fact..