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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date format

Hello:

I've been having trouble with the date format, this is my problem:

I have the following date format: 01-08-2006  0:00:00

And I just need the year (2006).

Do you have any idea of the best way to get it?

Thanks a lot

Labels (1)
6 Replies
sunny_talwar
MVP
MVP

try this in the script if your date is MM-DD-YYYY

LOAD Year(Date#(yourDateField, 'MM-DD-YYYY h:mm:ss') as Year

if date is DD-MM-YYYY, then use this:

LOAD Year(Date#(yourDateField, 'DD-MM-YYYY h:mm:ss') as Year


HTH

Best,

Sunny

agomes1971
Specialist II
Specialist II

avinashelite
MVP
MVP

try like this:

year(Date(floor(date_feild),'MM/DD/YYYY'))

Anonymous
Not applicable
Author

Thanks alot! that worked just fine!

Anonymous
Not applicable
Author

Thanks alot! that worked just fine!

avinashelite
MVP
MVP

cool, Please mark it as answered and close this thread