Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Highlighted
anitamelbye
Contributor

SSN number and age (DDMMYYXXXXX) age?

MayHello,

I have tried to find an answer to my question, but I can not find any good solution. Maybe someone can help me?

Our SSN# is 11 digits and the first six numbers is our birthdate. Eks. DDMMYYXXXXX.

How can I easily find the age from this SSN#? Is it possible?

Is it even possible to find a solution if a person is born March 1. 2001? SSN# will be 010301XXXXX

I am so very greatful for a little help with this challenge

THANK YOU in advance!
🙂

Best regards

Anita
,

Tags (3)
1 Solution

Accepted Solutions
Not applicable

Re: Re: Re: SSN number and age (DDMMYYXXXXX) age?

Ah I see, looks like you have a couple of issues going on here, the leading zero dropping and also the year being interpreted as this century. Please see attached, I have had to create a new field in your excel to define the century for each SSN, as you could have a mix in there.

hope that helps

Joe

7 Replies
MVP
MVP

Re: SSN number and age (DDMMYYXXXXX) age?

Date(Date#(Left(SSN#,6),'DDMMYY')) as YourDateField

Not applicable

Re: SSN number and age (DDMMYYXXXXX) age?

Then if you want age from this, you can just use

Age(today(),Date(Date#(Left(SSN#,6),'DDMMYY'))) as YourAgeField

anitamelbye
Contributor

Re: SSN number and age (DDMMYYXXXXX) age?

Thank you for trying to help, but it does not give me the right result..

When the SSN# begins with a '0' the results in age is -.

When the SSN# begins with 1-9, the results is 44 for all the emplyees 🙂

Any other tips?

Not applicable

Re: SSN number and age (DDMMYYXXXXX) age?

Maybe the formats then try

Age(Date(today(),'DDMMYY'),Date#(Left(SSN#,6),'DDMMYY'))

failing that post up the example and can then take a better look

anitamelbye
Contributor

Re: Re: SSN number and age (DDMMYYXXXXX) age?

Thank you again for trying to help, but I am sorry, it still does not work.

I have tried to simplify my data, I hope you understand 🙂

Se Attached files .xls (with the SSN#) and .qvw

How can I find the right age? 🙂

Not applicable

Re: Re: Re: SSN number and age (DDMMYYXXXXX) age?

Ah I see, looks like you have a couple of issues going on here, the leading zero dropping and also the year being interpreted as this century. Please see attached, I have had to create a new field in your excel to define the century for each SSN, as you could have a mix in there.

hope that helps

Joe

puttemans
Valued Contributor

Re: SSN number and age (DDMMYYXXXXX) age?

Hello Anita,

I've found a solution, be it through a pass-by.

 

100:

LOAD * inline [ number
010196-48911
010262-44699
130388-46781
130449-30794
210154-28721
210186-45383
210255-47974
210284-34909
210379-38391
210479-39760
210556-38958
210576-45900
]
;


200:

LOAD*,
2014-
year2 as age;

LOAD*,
year&right(date,2) as year2;

LOAD *,
if(right(date,2)<= 15 ,20, 19) as year;

LOAD *,
date#(left(number,6),'DDMMYY') as date
Resident 100;
drop table 100;

Kind regards,