Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Time stamp

Hi all,

How to convert below date into date, year, month, time of the day sale occurs:

2013-06-14 16:42:42 +1000

BR,

SAK

3 Replies
Not applicable

Re: Time stamp

Month( Date#( YOURDATEFIELD,'MMM') ) as Month

Year( Date#( YOURDATEFIELD,'YYYY') ) as Year

Day( Date#( YOURDATEFIELD,'DD') ) as Day

or like this:

Date( Floor( Timestamp#( '2013-06-14 16:42:42', 'YYYY-MM-DD hh:mm:ss')), 'M/D/YYYY') as CreatedDate

Date( Floor( Timestamp#( '2013-06-14 16:42:42', 'YYYY-MM-DD hh:mm:ss')), 'YYYY') as Year

Date( Floor( Timestamp#( '2013-06-14 16:42:42', 'YYYY-MM-DD hh:mm:ss')), 'MMM') as Month

and so on

ali_hijazi
Honored Contributor

Re: Time stamp

and if you want to convert the date into the numerical representation of QlikView you can use the following: num(DayStart(yourTimeStamp))

MVP
MVP

Re: Time stamp

Hi

Try this in your load statement:

Date(Date#(SubField(DateField, ' ', 1), 'YYYY-MM-DD')) As DaleDate,

Year(Date#(SubField(DateField, ' ', 1), 'YYYY-MM-DD')) As Year,

Month(Date#(SubField(DateField, ' ', 1), 'YYYY-MM-DD')) As Month,

Day(Date#(SubField(DateField, ' ', 1), 'YYYY-MM-DD')) As Day,

Time(Time#(SubField(DateField, ' ', 2), 'HH:MMSmiley FrustratedS')) As Time

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Community Browser