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.
-
On the Explore tab, 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, click Queries / 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 to (or not coded to):
- All Selected Codes or Cases—find content that is coded to one or more codes or cases you specify. For example, find content coded to the code economy, or you might choose to find content that has been coded to the codes negative and natural environment—this option uses the AND operator. Click the button to select the code.
- Any Selected Code or Case—find content coded to any of the codes or cases you specify. For example, find content that has been coded to any of the codes habitat, environmental change or landscape—this option uses the OR operator. Click the button to select the codes.
- Any Case Where—find content coded to cases with specific attribute values. For example, you could search for content coded to males aged 30-39. 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 more advanced coding queries to search for source content that has been coded to multiple codes—and use operators to further refine the search.
- On the Explore tab, click Queries / 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 to (or not coded to):
- All Selected Codes or Cases—find content that is coded to one or more codes, sentiment codes, relationships or cases that you specify. For example, find content coded to the code economy, or you might choose to find content that has been coded to the codes negative and natural environment—this option uses the AND operator. Click the button to select the code.
- Any Selected Code or Case—find content coded to any of the codes, sentiment codes, relationship or cases you specify. For example, find content that has been coded to any of the codes habitat, environmental change or landscape—this option uses the OR operator. Click the button to select the codes.
- Any Case Where—find content coded to cases with specific attribute values. For example, you could search for content coded to males aged 30-39. 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 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
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:
|
Is there a connection between Environmental change and Fishing industry decline? |
Build a query where all of the following are true:
|
What Real estate development data have Henry or Wanda found about habitator 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 the 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 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.
- Click the Save Results button at the top of Detail View.
- Next to Option, choose whether you want to create results as a new code or merge into an existing code.
- If you are creating a new code, enter a name and description.
- Click OK
NOTE By default new codes 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 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.