Grouping (nesting) filter conditions |
You can group two or more conditions as a single unit within the list of conditions. The grouped conditions are evaluated before the conditions outside the group.
A group may contain multiple nested levels of sub-groups, but each sub-group must be completely within its parent group. When a filter contains multiple levels of grouping, the innermost group is evaluated first.
For example, if you have a number of computers, with some running Windows XP and some running Windows 2000, and apply the following filter:
OperatingSystem.Name = Windows XP AND PhysicalMemory.Capacity > 512 Mb OR OperatingSystem.Name = Windows 2000 AND PhysicalMemory.Capacity < 256 Mb
Without grouping, this filter returns only the Windows 2000 computers that have less than 256 Mb of memory. The Windows XP computers that were selected with the first two conditions are not returned as they do not satisfy the fourth condition.
To make the filter return the Windows XP computers that have over 512 Mb of memory and the Windows 2000 computers that have less than 256 Mb of memory, you need to group each OperatingSystem condition with the corresponding PhysicalMemory condition. This grouping is shown below:
( OperatingSystem.Name = Windows XP AND PhysicalMemory.Capacity > 512 Mb ) OR ( OperatingSystem.Name = Windows 2000 AND PhysicalMemory.Capacity < 256 Mb )
The grouping is indicated in the list of conditions as follows:
( in the (...
column
|
The first condition in the group.
|
) in the ...)
column
|
The last condition in the group.
|
When you delete conditions from a group, the grouping is automatically adjusted according to the remaining group start and end conditions. The grouping adjustment depends on whether the deleted conditions are at the start or end of the group, or in the middle: