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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

TIME#

Hi All

our DB stores the EDIT_TIME as a string like this 74533 for 07:45:33

How do I convert this to hh:mm

I have tried; Time(Time#(YN_EDIT_TIME, 'hhmmss'),'hh:mm') but its does not seem to work.

10 Replies
MayilVahanan

Hi

Try like this

Time(Time#(YN_EDIT_TIME, 'hmmss'),'hh:mm:ss')

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

it seems to work to me

dvasseur
Partner - Creator III
Partner - Creator III

Hi, Try this:

Time(Time#(If(Len(YN_EDIT_TIME)=5, '0' & YN_EDIT_TIME, YN_EDIT_TIME), 'hhmmss')) AS YN_EDIT_TIME

But it won't work if 11435 is for 11:04:35

rustyfishbones
Master II
Master II

Like Mayil said

2013-10-14_1324.png

Not applicable
Author

Thanks

Yeah, 11435 = 01:45:35 and 111435 = 11:14:35

Not applicable
Author

hi

try this

time(time#(fieldname,'hmmss'),'hh:mm')

or this

Date(Date#(fieldname,'hmmss'),'hh:mm')

ThornOfCrowns
Specialist II
Specialist II

OP requires hh:mm:ss to hh:mm, I think.

CELAMBARASAN
Partner - Champion
Partner - Champion

You should  use

Time(Time#(YN_EDIT_TIME, 'hmmss'),'hh:mm:ss') //based on 74533

if your DB  stores 07:04:05 as 745 then You should use hms instead of hmmss(its fine only if it stores it as 70405)

dvasseur
Partner - Creator III
Partner - Creator III

If minutes and seconds always have 2 digits, it will be fine !