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: 
Not applicable

Date and time split

Hi all,

I have an unusal date field: 2008-05-29T11:00:00Z  I dont need the time on the end I just want to pull out the year, month and date as separte fields.

Can anyone offer an suggestions.  Ideally like to do this in the script so I can pass on to others.

Many thanks

Paul

1 Solution

Accepted Solutions
bdunphy
Contributor III
Contributor III

see attached document.

uses left() on the date field to strip out the part you need

View solution in original post

4 Replies
saumyashah90
Specialist
Specialist

what you can do is
=Date(DateTimeField,'DD-MMM-YYYY';)

saumyashah90
Specialist
Specialist

If you have fixed format of this filed then you can also use subfield() function

israrkhan
Specialist II
Specialist II

Try Floor and date functions

like below

load *,

Date(Floor(DateTimeField), 'DD/MM'YYYY) As Date,

Year(Date(Floor(DateTimeField), 'DD/MM'YYYY) as Year,

Month(Date(Floor(DateTimeField), 'DD/MM'YYYY) as Month


from abc


Hope it helps



bdunphy
Contributor III
Contributor III

see attached document.

uses left() on the date field to strip out the part you need