Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
dunnalahk123
Creator III
Creator III

How to Change only Year in Date Field

Hi,

Can Some one help me here, My Question is i have a Date Field in MM\DD\YYYY Format.

in that values i have as below

Example   12\03\2022

                 08\07\2019

                 03\24\2018

but i want to Change only Year from that Date field to current year

like below

12\03\2017

08\07\2017

03\24\2017

How can i Achieve it , Some one help me here please.

Thanks,

1 Solution

Accepted Solutions
sunny_talwar

Or this:

LOAD SetDateYear(DateField, Year(Today())) as DateField

View solution in original post

8 Replies
sunny_talwar

Try using SetDateYear() function

LOAD SetDateYear(DateField, 2017) as DateField

sarvesh
Creator III
Creator III

You can use the date() function:

date(YourFieldName, 'MM\DD\YYYY')

Hope this helps

sunny_talwar

Or this:

LOAD SetDateYear(DateField, Year(Today())) as DateField

dunnalahk123
Creator III
Creator III
Author

Thank You So much . It Works. 🙂

dunnalahk123
Creator III
Creator III
Author

Thank You For all  🙂

BI_Dev
Creator II
Creator II

@sunny_talwar  Hi - I have date as  31-Jan-99

 

which is 12/31/1999.How can I change this to show as 12/31/2999 ?This column has multiple dates with diff. years, but for this I want to show as 2999.

sunny_talwar

@BI_Dev Something like this

=Date(SetDateYear(Date#('31-Dec-99', 'DD-MMM-YY'), 2999))

Replace the hard coded value with your field.

BI_Dev
Creator II
Creator II

Awesome - Thank you.