Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
stabben23
Partner - Master
Partner - Master

Num to time

Hi,

I have a num value =2 this is really 00:00:02 on the clock. I also have 92433 which is 09:24:33

I want the field to be formated as a time value like hh:mm:ss. SQL code or in qlikview is OK.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

So you mean to say the formula i have given is not working?

Load

  TimeField,

  Time#(Left(Repeat('0',6-Len(TimeField))&TimeField,2) & ':' & Mid(Repeat('0',6-Len(TimeField))&TimeField,3,2)& ':' &Right(Repeat('0',6-Len(TimeField))&TimeField,2),'hh:mm:ss') as NewTimeField

Inline

[

  TimeField

  113

  1256

  211318

  144036

  2

  92433

];

Create a table box with TimeField and TimeFieldNew as your two field.... and let me know if you are still not getting the result..

View solution in original post

11 Replies
tresesco
MVP
MVP

Try like:

Time(Time#(092433, 'hhmmss')) as Time , and you can then replace this number by a field that holds the similar values.

MK_QSL
MVP
MVP

Load

  TimeField,

  Time#(Left(Repeat('0',6-Len(TimeField))&TimeField,2) & ':' & Mid(Repeat('0',6-Len(TimeField))&TimeField,3,2)& ':' &Right(Repeat('0',6-Len(TimeField))&TimeField,2),'hh:mm:ss') as NewTimeField

Inline

[

  TimeField

  2

  10

  12

  434

  1123

  92433

];

ashfaq_haseeb
Champion III
Champion III

Hi try below

=Time(Time#(092433, 'hhmmss'),'hh:mm:ss')

Regards

ASHFAQ

stabben23
Partner - Master
Partner - Master
Author

Hi,

sorry but non of these works, I can tell that my TimeFormat is 'h:mm:ss TT'

ashfaq_haseeb
Champion III
Champion III

Hi,

Try below

=Time(Time#(Field, 'h:mm:ss TT'),'hh:mm:ss')

Can you attach sample data here.

Regards

ASHFAQ

MK_QSL
MVP
MVP

Provide few lines for that Field along with expected result..

stabben23
Partner - Master
Partner - Master
Author

Hi, Like this

113, 1256, 211318, 144036, 2

expected 00:01:13, 00:12:56, 21:13:18, 14:40:36, 00:00:02

MK_QSL
MVP
MVP

So you mean to say the formula i have given is not working?

Load

  TimeField,

  Time#(Left(Repeat('0',6-Len(TimeField))&TimeField,2) & ':' & Mid(Repeat('0',6-Len(TimeField))&TimeField,3,2)& ':' &Right(Repeat('0',6-Len(TimeField))&TimeField,2),'hh:mm:ss') as NewTimeField

Inline

[

  TimeField

  113

  1256

  211318

  144036

  2

  92433

];

Create a table box with TimeField and TimeFieldNew as your two field.... and let me know if you are still not getting the result..

stabben23
Partner - Master
Partner - Master
Author

Hi,

I'v must have forgott to changed all TimeField to my time field because it really work.

Thanks