Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Time

Hi

I have a variable T representing a time. This variable is store in the original data as numeric like this :

829, 1200, 1659, 2355

829 means 8H 29 minutes

1200 means noon

I'd like to transform my variable in a new one which I could use as really time variable (hh:mm) to do some laps calculation.

Thanks in advance for any help

JJ

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

This will work:

=

time(time#(num(YourTimeField, '0000'), 'hhmm'))

The part num(YourTimeField, '0000') make all values 4-digits long. The time#() "explains" the format. Function time() converts to "noraml" format.





View solution in original post

4 Replies
Anonymous
Not applicable
Author

This will work:

=

time(time#(num(YourTimeField, '0000'), 'hhmm'))

The part num(YourTimeField, '0000') make all values 4-digits long. The time#() "explains" the format. Function time() converts to "noraml" format.





Not applicable
Author

You could divide your time in seconds by 86400 (total number of seconds in one day) then display as time/timestamp format in the "number" tab

hopkinsc
Partner - Specialist III
Partner - Specialist III

Hi Michael,

I have the same issue, My times are displayed as numbers, but mine include seconds, so they are a maximum of 6 numbers long. I assume i just add two extro zeros in the example you gave.

i.e.

=



time(time#(num(TransStartTime, '000000'), 'hhmmss')) ,

But how would i write this into my script?

Chris

Anonymous
Not applicable
Author

Chris,
This looks correct to me. If it is in the load script, it would be
LOAD
...
time(time#(num(TransStartTime, '000000'), 'hhmmss')) as Time,
...
RESIDENT ...

(Dont'd try it in SQL SELECT)