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 to a code, double-click it in the List View to open it. You can use coding queries to find content coded to selected codes, a combination of codes, or cases with particular attribute values.

You could use a coding query to:

  • Gather material coded to combinations of codes—for example, gather content coded to water quality and negative and explore the associations.
  • Gather material from cases with specific attribute values—for example, what do people from Straits town say about fishing or aquaculture?
  • Search for content coded to multiple codes and use operators to further refine the query—for example, what negative things that people aged 30-39 say about fishing or aquaculture?
  • Search for content that is not coded to a specific code—find content coded to renewable energy but not coded to environmental change.

A coding query will only find content that has been coded. For example, if you ask the question what do commercial fishers say about fishing industry decline?—make sure you have coded content to the code fishing industry decline and to cases with the attribute value Yes for the attribute commercial fishing.

Create a coding query

If you are not familiar with NVivo queries the Query Wizard can help guide you. Note, however, that the Query Wizard does not include all the options for all queries.

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

NOTES

  • To save query settings so you can run a query again later, click Save Criteria. Name the query criteria file and optionally add a description. The file is saved under Queries / Query Criteria in the Navigation View.
  • Use the Save Results button to set your preferences for storing the results—for example, you might want to store the results as a code 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 commercial fishers say about fishing industry decline?

Build a query where all of the following are true:

  • Content coded to the selected code fishing industry decline
  • Content coded to any case where the case classification for Person:Commercial Fishing = Yes

Is there a connection between Environmental change and Fishing industry decline?

Build a query where all of the following are true:

  • Content coded to Environmental change
  • Near all overlapping content coded to Fishing industry decline

What Real estate development data have Henry or Wanda found about habitator landscape?

Build a query where all of the following are true:

  • Content coded to Real estate development
  • Content coded to 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 the 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 code

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

The code 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 code, rather than create them as a new code.

  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 code or merge into an existing code.
  3. If you are creating a new code, enter a name and description.
  4. Click OK

NOTE  By default new codes 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 Compound query to further refine a coding query, for example you could:

  • Combine two coding queries to find content coded to Code A when it precedes content coded to Code B.
  • Combine a coding query with a text search to find text in relation to coding—Find content that contains the term zoning AND coded to Policy, Management with coding spread to – broad context.