Advanced Conjunctions in Queries

Overview

Criteria applied to fields in a query are usually joined by the “And” conjunction by default, so each criterion that is applied will necessarily narrow the search results. Running a Find People query and applying the criteria “David” for First Name and “Jones” for Last Name, for instance, would find records where both those fields match (likely a relatively small data set). Axiom also has the ability to specify advanced conjunctions using the “Or” operator, so in the same example, an “Or” conjunction would find everyone with a last name of “Jones” or first name of “David,” likely a much larger number of people.

Using the “Or” conjunction has myriad uses in Axiom, e.g. finding people who have emergency orpickup or medical for a particular student.

Setting Up “Or” Conjunctions

Conjunctions begin and end with parentheses. To illustrate this, consider the potential need to find adults with emergency, pick up, or medical authorization for a student:

Run a Find Relationships query from the System homepage and pull in the Emergency, Pick Up, and Medical Authorization fields. This example will look for all people with one of these three fields checked “Yes.”

  1. Enter the “Yes” criterion for all three fields.
  2. Click on the first field and then click the Style tab. Under Advanced Criteria Options, select the open parenthesis from the Start: drop down menu. Note that the conjunction here can remain “AND,” presuming that the criteria being specified in the parentheses should be applied along with other criteria entered in the query.
  3. Click on the second field and select “OR” from the Conjunction drop down menu.
  4. Click on the third field and select “OR” from the the Conjunction drop down menu and a closed parenthesis from the End: drop down menu. The resulting field list should look like the screenshot, displaying the parentheses and “OR” conjunctions in the field list.

Enter a unique full name in the Person field and run the query. The results will show people with emergency or pick up or medication authorization for the specified person.

Notes on Display and Usage

  • Query fields that start or end a criteria conjunction group will show its parentheses in the query field list.
  • Query fields with criteria will show their conjunction (“AND”/”OR”) in a small label above the criteria preview. If there aren’t any conjunction groups in the query, or if all the conjunctions are “AND,” the labels will be suppressed. This is the case for the majority of queries.
  • The conjunction drop downs (Conjunction, Start, and End) are only enabled for fields with criteria, since they only apply to criteria.
  • The maximum number of nesting levels is five. Tip: If a conjunction seems to need more than five nested parentheses, the query probably needs to be reconsidered.
  • The conjunction label for the first criteria field in the query is not shown in the query field list because conjunctions apply between criteria, so the first one in the query is not relevant.