

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Tags:
- qlikview_scripting
- « Previous Replies
- Next Replies »
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your format is MM-DD-YYYY, Right? Perhaps this?
Year(Date#([Expected Close Date], 'MM-DD-YYYY')) as Year


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try like this
subfiled([Expected Close Date],'-' ,3) as Year


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Avinash
Thank you for your sharing , i get below error :-
Error in expression:
SUBFILED is not a valid function
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would think this?
Year([Expected Close Date]) as Year


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Anil
Thank you for your sharing again.
Your no error but not display any value.
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Image for field, Please? Don't have access to check


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try
Date(Date#([Expected Close Date],'DD/MM/YYYY'),'YYYY')


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Surendra,
Thank you for your help.
Your no error , not display any value.
Paul Yeo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your format is MM-DD-YYYY, Right? Perhaps this?
Year(Date#([Expected Close Date], 'MM-DD-YYYY')) as Year

- « Previous Replies
- Next Replies »