Run a 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. This topic explains how you can create Coding queries and what you can do with the results of the query.
What do you want to do?
- Understand Coding queries
- Create a Coding query using the Wizard
- Create a Simple Coding query outside the Wizard
- Create an Advanced Coding query
- Understand the results
- View examples of Coding query criteria
- Save the preview results as a node
- Make a set of the sources in your results
- Use a Compound query to refine your Coding query
Understand Coding queries
You can use Coding queries to find content coded at selected nodes, a combination of nodes, or nodes with particular attribute values. For example, 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 nodes 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, gather content coded at coral bleaching where it overlaps with content coded at rising sea temperatures.
-
Search for content that is not coded at a specific node—find content coded at solar power but not coded at alternative energy.
NOTE 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 source content at the node rising sea levels and at nodes with the attribute fishery employee.
Create a Coding query using the Wizard
-
On the Query tab, in the Create group, click Query Wizard.
The Query Wizard opens.
-
Click Search for content based on how it is coded, and then click Next.
-
On Step 2 of the Wizard, you can choose to do any of the following:
-
Find content that is coded at a particular node that you specify—for example, find content coded at the node economy .
-
Find content coded to all the nodes that you specify—for example, find content that has been coded at the nodes negative and natural environment.
-
Find content coded at any of the nodes you specify—for example, find content that has been coded to any of the nodes habitat, forest or landscape.
-
Find content coded at any node with particular attribute values—for example, if you have coded content to case nodes, you could find all the response of Year 8 students, by finding content coded to nodes with the Year Level attribute equal to 8.
-
On Step 3 of the Wizard, choose whether you want to look for coded content in all your sources, or restrict the query to selected items or folders.
-
On Step 4 of the Wizard, choose whether you want to run the query just once or 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.
The query is executed and the results are displayed in Detail View.
NOTE If you want to use Coding query features that are not available via the Wizard—for example, find coded content in proximity to content coded at other nodes—you must create the query outside the Wizard. Refer to Create an Advanced Coding query for more information.
Create a Simple Coding query outside the Wizard
To see what has been coded at a node, you can simply open the node (double-click in List View). You can use a simple coding query to see content coded at a node limited by a specific scope—for example, you could find all content coded at coastal habitat in the Government Reports folder.
If you are not familiar with NVivo queries, you may want to create your coding 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 Coding queries outside the Wizard, as described below:
-
On the Query tab, in the Create group, click Coding.
The Coding query dialog box opens with the Simple tab in focus.
-
Under Search for content coded at select:
-
Node to search for content coded at specific node—click the Select button to select the node,
-
Any node where to search for content coded at classified nodes with specific attribute values—click the Select button to select the attribute values. For example, you could search for content coded at males aged 25-35.
-
To find content coded by a specific user, select By Any Selected Users—click the Select button to select the user.
-
To change the scope of the query:
-
In the In box, select which project items you want to include in the search—click the Select button to choose specific project items.
-
In the Where box, limit the scope of the query by the users who created or modified the items—click the Select button to select the users.
-
Click Run.
NOTE
-
To save the Coding query, select the Add to Project check box and enter the name and description (optional) in the General tab.
-
Click the Query Options tab to define the spread coding options (amount of coding spread around the search word). Refer to Spread coding for more information.
-
The Query Options tab also allows you 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. Refer to Query options for detailed information.
Create an Advanced Coding query
You can use Advanced Coding queries to search for source content that has been coded at multiple nodes—and you can use operators to further refine the search.
If you are not familiar with NVivo queries, you may want to create your coding 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 Coding queries outside the Wizard, as described below.
To run an Advanced Coding query:
-
On the Query tab, in the Create group, click Coding.
The Coding query dialog box opens.
-
Click the Advanced tab.
-
In the Define more criteria box follow the steps to build the query criteria:
a Select whether you are looking for content Coded at or Not Coded at the selected nodes.
b Select whether you are looking for content coded at all or any of the selected nodes. You can also look for content coded at any classified node with a specific attribute value. Click the Select button to choose the nodes or attribute values.
c (Optional) From the list, select coding done by any user or choose only the coding done by specific users—click the Select button to choose the users.
d Click the Add to List button. The criteria is added to the Search for content matching these criteria list.
e To combine multiple criteria, choose an option from the list and follow steps a to d.
-
(Optional) Edit the criteria list in the Search for content matching these criteria box:
-
To change the order of processing, select an item from the criteria list and click the required arrow button.
-
To remove an item in the criteria list, select the item and then click Clear.
-
To edit an item in the criteria list, select the item, click Remove. The item is removed from the list and is available for edit in the Define more criteria box. Edit the required criteria, and then click Add to list.
-
(Optional) To change the default scope for the query:
-
From the In list, select the items you want to include in the query. For example, search all sources or selected nodes.
-
From the Where list, you can specify to search project items created and/or modified by any or selected users.
-
Click Run.
NOTE
-
To save the Coding query, select the Add to Project check box and enter the name and description (optional) in the General tab.
-
Click the Query Options tab to define the spread coding options (amount of coding spread around the search word). Refer to Spread coding for more information.
-
The Query Options tab also allows you 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. Refer to Query options for detailed information.
Understand the results
By default, the results of a Coding query are displayed as a node in Detail View—the Reference tab is in focus:
Click the tabs on the right to see the content that has been coded in text (documents, memos and externals), PDF, audio, video, picture or dataset sources.
By default the results are displayed in a preview node—you can choose to save this node in the Results folder or in another node folder, refer to Save the preview results as a node for more information.
NOTE
-
If you prefer nodes to open with the Summary tab in focus, you can change the setting in Application Options.
-
If you include an 'aggregate' node in the scope of a query, content coded at the node and all its direct children will be included in the query results—refer to Aggregate nodes for more information.
View examples of Coding query criteria
The following examples show how you can build query criteria to answer specific questions:
-
What do fishery employees say about rising sea levels?
Search for content matching these criteria: |
Content Coded At rising sea level AND Coded at any node
where
|
-
Is there a connection between rising sea temperatures and coral bleaching?
Search for content matching these criteria: |
Content Coded At rising sea temperatures NEAR Content Coded at coral bleaching
|
Refer to Combine criteria in queries for more information.
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.
To save the references as a node:
-
Click on the query results in Detail View.
-
On the Query tab, in the Actions group, click Store Query Results.
The Store Query Results dialog box opens.
-
From the Option list, choose what you want to do with the results. You can:
-
Create the results as a new node
-
Merge the results into an existing node (you must select the node to merge into)
-
Create a node hierarchy where the references from each source are in a separate child node
-
If you are creating a new node, enter a name and description.
-
Click OK.
NOTE
-
By default new nodes are created in the Results folder, unless you choose another location. Refer to Manage query results (Understand the Results Folder), for more information.
-
If you save the results as a node hierarchy, relevant content from each source is coded to a separate node, under a parent node.
-
You can choose how you want to store the results before you run the query—by setting your preferences on the Query Options tab in the query properties.
Make a set of the sources in your results
You create a set from the results of a Coding query—the set members are the sources displayed on the Summary tab in the query results in Detail View.
Saving the sources to a set gathers them together for further analysis. For example, if you are researching community health policies, you might want to find all the sources that have been coded to the nodes hospital or outpatient, and then save the sources to a set for further exploration and analysis.
To save the results to set:
-
Click in the query result in Detail View.
-
On the Query tab, in the Actions group, click Store Query Results.
The Store Query Results dialog box opens.
-
From the Option list, choose whether you want to create a new set or add the sources to an existing set.
-
If you are creating a new set, enter a name and description.
-
Click OK.
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?