Forum Academy Marketplace Showcase Pricing Features

Filtering by age based on DOB

I’ve made a page for users to register which includes their DOB.

I have another field called age-range which i’d like to use as a filter for registered users age.

Currently I have a filtered search which throws up all the correct users:

I need to add one more filter, for age. Hard coded the solution looks like:

However I need to replace the numbers with ranges from a slider. The slider has Auto Binding enabled so the values can’t be manipulated with a workflow.

When I try and use the age range min : max values, I can’t find a way to make the values negative.

Is there any other way of manipulating these values so the filter can use their negative versions? Or is there another way to filter this that i’m missing?

Try starting your expression with 0 - to make the value a negative! :slight_smile:

Thanks for the advice. Arithmetic operations don’t seem to work though :frowning:

Any other ideas!?

So, anyone with the same requirements…

On page load I set up two states, age-range-min & age-range-max. For each I just multiplied the min and max by -1 and then used these values after +(years). I update the states when the user changes the age range.