This question already has an answer here:
We are struggling with how to incorporate AND/OR logic amongst a list of filters in our user interface. I know this question has been asked many times, but I'm trying to fit the logic addition into an existing UI without making too many changes.
Here is what we currently have:
A user can build a chain of filters by selecting a filter from a list of filters, and then specifying a range or possible values for it. The user then sees their filter chain as follows: - Filter1 between 0 and 0.5 - Filter2 in (value1, value2, value3) - Filter3 not in (valueX, valueY) - Filter4 in (Present)
These filters are all AND-ed by default. Now, we want to support more complex logical operations amongst the filters, such as ((Filter1 OR Filter2) AND (Filter3 OR Filter4)).
The idea I've come up with is that most users might not use this advanced query functionality, and so this grouping operation should be hidden under an Advanced tab or modal. When the user builds their filter chain and sees the 4 filters, they can then click on 'Advanced', which will open up a query box for them with the 4 filter names preloaded (the box will only show Filter1, Filter2, Filter3, Filter4, without their constraints). The user will then be able to type around these text tokens to introduce (, ), AND, or OR, to group them in any way they like.
Is what I proposed intuitive at all? Are there sites that have already tackled this problem, and what solutions have they come up with? Thanks for all your help!