I'm working on a project where users can choose multiple criteria and mix them with logical operators AND, OR and NOT. Currently we decided not to let users mix criteria because the UI is too complex for them. But in the future we want to give them more freedom.

Have you already encountered this problem? How did you solve it? Have you got an example?

In my mind, maybe one block provides the criteria and another block lets the users manage a box. The user could drag and drop multiple criteria on different boxes and then apply logical operators on them.

What do you think about this?

  • 2
    Perhaps do it visually using Venn diagrams Commented Nov 28, 2014 at 17:17
  • Can you please try to make the question more concrete by providing your own example (describe the problem domain) or a mockup?
    – Rahul
    Commented Nov 28, 2014 at 20:32

3 Answers 3


Finance, accounting, risk management people use interfaces like this all the time. I want category A, B, C in time range X but without B1 and C 2.

If you're making an app for such users I don't think it's an issue at all. As always make sure you understand how users complete their task and what they are trying to accomplish (don't take the BA's word for it); think about how you can improve on it; present a variety of options to the users and test, test, test.

These people are expert users and they want to get their data as fast as possible.

  • Actually you have introduced another operator. Without is Expect.
    – paparazzo
    Commented Nov 28, 2014 at 16:24
  • @Blam every time someone wanted something "without" they meant AND NOT for each item after "without" - usually implemented using NOT operator - I have no idea what do you mean by Expect operator, could you please elaborate?
    – Aprillion
    Commented Nov 29, 2014 at 18:43
  • Except is take away as opposed to and not. In the case of multi value properties like cc it can be different.
    – paparazzo
    Commented Nov 29, 2014 at 20:27
  • Thanks for your answer. We have to learn more about users used to do with our application to get their result. In the future, we'll offer differents UI, let users test them, and get feedback to choose the best :) Commented Dec 1, 2014 at 9:37

I have yet to see a GUI that could replace the expressive power of a text representation for any query.

Bugzilla has a somewhat clumsy Custom Search interface that allows you to "Show Advanced Features" to be able to put parentheses around groups of criteria like (a OR b) AND (c OR d NOT e) - almost impossible to change your mind if you make a 1 wrong click, but the search in bugzilla is a GET request, so it is possible to manipulate the text of the query in the URL.

If individual criteria are too complex (i.e. not simple keywords), you can try to experiment and separate the Boolean logic from individual criteria, e.g.:

1. ddd ddd ddd
2. ddd ddd ddd
3. ...

□ Match ALL Criteria
□ Match ANY Criterium
■ Create Custom Query [?](help box):
  |1 AND 2 AND 3                    |

Unless manually edited, the text box should be pre-populated by ANDs when matching ALL criteria vs. ORs if matching ANY, it should not automatically change after manually edited, any omitted criteria should be highlighted red with appropriate warning message..

You could provide buttons AND OR NOT ( ) - when pressed to insert that command into text box, also possible to drag&drop into arbitrary position, same for dragging criteria into the text box..

But as always, ask your users and test your solutions.

  • Thanks for your answer. That's an interesting solution. Very helpful ! Commented Dec 1, 2014 at 9:40

Your description reminded me of the Advanced Search feature in the Thunderbird mail client.

In Thunderbird's Advanced Search window, users either pick "all of the following" (a query with only AND operators) or "any of the following" (a query with (a query with only OR operators).

The query itself is then constructed from a number of 'rules', which are of the form field, condition, value. Every condition has an inverse, which provides the NOT operator (for example, there is a 'does not contain', 'larger than' is paired with 'smaller or equal than', and so on).


There is no grouping, and making queries that contain both OR and AND operators is impossible, so this solution is less powerful than some form of text-based query. However, it's relatively easy to understand, probably useful enough for advanced users (if maybe not power users), and relatively easy to implement.

Image from here.

  • Thanks for your answer. Very interesting solution. I'll take a look. Commented Dec 1, 2014 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.