Combine criteria in queries
This feature is available in NVivo Pro and Plus editions. Learn more
You can use special operators to combine multiple criteria in Coding, Compound or Matrix Coding queries. For example, you can search for content coded at erosion NEAR content coded at salinity.
In this topic
- Understand the special operators used to combine criteria
- Set proximity for near and preceding options
- Specify the content that you want to retrieve
Understand the special operators used to combine criteria
When you setup a Coding, Compound or Matrix Coding query outside the Wizard, you can combine criteria using the following special operators:
Operator | Description | Example |
AND |
Gathers content that matches both criteria. |
Gather content that is coded at fisheries (A) AND water quality (B) |
OR |
Gather content that matches either of the criteria |
Gather content coded at erosion (A) or land degradation (B). |
NOT |
Gather content that is coded at one node but not at another |
Gather content coded at rising sea temperatures (A) but NOT coded at coral bleaching (B). |
NEAR Content |
Gather coded content that is near other coded content. |
Gather content coded at the node coral beaching within 20 words of content coded at the node rising sea temperatures. |
PRECEDING Content |
Gather coded content that precedes other coded content. |
Gather content coded at the node water quality where it precedes content coded at the node contaminants . |
SURROUNDING Content |
Gather coded content that surrounds other coded content. |
Gather content at the node solar power where it is surrounded by content at the node alternative energy. |
Set proximity for near and preceding options
When you choose the NEAR or PRECEDING operators, you can define the proximity as one of the following:
- Overlapping—when coding at both nodes overlaps.
- In Custom Context—within a specified number of words, surrounding paragraph/cell/row, minutes or percentage. Refer to Narrow, broad and custom reach settings for more information.
- In Same Scope Item—within the same item, such as the same document or dataset.
- In Same Coding Reference—within the same coding reference (only available when nodes are included in the query scope).
Specify the content that you want to retrieve
When you combine criteria in a query you can choose how much content you want to gather in the resulting node—for example, if you search for salinity NEAR water quality, you could choose to gather the content related to salinity but not the content about water quality. When you setup the query you can choose:
-
Finds for first search item Select this option to gather content matching the criteria defined for the first search item.
-
Finds for second search item Select this option to display content matching the criteria of the second search item.
-
Content between finds Select this option to display content between the first and second search items. This option is only available if both of the above check boxes are selected and Overlapping is not the chosen Proximity option.
-
Compare proximity between text and non-text items Select this option to gather content from different components of an audio/video or picture source. For example, when gathering content coded at climate change NEAR content coded greenhouse gas—you can choose to query both the video and the video transcript. If you do not select this check box, the query will evaluate proximity within the same type of content (either text or media).