Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Age range variables

Hi All,

I need to make a 2 input fields with variables, one "Age from" and second "Age till". This will be Age range. And for exapmple, when i in the firs field i enter 20, in second 35, it must retur 

only customers ho have age between 20-35. Please help.

my expresion is:  =count({$<LastMembershipDueDate={ "<$(=Date(Today(), 'YYYY.MM.DD'))" },OfferingCategory1={'Narystės'} >}distinct CustomerID )

1 Solution

Accepted Solutions
Not applicable
Author

count({$<LastMembershipDueDate={ "<$(=Date(Today(), 'YYYY.MM.DD'))" },OfferingCategory1={'Narystės'}, Costumer.Age = {>=$(minAge)<=$(maxAge)} >}distinct CustomerID )

hope this helps!

regards,

MT

View solution in original post

7 Replies
MK_QSL
MVP
MVP

Can you post sample data or sample apps?

Not applicable
Author

count({$<LastMembershipDueDate={ "<$(=Date(Today(), 'YYYY.MM.DD'))" },OfferingCategory1={'Narystės'}, Costumer.Age = {>=$(minAge)<=$(maxAge)} >}distinct CustomerID )

hope this helps!

regards,

MT

Not applicable
Author

minAge and maxAge would be the name of your variables

MK_QSL
MVP
MVP

What is the definition of Min and Max Age?

christian77
Partner - Specialist
Partner - Specialist

Here are 2 ways of doing it

Not applicable
Author

like she posted at the beginning she has to input fields where she types in the min and max age! and and inputfield usually needs a variable to save the input value.

Not applicable
Author

Thanks all of you, i little modified Magdalens set analysis and it works

count({$<LastMembershipDueDate={ "<$(=Date(Today(), 'YYYY.MM.DD'))" },OfferingCategory1={'Narystės'}, Customer.Age = {'>=$(minAge)<=$(maxAge)'} >}distinct CustomerID