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: 
Not applicable

exclusion criteria (age)

Ive got a problem with age selection and i hope that someone here can help me with it.

In my datawarehouse ive got the attribute BirthDateTTime (format:      Aug 30 1965 12:00AM)         

now i want to exclude people younger than 7 years old   

can someone tell me how i can make this expression?          

17 Replies
Not applicable
Author

qvw file is uploaded

MayilVahanan

HI

Please check the attached file..

use timestamp() instead of timestamp#()

Hope that helps

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

Thank you for helping out, but have you seen that it still doesnt give the right selection? the result for a birthdate in 2012 is the same as the result for 1890 for example.

Not applicable
Author

Change the expression into this:

if (round(num(today()) - num(Timestamp(CUSTOMER_BirthDTTM))) <=(7*365),'Y','N')

Not applicable
Author

you can also use the age function try the expression:

if(age(BirthDateTTime) < 7, .....)

Not applicable
Author

hey i forgot smth in the age function. he is the correction:

if(age(today(),BirthDateTTime) < 7, ....)

Not applicable
Author

The solution.

Variable:           age (today(),BirthDateTTime) (AS Age_exp)

Expr:                if($(AGE_exp) <=7 ,1,0)

Not applicable
Author

Thanks! i had to make a variable first though before it started working.