Grouping Terms and Working with Parentheses

When you add search terms to your report, Delightful Labor includes the terms as "or". This means that if any search criteria is met, the associated records will appear in the report.

Let's say you have a personalized client table that tracks high school students as they prepare for college, with the following fields:

  1. Date of SAT test (date field)
  2. College track (check box)
  3. Vocational interest (drop-down list)
  4. College Choice (text)
  5. Gender (from client record)

Now let's say that you've learned that Freedonia A&M is offering scholarships to girls interested in agriculture or STEM (science/technology/engineering/mathematics) fields, and you want to run a report to find clients who may qualify.

You create a custom client report, and add the following search terms:

  • Gender = "Female"
  • College track = "Yes"
  • Date of SAT test between 2014-09-01 and 2015-05-31
  • Vocational interest = "agriculture"
  • Vocational interest = "math/science/engineering"

Our report now looks like this...

parentheses

But this isn't what we want! Currently this report will find all females, all clients on a college track, all clients who have taken the SAT after 9/1/2014, etc. We need to group our search terms and adjust the "and/or" settings to correct the search. To group the search terms we'll add parentheses to the search, and adjust the "and/or" settings that connect the group terms. We click on the "Parentheses" link:

parentheses

We now add parentheses by clicking in the boxes to the left and right of the search term (it doesn't matter which box, as long as it on the proper side of the search term). We also adjust our "and/or" selections:

parentheses

After updating, we are returned to the custom report:

parentheses

Let's look at our new search expression. It says:

Find all the female clients who are on the college track, and whose date of SAT tests is between 9/1/2014 and 5/31/2015, and who have expressed a vocational interest in either agriculture or math/science/engineering.

Now let's run the report. We have one matching client. You can see that all the search criteria have been met:

parentheses

parentheses

 

Unbalanced Parentheses

"Unbalanced parentheses" means that the left parentheses "(" don't match the right parentheses ")". This greatly confuses Delightful Labor, because it doesn't know how to group search terms when this happens. Let's say that we made a mistake while setting up our parentheses in the previous example:

parentheses

Delightful Labor saves the search expression, but issues a warning and doesn't allow the report to be run until the parentheses are balanced.

parentheses

 

General Notes about Parentheses and Groupings

  • "AND" means both expressions must be true for records to qualify for the report
  • "OR" means that at least one of the expressions must be true for records to qualify for the report
  • terms within parentheses are evaluated as a single expression
  • expressions can be nested within parentheses, such as (((A or B) and C) or D)

 

Single Entry Tables

Delightful Labor allows you to create single-entry or multi-entry personalized tables. A single entry table basically expands the fields in the parent record, while a multi-entry table allows you to add 0, 1, or many records associated with the parent table. (More info here).

Delightful Labor keeps track of whether or not a single-entry record has been edited for each parent record. For example, in the above example, Delightful Labor knows if the college prep information was entered on a client-by-client basis. This helps you know if the information is current, or is simply the default information applied when the table was created.

This creates a bit of a problem when using a single-entry table as part of your custom report. If you use a search term from a single-entry table, you probably don't want the search results to include entries where the table has never been written (even if the search result matches the default entry).

When a single-entry search term is added to your custom search, Delightful Labor will exclude results from single-entry tables that have never been written. However, if no search term from a single-entry table is used, but a report field from single-entry tables is included, Delightful Labor will display those fields.