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

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
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

Labels (1)
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
MVP
MVP

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..