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

Announcements
Join us in Zurich on Sept 24th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

How to convert date format DD-MM-YYYY into Year ?

How to convert date format DD-MM-YYYY into Year ?


Hi All


I have import a raw data file from Excel to Qli View.


I try to convert the imported field name = [Expected Close Date] in order year format YYYY.


I have try to using the below expression :-


//   text(right(Year(date#([Expected Close Date],'DD/MM/YYYY')), 2),'00') as Year,

//   dual(right(Year(date#([Expected Close Date],'DD/MM/YYYY')), 2),'00') as Year,

//   year(today()) - year([Expected Close Date]) + 1                                         as Year,

//   num(right(Year(date#([Expected Close Date],'DD/MM/YYYY')), 2),'00') as Year,

//   dual(right(Year(date#([Expected Close Date],'DD/MM/YYYY')), 2),'00') as Year,

//   Right(year([Expected Close Date]),2)          as Year,


All the above not able to work.


Can some one advise me.


Paul Yeo

23 Replies
Anil_Babu_Samineni

Please try by yourself using existing one, Anyway this?

Num(Month(Date#([Expected Close Date], 'MM-DD-YYYY'))) as Month

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
paulyeo11
Master
Master
Author

Hi Anil

Thank you very much , it work now.

Paul

rygreene3
Contributor II
Contributor II

This worked for me!  Thank you, Anil