Select to view content in your preferred language

Filter Widget - Group multiple integers under one label

414
2
Jump to solution
12-21-2023 08:03 AM
Mark_Prettyman
New Contributor III

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:

Mark_Prettyman_1-1703174267388.png

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.

Mark_Prettyman_2-1703174415184.png

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

 

0 Kudos
1 Solution

Accepted Solutions
JeffreyThompson2
MVP Regular Contributor

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.

JeffreyThompson2_0-1703177600436.png

Then I made a new filter and set it to IS predefined unique values for the larger numbers.

JeffreyThompson2_1-1703177744527.png

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.

GIS Developer
City of Arlington, Texas

View solution in original post

0 Kudos
2 Replies
JeffreyThompson2
MVP Regular Contributor

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.

JeffreyThompson2_0-1703177600436.png

Then I made a new filter and set it to IS predefined unique values for the larger numbers.

JeffreyThompson2_1-1703177744527.png

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.

GIS Developer
City of Arlington, Texas
0 Kudos
Mark_Prettyman
New Contributor III

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.

0 Kudos