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

Announcements
We are aware of an issue with the Product Downloads page and looking into it.
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Query on time function

Hi, i am trying to display a time field properly as a dimension, my data for this field is in the following format..

093025

which is the correct format but its missing the colons (09:30:25)

How do i insert the colons? i have tried but all i am getting is 00:00:00..

Thanks

Labels (1)
1 Solution

Accepted Solutions
SunilChauhan
Champion II
Champion II

left(fieldname,2)&':'&mid(fieldname,3,2)&':'&right(fieldname,2) as Newfield name in script

or you can use in expression also

Sunil Chauhan

View solution in original post

5 Replies
its_anandrjs
Champion III
Champion III

Hi,

Use time stamp function

Rgds

Anand

SunilChauhan
Champion II
Champion II

left(fieldname,2)&':'&mid(fieldname,3,2)&':'&right(fieldname,2) as Newfield name in script

or you can use in expression also

Sunil Chauhan
hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

TimeStamp function returns 00:00:00

Thanks Sunil, i have used your suggestion in an expression.

its_anandrjs
Champion III
Champion III

Hi,

See how the time stamp is used by below example

Raw:

load * inline

[

COl

093025

];

Data:

Load

left(COl,2)  as HH,

mid(COl,3,2) as MM,

Right(COl,2) as SS,

Timestamp#((left(COl,2) &':'& mid(COl,3,2) &':'& Right(COl,2) ),'HH:MM:SS') as a

Resident Raw;

See the sample file

Rgds

Anand

its_anandrjs
Champion III
Champion III

Hi,

Can you check it my way hope you got it if so mark it correct or helpful answer.

Rgds

Anand