How to Build a Query Using Boolean Operators

The examples shown are based on the Children & Happiness sample projects part 1. You can download and import it, if you want to follow along.

Example 1

Open the Query Tool by selecting the Analyze tab and from there click Query Tool.

Question

The aim is to find all statements where people wrote about the two positive effects of parenting: 'fulfillment' and 'life is richer'.

Next, select the operator OR from the ribbon. It will be added into the white field.

Set operators in the Query tool

As OR needs two arguments, you see two nodes with a red dot that can be filled with codes or code groups. You recognize the active node by the blue frame. Double-click on a code or code group to fill it. You can also drag and drop a code or code group to the node, or click on the Add button in the ribbon. The results of this first part of the query will immediately be displayed in the result pane.

Add a code or code group to a query

Click on the second node to activate it and enter a second code or code group. If you double-click a third code or code group, it will be added to the OR query. Another double-click will add a fourth node to the term, and so on.

Add a second term to the query

Simple OR query in the Query tool

Inspecting the Results of a Query

If you click on an operator node, the quotations resulting from the query will be displayed in the bottom pane. If you click on any other node in the query, the respective results of the selected node will be shown.

The results of a query are shown in the Quotation Reader. The full functionality of the quotation reader is also available here.

Reading the results of a query

If you want to read the results in a detached Quotation reader, click on the burger menu and select the option Open in new window:

Reading the results of a query

The status bar at the bottom of the screen shows the total number of quotations this query results in

If you click on any one of the node in a query, the respective results of this node will be shown:

Showing results of selected nodes

Options of the Result Pane

If you click on the Eye icon, you can change the view mode. Available options are:

  • single line
  • small preview
  • large preview
  • show quotation comments
  • show margin

When you click on the Burger icon you can export the results of the query to Excel.

Options in the result window

Removing or Modifying a Query

To delete a query, click on the operator node and select Delete in the ribbon, or the Delete key on your keyboard.

If you only want to delete an argument (i.e. a code or code group) from the query, click on the respective node and then on the Delete button in the ribbon, or the Delete key on your keyboard.

If you want to change the operator, click on the Change Operator button in the ribbon. Changing operators is only available for Boolean queries.

Options for modifying a query

Example 2

In this example, we show how to build a query with two Boolean operators.

Question

The aim is to find all statements coded with:

("children = level of happiness" OR "children > happiness")

that have also been coded with codes of the code group "sources of happiness".

Select the operator OR from the ribbon.

Add the two codes "children = level of happiness" and "children > happiness" into the two empty nodes as described above.

Example query 2

Select the operator AND to extend the query. The result of the first query is now one of the two arguments needed. Activate the empty node by clicking on it and add the code group "sources of happiness".

Example query 2

Activate the empty node by clicking on it and add the code group "sources of happiness".

Example query 2

You can read the query as follows: Find all statements where people wrote that children either make them more happy, or they experience equal level of happiness and where they also mentioned a source of happiness. This query yields one quotation as result.

Example query 2

You can rotate the layout of a query by clicking on the Rotate Layout button in the ribbon.

If you selected the wrong Boolean operator, you can exchange it by clicking on Change Operator in the ribbon. This saves you from rebuilding the query from scratch if you made a mistake.