Camillia
asked on
Query Builder - should I use AND/OR ?
I'm building a "query builder". User selects columns, then "conditions" which is the "where" clause.
Our users aren't technical.
1. My manager says to make it look like what TFS does.... AND, OR and then maybe parenthesis to see what conditions should be in parenthesis and grouped together.
This is TFS query builder
2. I was researching this and came across this Query Builder Example - Demo
Please look at the "Condition" section. It has "all", "any", "none" and "not all". No And/Or and parenthesis and grouping the AND/OR together.
I want to do the "all", "any", none" and "not all". Much simpler than AND/Or and parenthesis... too complicated.
How would you guys do it? how can I explain this to my manager that "all", "any", "none" and "not all" is simpler? how can I convince him? Other examples I can look at?
Our users aren't technical.
1. My manager says to make it look like what TFS does.... AND, OR and then maybe parenthesis to see what conditions should be in parenthesis and grouped together.
This is TFS query builder
2. I was researching this and came across this Query Builder Example - Demo
Please look at the "Condition" section. It has "all", "any", "none" and "not all". No And/Or and parenthesis and grouping the AND/OR together.
I want to do the "all", "any", none" and "not all". Much simpler than AND/Or and parenthesis... too complicated.
How would you guys do it? how can I explain this to my manager that "all", "any", "none" and "not all" is simpler? how can I convince him? Other examples I can look at?
They are just hiding the parenthesis from you but as Ste5an has already pointed out you can think of AND as ALL and ANY as OR
The simplest solution is to ask for conditions and then the ANY / ALL.
It gets complicated when you want something like
Do-able but needs a bit more coding.
Personally I would do the simple one first.
The problem with your original image is that you are not taking precedence into account. AND has higher precedence than OR
So
In this case OR is usually used to join one or more AND clauses together - so you could build an interface that creates groups of conditions - WHERE it is assumed there is an OR between each group and an AND between the items within each group.
The simplest solution is to ask for conditions and then the ANY / ALL.
It gets complicated when you want something like
WHERE (A AND B AND C) OR (D AND E AND F)
Do-able but needs a bit more coding.
Personally I would do the simple one first.
The problem with your original image is that you are not taking precedence into account. AND has higher precedence than OR
So
WHERE A AND B OR C
Is actuallyWHERE (A AND B) OR C
But the user might wantWHERE A AND (B OR C)
In this case OR is usually used to join one or more AND clauses together - so you could build an interface that creates groups of conditions - WHERE it is assumed there is an OR between each group and an AND between the items within each group.
ASKER
Who's working on what kind of data?Project managers and finance people want to run report to look at their lease history, who has leased what and when
The problem with your original image is that you are not taking precedence into account
Exactly! an average user doesn't know the precedence so my manager said something like having parenthesis and groupings... like TFS...with a checkbox next to AND and OR.
you can think of AND as ALL and ANY as ORI agree. Just have to put an email together and convince my manager that having parenthesis and building all this AND / OR is too complicated
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@Bill: can you show us your user hat?
Many of mine users would fail even with these graphical interfaces.
Ok, they also fail at the Excel style AND(OR(AND(a=1;b=2);c=3);d =4) ;)
Many of mine users would fail even with these graphical interfaces.
Ok, they also fail at the Excel style AND(OR(AND(a=1;b=2);c=3);d
ASKER
Bill, that user interface is not user friendly for an average project manager or an assistant :)
TFS is different... developers or someone in IT creates the queries.
I like Julian and ste5an's explanation. I'll build on that with my manager.
TFS is different... developers or someone in IT creates the queries.
I like Julian and ste5an's explanation. I'll build on that with my manager.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, mocking up and starting with something simple.
ALL is AND and ANY is OR.