Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
mnvrma
Partner - Contributor III
Partner - Contributor III

year function picking up '2068' value from 68 but it should be '1968'

year function picking up '2068' value from 68 but it should be '1968'

 

I have attached the Captured Image.

2 Solutions

Accepted Solutions
sunny_talwar

You can check like this

If(Year(birthDate) > 2000, Year(birthDate)-100, Year(birthDate)) as BirthYear

View solution in original post

sunny_talwar

I am not sure what Year is needed as what... but you can make this smart like this

If(Year(birthDate) > Year(Today()), Year(birthDate)-100, Year(birthDate)) as BirthYear

Anything before 2019 will show up in 2000s and anything after will be from 1900s.

View solution in original post

5 Replies
sunny_talwar

You can fix the Year by subtracting 100 from it....

Year(birthDate) - 100 as BirthYear

Do you also want to fix birthDate?

mnvrma
Partner - Contributor III
Partner - Contributor III
Author

But now year 69 is shown as 1869.

sunny_talwar

You can check like this

If(Year(birthDate) > 2000, Year(birthDate)-100, Year(birthDate)) as BirthYear
mnvrma
Partner - Contributor III
Partner - Contributor III
Author

But I want 01 as 2001 then...

sunny_talwar

I am not sure what Year is needed as what... but you can make this smart like this

If(Year(birthDate) > Year(Today()), Year(birthDate)-100, Year(birthDate)) as BirthYear

Anything before 2019 will show up in 2000s and anything after will be from 1900s.