Create, edit and manage queries
This topic explains how to create queries in NVivo—either by using the Query Wizard or by defining the criteria yourself. You can save the queries that you create in NVivo and run them again as your project develops. For example, you could create a Coding query to gather all the material coded at global warming combined with carbon emissions—you could run this query again as the content coded at these nodes grows.
What do you want to do?
- Create a query using the Query Wizard
- Create a query outside the Wizard
- Cancel the execution of a query
- Delete a saved query
- Modify the criteria of a saved query
- Re-run a saved query
- Re-run the last query
Create a query using the Query Wizard
The Query Wizard steps you through the process of creating a new query. To create a query using the Wizard:
-
On the Query tab, in the Create group, click Query Wizard.
-
On the first screen of the Wizard, choose what you want to do (see below) and then follow the steps in the Wizard to create and run the query.
What do you want to do? | Description |
See where particular terms occur in content |
This is a Text Search query. When you create a Text Search query using the Wizard you can:
You can choose to search text in all your sources, or restrict the search to selected items or folders. Refer to Run a Text Search query for more information. |
Identify frequently occurring terms in content |
This is a Word Frequency query. When you create a Word Frequency query using the Wizard, you can:
You can choose to count words in all your sources, or restrict the count to words in selected items or folders. Refer to Run a Word Frequency query for more information. |
Search for content based on how it is coded |
This is a Coding query. When you create a Coding query using the Wizard, you can:
You can choose to look for coded content in all your sources, or restrict the query to selected items or folders. Refer to Run a Coding query for more information. |
Cross-tabulate how content is coded (NVivo Pro and Plus only) |
This is a Matrix Coding query. When you create a Matrix Coding query using the Wizard, you must choose what you want to show in the rows and columns of the matrix. Matrix Coding queries often show nodes in both the rows and columns, but you can also select sources, sets or Search Folders. You can select specific sources or nodes to show as the rows and columns or select content that particular attribute values or meets attribute value conditions (.e.g. age > 40). Here are some examples showing how you can use Matrix Coding queries:
You can choose to create the matrix based on coding in all your sources, or restrict the query to selected items or folders. Refer to Run a Matrix Coding query for more information. |
Create a query outside the Wizard
If you are familiar with NVivo queries (or want to use features that are not available in the Wizard), you can create queries outside the Wizard. Some types of queries cannot be created with the Wizard—for example, Compound and Coding Comparison queries.
To create a query outside the Wizard:
-
On the Query tab, in the Create group, click the icon for the query you want to create.
-
Define the criteria for your query. For detailed information on creating different types of queries, refer to the following topics:
|
-
Run the query. The results are displayed in Detail View.
NOTE: You can add the query to your project to run again. You can save the results of some queries—refer to Manage query results for more information.
Cancel the execution of a query
You can cancel a query if it is taking too long to run or you want to revise the criteria.
To cancel the query:
-
Click the red cancel button beside the progress bar that is displayed at the bottom of the window when the query is running.
Delete a saved query
-
In List View, select the query you want to delete.
-
On the Home tab, in the Editing group, click Delete.
Modify the criteria of a saved query
You can change the criteria of a saved query and then run it again.
-
Depending on the type of query, do one of the following:
-
Double-click the query to open it.
-
Open the query properties and go to the criteria tab.
-
Modify your criteria for the query.
-
Run the query.
NOTE: You can only view and edit criteria if the query is supported in your edition of NVivo. For more information refer to About queries (Working with queries across editions).
Re-run a saved query
When you set up and save a query, you can re-run it as your project progresses. For example, you might run the same coding query every month.
-
Do one of the following:
-
Double-click the query in List View, and then click the Run Query button at the top of Detail View.
-
Select the query in List View and then, on the Query tab, in the Actions group, click Run Query.
NOTE: You cannot run queries that include criteria not supported in your edition. For more information refer to About queries (Working with queries across editions).
Re-run the last query
You can open the most recent query (even though you may not have saved it in your project) and run it again.
-
On the Query tab, in the Actions group, click Last Run Query.
-
When the query opens in Detail View, do one of the following:
-
Click the Run Query button at the top of Detail View.
-
On the Query tab, in the Actions group, click Run Query.
NOTE You can only run the most recent query for the current session. If you close NVivo, the last run query is not available when you re-open the application.