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.
-
On the Explore tab, in the Query group, click Query Wizard.
The Query Wizard opens. Follow the steps on the Wizard.
Wizard step |
Description |
---|---|
Choose the query you want to run. |
Click Search for content based on how it is coded. |
Specify the terms you want to search for. |
|
Choose where you want to search. |
Choose whether you want to search text in all your files, or restrict the search to selected items or folders. |
Choose whether to add the query to your project. |
You can run the query once or choose to add it to your project (and run it). If you choose to add it to your project, you must enter a name. You can optionally enter a description. |
- Click Run.
- On the Explore tab, in the Query group, click Coding.
- Choose where you want
to search for matching text:
- Files and Externals—search for content in all the files and externals in your project
- Selected Items—restrict your search to selected items (for example, a set containing interview transcripts)
- Selected Folders—restrict your search to content in selected folders (for example, a folder of interview transcripts)
- By default, the query will look for content where All of the rows of criteria are met. Select Any if you want content that meets only some of your criteria.
- Define your criteria. You can find content that is coded at (or not coded at):
- All Selected Codes or Cases—find content that is coded at one or more nodes or cases you specify. For example, find content coded at the node economy, or you might choose to find content that has been coded at the nodes negative and natural environment—this option uses the AND operator. Click the button to select the node.
- Any Selected Code or Case—find content coded at any of the nodes or cases you specify. For example, find content that has been coded to any of the nodes habitat, forest or landscape—this option uses the OR operator. Click the button to select the nodes.
- Any Case Where—find content coded at cases with specific attribute values. For example, you could search for content coded at males aged 25-35. Click the button to select the attribute values.
- (Optional) In the Spread to list, define the spread coding options (amount of coding spread around the search word).
- Click the Run Query button at the top of Detail View.
You can create moe advanced coding queries to search for souce content that has been coded at multiple nodes—and use operators to further refine the search.
- On the Explore tab, in the Query group, click Coding.
- In the query panel, follow the steps to build the query criteria.
- Choose where you want
to search for coding
- Files and Externals—search for content in all the files and externals in your project
- Selected Items—restrict your search to selected items (for example, a set containing interview transcripts)
- Selected Folders—restrict your search to content in selected folders (for example, a folder of interview transcripts)
- By default, the query will look for content where All of the rows of criteria are met. Select Any if you want content that meets only some of your criteria.
- Define your criteria. You can find content that is coded at (or not coded at):
- All Selected Codes or Cases—find content that is coded at one or more nodes, sentiment nodes, relationships or cases that you specify. For example, find content coded at the node economy, or you might choose to find content that has been coded at the nodes negative and natural environment—this option uses the AND operator. Click the button to select the node.
- Any Selected Node—find content coded at any of the nodes, sentiment nodes, relationship or cases you specify. For example, find content that has been coded to any of the nodes habitat, forest or landscape—this option uses the OR operator. Click the button to select the nodes.
- Any Case Where—find content coded at cases with specific attribute values. For example, you could search for content coded at males aged 25-35. Click the button to select the attribute values.
- Click the down arrow on the button to build or manage your search criteria:
- Add group—add a new group of criteria rows beneath the current row.
- Add row—add a new criteria row beneath the current row.
- Coded by any—select coding done by any user or choose only the coding done by specific users. Click the button to select the users.
- Near—gather coded content that is near other coded content. Click the button to specify proximity.
- Move up and Move down—change the order of processing. Criteria at the top of the list are processed first.
- (Optional) In the Spread to list, define the spread coding options (amount of coding spread around the search word).
- Click the Run Query button at the top of Detail View.
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
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:
|
Is there a connection between rising sea temperatures and coral bleaching? |
Build a query where all of the following are true:
|
What memorable quotes have Henry or Wanda found about habitat or landscape ? |
Build a query where all of the following are true:
|
View the results
When you run a Coding query the results are shown as a preview in Detail View.
Click on the tabs displayed
- 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.
- Click the Save Results button at the top of Detail View.
- Next to Option, choose whether you want to create results as a new node or merge into an existing node.
- If you are creating a new node, enter a name and description.
- Click OK
NOTE By default new nodes are created in the Query Results folder, unless you choose another
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?