Sign in or register
for additional privileges

Using NVivo: An Unofficial and Unauthorized Primer

Shalin Hai-Jew, Author

You appear to be using an older verion of Internet Explorer. For the best experience please upgrade your IE version or switch to a another web browser.

Data Query: Compound Query (Advanced)

Compound Query (Advanced)

Another advanced data query feature is the Compound Query. This enables users to search for particular contents by combining searches (types of searches).  For example, a user may combine a text search and a coding query search, or two text search queries, or two coding queries. The user may query based on a number of relations between Subquery 1 and Subquery 2 (such as proximity between query strings).   (This feature is not usable in the Data Query Wizard because of the additional complexity.)  

As with any data query, this query would benefit from researcher intimacy with the data set.  In terms of practical applications of compound queries, such queries may answer such generic research questions as the following:  

  • Has anyone made the connection between Concept A (represented in Subquery A) and Concept B (represented in Subquery B)?  If so, what are the observations or assertions?  
  • Is there an association between Author A and Author B?  Are they mentioned in proximity (collocated) to each other?  If so, what is the gist of the connection?  

Running a Compound Query in NVivo

To begin a compound query in NVivo, open the project in the software.  In the NVivo ribbon, go to:  

Query tab -> Compound Query button 

The Compound Query window opens to enable the setting of the parameters for the data extraction.  (It helps to maintain clear coherence of what decisions are made at any step of a data query and to document such choices—so that the terms of the data extraction may be accurately represented in the methodologies section of a paper, chapter, publication, or presentation.  

Select “Add to project” in order to save the macro for a possible future re-run for further data extraction using the same parameters.  A “text search query” refers to any occurrence of any term within the defined search area; a “coding query” refers to any coded node or any coded attribute data.   

Click the selection in the dropdown, then go to the “Criteria” button to the right of the dropdown to input the desired search “string” (alphanumeric)  

The “Special” button to the right of the text field enables wildcard searches as well as Boolean-based ones (See “Data Query:  Text Search Query” for more information on “Special” features.)  Remember that wildcard searches enable some fuzziness in searching by the uses of characters to stand in for indefinition.  The character * (asterisk) enables any number of characters, and the character ? (question mark) enables any one character of any type in one location.  

Decide whether the match should be verbatim (exact) or potentially a synonym (which can change the search term entirely).  
Define whether the search should be conducted in Text, Annotations, or both Text and Annotations (the most inclusive or largest set).  

Click “OK.”  The original Compound Query Window will show.  

The next step is to define the relationship between the text in Subquery 1 and Subquery 2, to follow.  The relationship options are the following:  

  • AND 
  • OR 
  • AND NOT 
  • NEAR Content 
  • PRECEDING Content 
  • SURROUNDING Content 

The “AND” is an additive function and requires that the compound query search require both the presence of Subquery 1 and Subquery 2 strings.  The “OR” is an either-or function, which enables a source to be cited if the computer finds either Subquery 1 or Subquery 2 (or even both).  And “AND NOT” refers to Subquery 2, which suggests that the text desired is Subquery 1 disambiguated from including Subquery 2 (which is assumed to be a close meaning to Subquery 1 but not desired to be included in the search).  The “NEAR Content” is a proximity or "collocation" search, which suggests that the user wants Subquery 1 and Subquery 2 text particularly in the cases when the two are in proximity to each other.  The “PRECEDING Content” feature indicates that Subquery 1 text should appear before Subquery 2 text.  The “SURROUNDING Content” indicates the user’s desire to collect content at a particular node where it is surrounded by other coded content from another node.  (For more elaboration, view “Combine criteria in queries” and “Run a compound query.”) 

Click on the dropdown menu for Subquery 2.  Click into Criteria.  

Decide if Subquery 2 should be filtered by any particular user (by all who’ve coded or by selected users). Click OK once the parameters have been set.  

Finally decide where this search should be conducted:  in all sources, selected items, or items in selected folders.  

Under “Where,” decide if there should be further conditionals, such as where…

  • Created or Modified by Any User
  • Created by Selected Users 
  • Modified by Selected Users (or) 
  • Created or Modified by Selected users 

(Note:  The “created” by users means that an object was ingested, coded to, or written by the user.  The “modified” means that an object was revised or changed by the user.)  

Click “Run” at the bottom left corner of the Compound Query window.  

The status or progress bar shows the information being collated.  

Results of the Compound Query show in the detail view. 

The default view is the “Reference” view.  A Reference view is also available as well as a PDF view.  

The PDF view shows the original document and bookmarks within that PDF document.  

The summary tab at the right of the Detail View shows the identified document(s) from the search.  In this case, only one document was identified.  

To summarize, then, the basic sequence of decision-making in a compound query may be summarized as follows.  (Click on the Details button at the bottom right of the visual to expand the image.) 

Keeping a Macro of the Compound Query

Do document the parameters of the compound query...and keep a version of the query (or the "macro") in the Queries folder (it will be automatically placed in the Queries folder within the Queries source area in the Navigation View).  Keep the macro / script, so this can be run again as new data are acquired.  This will make it easier to describe the query in the Methods section of the research paper / presentation.  

Comment on this page

Discussion of "Data Query: Compound Query (Advanced)"

Add your voice to this discussion.

Checking your signed in status ...