Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a fiel named "HMHEURCR" that I want to convert as a time.
For example value 143953 must converted to HH:MM:SS
I try an expression something like that but is not works
if(Right([HMHEURCR],2) <> 00, Time(time#([HMHEURCR],'HHMMSS'),'HH:MM:SS')) as HEURE,
Someone have an idea?
Why are you using the IF() statement first? What difference does it make if SS = 00?
Time(time#([HMHEURCR],'HHMMSS'),'HH:MM:SS') as HEURE
looks like it should work. Or the hhmmss may be case-sensitive:
Time(time#([HMHEURCR],'hhmmss'),'hh:mm:ss') as HEURE
Hope this helps,
Jason
Why are you using the IF() statement first? What difference does it make if SS = 00?
Time(time#([HMHEURCR],'HHMMSS'),'HH:MM:SS') as HEURE
looks like it should work. Or the hhmmss may be case-sensitive:
Time(time#([HMHEURCR],'hhmmss'),'hh:mm:ss') as HEURE
Hope this helps,
Jason
Hi,
Check out the link below,
http://community.qlik.com/message/366746#366746
Hope it Helps You...
Regards,
Ravikant
hi
try this
date(date#('143953','HHMMSS'),'HH:MM:SS')
OR THIS ONE
Time(Time#('143953','HHMMSS'),'HH:MM:SS')
***************************************************
similarly for field
date(date#(fieldname,'HHMMSS'),'HH:MM:SS')
OR THIS ONE
Time(Time#(fieldname,'HHMMSS'),'HH:MM:SS')
If you just want to convert it into time then there is no need to use if condition, you can directly use:
=Time(time#(HMHEURCR,'hhmmss'),'hh:mm:ss') as HEURE
in your expression.
Otherwise, if you really want to compare then use this:
=if(Right([Date_Num],2) <> 00, Time(time#(Date_Num,'hhmmss'),'hh:mm:ss')) as HEURE
Hope this helps!
hi ,
use
Time(time#([HMHEURCR],'HHMMSS'),'HH:MM:SS')) as HEURE
it will read current format and covert in traget format.