
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Extract year from date field - QlikSense
Hi,
I have date field in the following format: 6/29/2017 10:35 AM.
I want to extract the year from the field, i try the function year but it doesn't work.
Any Idea?
Thank you!
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- 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
Try this
Year(Date#(FieldName, 'M/D/YYYY hh:mm TT')) as Year


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
maybe this:
Year(Date#(FieldName, 'MM/DD/YYYY hh:mm TT')) as Year

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great ! it's work - Thank you!

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My date is in the below format :
2019-07-28 00:00:00.0000000
and when I use your code the year shows as empty. Could you help me to solve the issue?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
to extract the year you can use this verison :
Year(Date#('2019-07-28 00:00:00.0000000', 'YYYY-MM-DD hh:mm:ss.0000000')) as Year
Taoufiq ZARRA
"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "
(you can mark up to 3 "solutions") 😉

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, its works but what about if I have many dates in my Excel sheet and I want to show in the filter all years not only 2019.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you just have to change the hard date to the your date field name
like
Year(Date#([Your_Date], 'YYYY-MM-DD hh:mm:ss.0000000')) as Year
Taoufiq ZARRA
"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "
(you can mark up to 3 "solutions") 😉

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have more than 10000 date from 2000 to 2019 so there is way to show only year in the filttrt ?

- « Previous Replies
-
- 1
- 2
- Next Replies »