Select to view content in your preferred language

Filter widget to support comparing user inputted value between two fields

106
1
4 weeks ago
Status: Open
Labels (1)
RistoYlem
Occasional Contributor

I have a dataset with two fields lower age and upper age and I want to filter this dataset in EB filter widget based on user input if the input is between the values in these fields. e.g in one row in the table lower age is 7 and upper age is 12 and in the other row lower age is 3 and upper age is 7. User inputs 10 in the filter and the first row gets filtered. 

Currently how I set the filter up is I calculated a string of numbers separated by commas into third field (07, 08, 09, 10, 11, 12 or 03, 04, 05, 06, 07) and use "contains" operator to check if user inputted value contains in the third field. This work quite well, but for the number below 10 I need to add 0 in front of the real age and the user also needs to input 0 in front of the number otherwise the filter will filter all the number that contains number 7 for example. This is not very user friendly.

1 Comment
JeffreyThompson2

JeffreyThompson2_0-1739973063129.png

Maybe you should build a pair of clauses? Something like this.