Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

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
Partner - Master II
Partner - Master II

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

I can walk on water when it freezes
jonathandienst
Partner - Champion III
Partner - Champion III

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:MM:SS')) As Time

Regards

Jonathan

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