Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vinod22kv
Creator
Creator

How to extract date,time,day,year,month from a single field.

Hi,

I have a field named as Date_Time and form that i have extract date,time,day,year,month.Can you please help me out. and the data in the excel is given bellow.

  Date_Time

Fri, 11 May 2018 10:09:06 +0000
Fri, 11 May 2018 10:35:59 +0000
Mon, 14 May 2018 07:07:09 +0000
Mon, 14 May 2018 07:43:32 +0100
Mon, 14 May 2018 08:13:21 +0100
Mon, 14 May 2018 09:21:16 +0000
Mon, 14 May 2018 10:00:59 +0100
Mon, 14 May 2018 11:01:24 +0000

Thanks and Regards,

Vinod.

1 Solution

Accepted Solutions
vishalarote
Partner - Creator II
Partner - Creator II

Try this,

LOAD *,

SubField(Date_Time,',',1) as Day,

mid(Date_Time,6,2) as Date,

mid(Date_Time,8,4) as Month,

mid(Date_Time,12,5) as Year,

Mid(Date_Time,18,9) as Time

Inline [Date_Time

Fri, 11 May 2018 10:09:06 +0000

Fri, 11 May 2018 10:35:59 +0000

Mon, 14 May 2018 07:07:09 +0000

Mon, 14 May 2018 07:43:32 +0100

Mon, 14 May 2018 08:13:21 +0100

Mon, 14 May 2018 09:21:16 +0000

Mon, 14 May 2018 10:00:59 +0100

Mon, 14 May 2018 11:01:24 +0000

](delimiter is '');

Capture543.PNG

View solution in original post

4 Replies
YoussefBelloum
Champion
Champion

Hi,

maybe try this on the script:

TABLE

LOAD

.

Date(Timestamp#(DATE_TIME,'DDD DD MMM YYYY hh:mm:ss.fff'),'DD/MM/YYYY') as Date


FROM...


and tell me what you see on a listbox using Date field for example


vishalarote
Partner - Creator II
Partner - Creator II

Try this,

LOAD *,

SubField(Date_Time,',',1) as Day,

mid(Date_Time,6,2) as Date,

mid(Date_Time,8,4) as Month,

mid(Date_Time,12,5) as Year,

Mid(Date_Time,18,9) as Time

Inline [Date_Time

Fri, 11 May 2018 10:09:06 +0000

Fri, 11 May 2018 10:35:59 +0000

Mon, 14 May 2018 07:07:09 +0000

Mon, 14 May 2018 07:43:32 +0100

Mon, 14 May 2018 08:13:21 +0100

Mon, 14 May 2018 09:21:16 +0000

Mon, 14 May 2018 10:00:59 +0100

Mon, 14 May 2018 11:01:24 +0000

](delimiter is '');

Capture543.PNG

vinod22kv
Creator
Creator
Author

It is not working.

YoussefBelloum
Champion
Champion

You can take vishal solution. It is working