Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Ishaan_Kumar
Contributor III
Contributor III

Inputting Time Based Field

t1:
Load * Inline [
App_ID , time_
1,01:20:25
1,01:20:30
1,01:22:30
2,01:23:30
2,01:29:30
2,01:26:30
2,01:35:30
2,02:36:30
];


I am unable to convert time field into time stamp. 

I tried doing it by taking resident , it is showing null

Labels (4)
2 Replies
hic
Former Employee
Former Employee

This should work, provided that you have the following in the script:

SET TimeFormat='hh:mm:ss';

So, you need to give us more information in order to to find the problem.

marksouzacosta

Hi @Ishaan_Kumar,

We need more information. Your time_ field is properly formatted as Time. What are you expecting to see with TimeStamp? TimeStamp in Qlik includes both Date and Time portions but your Time field only contains the Time. So using TimeStamp will not make sense.

See the code below and note what happens to the Date portion when using TimeStamp statement:

t1:
Load
App_ID,
time_,
Num(Time#(time_,'hh:mm:ss')) AS TimeNumeric,
TimeStamp(Time#(time_,'hh:mm:ss')) AS TimeStampFormat
Inline [
App_ID , time_
1,01:20:25
1,01:20:30
1,01:22:30
2,01:23:30
2,01:29:30
2,01:26:30
2,01:35:30
2,02:36:30
];

 

marksouzacosta_0-1720110112307.png

 

Read more at Data Voyagers - datavoyagers.net