Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
New Contributor III

Re: Date and time split

see attached document.

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

4 Replies
saumyashah90
Valued Contributor

Re: Date and time split

what you can do is
=Date(DateTimeField,'DD-MMM-YYYY'Smiley Wink

saumyashah90
Valued Contributor

Re: Date and time split

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

israrkhan
Valued Contributor II

Re: Date and time split

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
New Contributor III

Re: Date and time split

see attached document.

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