Hi ExB community!
I am building an application that includes a filter based upon a field of years ("2016 through current"). I am trying to group the years for 2016 through 2019 under a single label such that those four years will be selected if the user select that label (such as "Pre-2020").
Using the "Predefined unique values" option in the SQL Expression Builder, I can specify the label for the years 2016, 2017, 2018, and 2019:
Unfortunately, the Filter Widget does not combine those years into a single option, but instead lists them out individually, with the labels repeated. And each label still only applies to the respective year to which it is assigned.
I am hoping someone can help me point out what I am missing, so that the Filter Widget knows to group the four years as a single option...or maybe confirm that this SHOULD work, but is actually a bug.
Thanks in advance!
Mark
Solved! Go to Solution.
The label is just a label there is no logic that if two labels are the same that they should be combined into a single menu option. And what you really want requires two different types of SQL logic.
What you really want is a single dropdown menu that has two distinct types of SQL logic, something a less than 2020 and then a set of exact matches for the other numbers. That does not appear to be possible. It is possible to build a single pre-2020 button and a 2020 and later dropdown (or set of buttons).
Here I created a single button that will filter values between 1 and 3.
Then I made a new filter and set it to IS predefined unique values for the larger numbers.
This will give me two buttons. One that filters 1-3 and another that triggers a dropdown menu for 4-6.
From design perspective, it would probably be better to make individual buttons for 4,5, and 6. Especially if these individual numbers are supposed to have equal importance as 1-3 as a group.
The label is just a label there is no logic that if two labels are the same that they should be combined into a single menu option. And what you really want requires two different types of SQL logic.
What you really want is a single dropdown menu that has two distinct types of SQL logic, something a less than 2020 and then a set of exact matches for the other numbers. That does not appear to be possible. It is possible to build a single pre-2020 button and a 2020 and later dropdown (or set of buttons).
Here I created a single button that will filter values between 1 and 3.
Then I made a new filter and set it to IS predefined unique values for the larger numbers.
This will give me two buttons. One that filters 1-3 and another that triggers a dropdown menu for 4-6.
From design perspective, it would probably be better to make individual buttons for 4,5, and 6. Especially if these individual numbers are supposed to have equal importance as 1-3 as a group.
Thanks for the info and suggestions, @JeffreyThompson2! I spoke with the data owner and they may make a new text field to reclassify the years more appropriately.