Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
AquaCapriLyn
Contributor II
Contributor II

DOB column is showing future dates that are not in source

Hello everyone, 

I'm using a csv file as my source data. The DOB range from 1/2/1951 to 9/17/1992 in the source data but when I create a table it ranges from 7/10/1971 to 6/11/2070. I checked the table view in DM but it shows future dates too. 

Zee29_0-1616985698421.pngZee29_1-1616985720728.pngZee29_2-1616985759793.png

 

Labels (1)
1 Solution

Accepted Solutions
MayilVahanan

HI @AquaCapriLyn 

Try like this

Load *, Year(DOB1) as YearDOB;

Load *,

Date(If(Right(DOB, 2) >= Right(Year(Today()),2), MakeDate(1900+Right(DOB,2), Left(DOB,2),Mid(DOB, 4,2)), ALt(Date(DOB, 'DD/MM/YYYY'), Date(Date#(DOB, 'MM/DD/YY'),'MM/DD/YYYY')))) as DOB1

From ursource;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

6 Replies
MayilVahanan

HI @AquaCapriLyn 

In excel, you have MM/DD/YYYY format, but in Qliksense, DOB has MM/DD/YY format. If you are using Year(DOB) in front end, might be, Qlik recognize, values are in 20K instead of 19K. 

Can you bring Year of DOB in script, instead of in front end.

Like 

Load *, Year(DOB) as Year from yoursource;

Hope it helps.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
AquaCapriLyn
Contributor II
Contributor II
Author

Hello @MayilVahanan ,

I tried doing it with the script editor but I got the same results. 

Zee29_0-1617060804966.png

 

 

MayilVahanan

HI @AquaCapriLyn 

Can you please send sample data to verify?

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
AquaCapriLyn
Contributor II
Contributor II
Author

Hi @MayilVahanan,

Here it is 

MayilVahanan

HI @AquaCapriLyn 

Try like this

Load *, Year(DOB1) as YearDOB;

Load *,

Date(If(Right(DOB, 2) >= Right(Year(Today()),2), MakeDate(1900+Right(DOB,2), Left(DOB,2),Mid(DOB, 4,2)), ALt(Date(DOB, 'DD/MM/YYYY'), Date(Date#(DOB, 'MM/DD/YY'),'MM/DD/YYYY')))) as DOB1

From ursource;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
AquaCapriLyn
Contributor II
Contributor II
Author

@MayilVahanan Thank you very much! It worked 😁