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

The Query Wizard steps you through the process of creating a new query. To create a query using the Wizard:

  1. On the Query tab, in the Create group, click Query Wizard.

  1. 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:

  • Enter the term or phrase that you want to find—click the Special button to combine multiple words with special characters and operators.

  • Look for exact words, or broaden your search—for example, also find words with the same stem and synonyms of the word.

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:

  • Limit the number of words—for example, find only the top 20 words.

  • Exclude small words—for example, find only words with four letters or more.

  • Count exact words or broaden your concept of a word—for example, count the word, words with the same stem and synonyms of the word together.

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:

  • 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 responses of Year 8 students, by finding content coded to nodes with the Year Level attribute equal to 8.

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

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:

  • Select thematic nodes as the rows and then select node attribute values male and female as the columns. The matrix created by the query will allow you to see whether the men and women you interviewed were concerned with different issues.

  • Select nodes representing particular government initiatives for the row, and then select node representing negative attitudes and positive attitudes as the columns. The matrix will allow you to see which initiatives were most negatively and positively perceived. You can then explore the coded material that represents the intersection of a row and column to review the negative comments made by the interviewee.

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.

Top of Page

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:

  1. On the Query tab, in the Create group, click the icon for the query you want to create.

  1. Set up the query as shown below:

 

a Use the Criteria tab to define the criteria for the query—what are you looking for and where do you want to look?

b (Optional) Select the Add To Project check box to save the query—this means you can easily run the query again. By default, queries are stored in the Queries folder. You can create your own folders for queries and organize them to suit your project.

c Use the General tab to name and describe the query if you choose to save it—this tab is only available when you select the Add to Project check box.

d (Optional) Use the Query Options tab to set options for your query results. For example, you might want to store the results in a node within your project, or spread coding to surround content. This tab is only available for Text Search, Coding, Compound and Matrix Coding queries.

e Click Run.

Refer to the following topics for detailed  information on creating different types of queries:

Run a Text Search query

Run a Compound query

Run a Word Frequency query

Run a Coding Comparison query

Run a Coding query

Run a Group query

Run a Matrix Coding query

 

Top of Page

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.

Top of Page

Delete a saved query

  1. In List View, select the query you want to delete.

  2. On the Home tab, in the Editing group, click Delete.

Top of Page

Edit the properties of a saved query

  1. In List View, select the query you want to edit.

  2. On the Home tab, in the Item group, click the Properties image.

The dialog box for the selected query opens.

  1. Change the query properties as required:

  • In the General tab, change the name or description.

  • In the Criteria tab, change the query criteria.

  • In the Query Options tab, change the results options—refer to Query options for more information.

  1. Click OK.

Top of Page

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.

  1. In the List View, click the query you want to re-run.

  2. On the Query tab, in the Actions group, click Run Query.

Top of Page

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.

  1. On the Query tab, in the Actions group, click Last Run Query.

The properties of the most recent query are displayed.

  1. Click Run.

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.

Top of Page