Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
dandaanilreddy
Partner - Creator III
Partner - Creator III

convert the field to a date field

Hello ,

I have a field in which i have the values like below. I want to convert this as a date field. Can someone help me ?

Tue Jul 23 16:03:36 BST 2019
Wed Feb 20 21:28:59 GMT 2019

 

Thanks

Labels (1)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

You can do it in the script like this:

 

 

LOAD 
	MyTimestamp, 
	makedate(
		SubField(MyTimestamp,' ' , -1),  //Year
		Month(date#(SubField(MyTimestamp,' ' , 2), 'MMM')), //Month
		SubField(MyTimestamp,' ' , 3) //Date
	) as MyDate 
Inline [
MyTimestamp
Tue Jul 23 16:03:36 BST 2019
Wed Feb 20 21:28:59 GMT 2019
];

 

 

clipboard_image_1.png

 

 

Or as a measure in the chart like this.

 

 

=makedate(
SubField(MyTimestamp,' ' , -1),  //Year
Month(date#(SubField(MyTimestamp,' ' , 2), 'MMM')), //Month
SubField(MyTimestamp,' ' , 3) //Date
)

 

 

 

clipboard_image_0.png

 

View solution in original post

1 Reply
Vegar
MVP
MVP

You can do it in the script like this:

 

 

LOAD 
	MyTimestamp, 
	makedate(
		SubField(MyTimestamp,' ' , -1),  //Year
		Month(date#(SubField(MyTimestamp,' ' , 2), 'MMM')), //Month
		SubField(MyTimestamp,' ' , 3) //Date
	) as MyDate 
Inline [
MyTimestamp
Tue Jul 23 16:03:36 BST 2019
Wed Feb 20 21:28:59 GMT 2019
];

 

 

clipboard_image_1.png

 

 

Or as a measure in the chart like this.

 

 

=makedate(
SubField(MyTimestamp,' ' , -1),  //Year
Month(date#(SubField(MyTimestamp,' ' , 2), 'MMM')), //Month
SubField(MyTimestamp,' ' , 3) //Date
)

 

 

 

clipboard_image_0.png