Using Sub-Groups

Sub-groups allow you to mix and match comparisons (ANDs and ORs) within a single find. When you want to change from AND to OR or vice versa, you need a sub-group. By that same token, you only need a sub-group when you want to change from AND to OR or vice versa! CDM+ enforces this rule, and while it may seem overly controlling at first, we suggest you give the interface a chance to help you structure and understand your searches.

To understand sub-groups, you must first understand that all the elements of a sub-group, be they search lines or other sub-groups, share one comparison (AND or OR). It is also important to understand that even a find with only one search line is still a sub-group. See that yellow box with the dotted outline? Sub-groups are visually identified by the colored box that contains them. Your entire find lives within a yellow box, which signifies that you can think of the entire find as one, big sub-group.

To provide an example of this, let’s return to the example of families whose last name begins with C, and who live in Big City. What if we want to amend the search to find families whose last name begins with C and who live in Big City or Versailles? Note that this search, when verbally described, contains both an AND and an OR. This means that you need to involve a sub-group.

But, how do you determine where to place the group, or what goes inside it? Think of the search this way: Families whose last name begins with C and who live in certain cities. Now the search only contains one type of comparison, AND. However, CDM+ doesn’t offer a “certain cities” option—you need to find families in one city or the other. Again, note the use of a single comparison, OR. To build a “certain cities” option, you’ll want to create a sub-group with two search lines, both finding on city, and separated by OR.

With this in mind, construct the advanced find. To build the AND part, enter the search line of Last Name begins with C. To add the “certain cities” option, create a new sub-group by clicking the New sub-group button. Inside the sub-group, add the two search lines for city: City equal to Big City followed by City equal to Versailles.

Let’s examine how the comparisons are displayed. Note that the comparisons listed directly in the yellow box are the same – AND. In the sub-group, the comparison switches to OR. This swapping will continue as you nest more and more sub-groups.

There are a couple of other ways to understand sub-groups. The first is to think of them as parentheses. In this example, the sub-group allows us to choose which interpretation of “people whose last name begins with C and who live in Big City or who live in Versailles” we’d like to use:

Interpretation 1: (people whose last name begins with C and who live in Big City) or who live in Versailles

Interpretation 2: people whose last name begins with C and (who live in Big City or who live in Versailles)

We want the second interpretation, so we group the finds on City together.

Another way to think about sub-grouping is to use substitution. At the most basic level (which corresponds to the yellow box), we want Last Name begins with C and blue box. For blue box, we simply substitute its contents. This can be rendered in a hierarchy as follows:

        Last Name begins with C and blue box
                                                              |
                                                City equal to Big City or City equal to Versailles

This logic is easily expanded to create more and more complex searches that remain easy-to-understand.

To remove a sub-group, delete all the lines from it.

To set up a sub-group (including the parent yellow group) that contains nothing but sub-groups, add the number of sub-groups you'll need, then delete the initial search line. This is how to accomplish the following search. From a purely technical standpoint, start with a cleared search, then click Add Sub-group twice on the initial line, then click to remove search line (minus button) on the initial search line.