Add Condition Group
The Add Group feature allows the creation of complex queries by grouping multiple conditions or sub-groups. This is useful for combining conditions using AND and OR logic or nesting groups for detailed filtering. Groups function like parentheses in an SQL WHERE clause, controlling how conditions are evaluated.
Steps to Add a Group
Initiate the Process
In the Main Entity Component, click the Add Group icon.
A new condition group will be added, marked by a box containing an empty set of conditions or groups.
Add Conditions or Groups
Inside the new group, either:
Add a condition by clicking Add Row to define specific criteria.
Add another group by clicking the Add Group icon to nest conditions within this group.
Select Logical Operators
By default, conditions or sub-groups within a group are connected by the AND operator. Switch to OR by clicking the AND/OR toggle between conditions or groups.
Combine Groups and Conditions
Conditions and groups can be mixed within a group to create intricate logic.
Example: Combine conditions like (Engineering OR Marketing) with another group AND (Salary > $80,000).
Add Multiple Groups (Optional)
Multiple groups can be added at any query level. Each group can contain its own combination of conditions and sub-groups, connected using AND/OR.
Example:
Query for employees who:
Were hired after January 1, 2020.
Are either in Engineering OR Marketing.
Have a salary greater than $80,000.
Steps:
Click Add Group to create a group.
Inside the group:
Add a condition for the Department property set to = Engineering.
Add another condition for Department set to = Marketing.
Combine these conditions using OR.
Inside the same group, add a sub-group to check for Salary > $80,000 and combine using AND.
Outside the group, add a condition for Hire Date >= January 1, 2020.
This query will return employees hired after January 1, 2020, who are in either the Engineering or Marketing departments and have a salary above $80,000.
Last updated