You can use queries in NVivo to search your project materials in a range of different ways and for different purposes. For example, you can search for specific words or phrases, or find frequently occurring words, to help inform your coding. You can also search for material that has been coded to combinations of codes or to codes for particular classification attributes, which can help you identify patterns in your data. This page looks at some examples of different queries.
In brief, it covers the following:
To follow the examples on this page, use the Environmental Change Down East sample project (as detailed in the Sample projects page).
A text search query allows you to search project items and folders for specific words and phrases. For example, you can search all files, files in a particular folder, or material that has been coded to particular codes.
To run a simple text search query, for example to search for the word ‘erosion’, follow these steps:

The results of the text search query will then be displayed underneath in a series of tabs:
If you want to keep a copy of your text search query, you can save the results as a new code (or merge them with an existing code), or you can save the query criteria for future use. Select the ‘Save Results…’ or ‘Save Criteria…’ button respectively.
For example, to save the query criteria from your most recent search, follow these steps:
You can also filter a text search query according to a particular file classification type or types, or according to a particular attribute of a file classification. For example, you can run the previous query again but limit the search to items classified as a ‘Reference’ with the Year attribute set to 2010. To do this, open the saved Erosion query criteria (located in the List View of Query Criteria) and follow these steps:
The search results will only include occurrences of the word ‘erosion’ in files classified as ‘Reference’ with the Year attribute set to ‘2010’. You can then save these results as a code, if you wish, as follows:
A word frequency query allows you to find the most frequently occurring words in different project items and folders, and display the results in different ways.
To run a word frequency query for project materials in the Interviews folder, for example, follow these steps:
The results of the word frequency query will then be displayed underneath in a series of tabs, including the following:
You can remove a particular word from the search results, and therefore also from the word cloud, by selecting it in the Summary tab. Then either right click and select ‘Add to Stop Words List’, or choose this option from the menu at the top of the screen. Select ‘OK’, then run the query again to view the updated results.
If you want to keep a copy of your word frequency query, you can save the query criteria in the Query Results folder (in the ‘Queries’ group) by selecting the ‘Save Criteria…’ button and giving the query an appropriate name.
Coding queries allow you to search content that has been coded to code(s) or case(s), using specific combinations of codes, cases or attribute values. For example, if you want to find out what males think about infrastructure in the sample project, follow these steps:

The results of the coding query will then be displayed underneath in a series of tabs, as they are for a code. If you want to keep a copy of your coding query, you can choose either ‘Save Results…’ or ‘Save Criteria…’.
For this example, it would be appropriate to select ‘Save Results…’ and save the results as a sub-code of the Infrastructure code. To do this, click ‘Select…’, click on the plus sign next to the Codes folder, select the Infrastructure code and select ‘OK’. The new code will then be stored with your existing codes as a sub-code of the Infrastructure code.
You can use matrix coding queries to make comparisons and look for patterns in your data. They allow you to compare how much and what content has been coded at the intersections of different codes, or for different cases and codes. For example, you can compare positive and negative attitudes towards four different issues in the sample project by finding content that has been coded at the intersection of these codes. To do this, follow these steps:
Once the matrix has been created, you can double click on any intersection (cell) to view the content that has been coded there. You can also use the appropriate cell shading option on the ribbon to colour the matrix according to which intersections have the most and least coding. To keep a copy of the matrix, choose ‘Save Results…’ or ‘Save Criteria…’.
Like a matrix coding query, a crosstab query allows you to make comparisons and look for patterns in your data. The two types of queries are very similar and can be used in similar ways. However, a crosstab query is particularly useful when you want to compare codes across different values of a classification attribute. For example, you can compare how often people from different townships responded to four different issues in the sample project as follows:
Once the table has been created, you can double click on any intersection (cell) to view the content that has been coded there. You can also use the appropriate cell shading option on the ribbon to colour the table according to which intersections have the most and least coding. To keep a copy of the table, choose ‘Save Results…’ or ‘Save Criteria…’.