Queries > Coding query

Coding query

Coding queries can help you to test ideas, explore patterns and see the connections between the themes, topics, people and places in your project.

To see what has been coded at a node, you can simply open the node (double-click in List View). You can use Coding queries to find content coded at selected nodes, a combination of nodes, or cases with particular attribute values.

You could use a Coding query to:

  • Gather material coded at combinations of nodes—for example, gather content coded at green policy and conservative government and explore the associations.
  • Gather material from cases with specific attribute values—for example, what do young farmers say about alternative energy?
  • Search for content coded at multiple nodes and use operators to further refine the query—for example, what do young farmers say about alternative energy?
  • Search for content that is not coded at a specific node—find content coded at solar power but not coded at alternative energy.

A Coding query will only find content that has been coded. For example, if you ask the question what do fishery employees say about rising sea levels?—make sure you have coded content at the node rising sea levels and at nodes with the attribute fishery employee.

Create a Coding query

If you are not familiar with NVivo queries, you may want to create your query using the Wizard—the Wizard guides you through the process of setting your query criteria. However, not all query features are available in the Wizard, so you may sometimes want to create your query outside the Wizard.

When the query has finished running, the results are displayed as a temporary preview in Detail View.

NOTES

  • To save the query, click the Add to Project button and enter the name and description (optional).
  • Use the Save Results button to set your preferences for storing the results—for example, you might want to store the results as a node when you run the query.

Examples of Coding query criteria

The following examples show how you can build advanced query criteria to answer specific questions:

To answer the question

Do this

What do fishery employees say about rising sea levels?

Build a query where all of the following are true:

  • Content coded at the selected node Rising sea levels
  • Content coded at any case where the case classification for Person:Occupation = fishery employee

Is there a connection between rising sea temperatures and coral bleaching?

Build a query where all of the following are true:

  • Content coded at Rising sea temperatures
  • Near all overlapping content coded at Coral bleaching

What memorable quotes have Henry or Wanda found about habitat or landscape ?

Build a query where all of the following are true:

  • Content coded at Memorable quotes
  • Content coded at Habitat or Landscape
  • Content coded by Henry or Wanda

View the results

When you run a Coding query the results are shown as a preview in Detail View.

Click on the tabs displayed on the right to see different views of the results.

  • Summary lists the files that contain the content that matches the query criteria.
  • Reference displays the content that was returned by the query.

Other tabs may be visible depending on the file types that are included in the results.

Save the preview results as a node

If your query has returned interesting content, you may want to save it as a node, so that you can explore it further. For example, you might find all the content coded at both the nodes water quality and the node development. You can save the results to a new node that holds your evidence that Development negatively impacts water quality.

The node will contain the content displayed on the Reference tab in the query results in Detail View. If you repeatedly run the same query, you may want to merge the references into an existing node, rather than create them as a new node.

  1. Click the Save Results button at the top of Detail View.
  2. Next to Option, choose whether you want to create results as a new node or merge into an existing node.
  3. If you are creating a new node, enter a name and description.
  4. Click OK

NOTE  By default new nodes are created in the Query Results folder, unless you choose another location.

Use a Compound query to refine your Coding query

You can use a Compound Query to further refine a Coding query, for example you could:

  • Combine two Coding queries to find content coded at Node A when it precedes content coded at Node B.
  • Combine a Coding query with a Text Search query to find text in relation to coding—where young women talk about climate change, do they use the word pessimistic?