You can use queries in NVivo to search your project materials in a range of different ways and for a variety of purposes, from searching for specific words or phrases or for frequently occurring words in order to inform your coding, to searching material that has been coded to combinations of codes or to codes for particular classification attributes in order to uncover patterns in the data.
This page looks at some examples of different queries, including ones utilising file and case classifications (as detailed in the Classifications page of this module). In order to follow some of the examples, you should make use of the Environmental Change Down East sample project (as detailed in NVivo sample projects).
A text search query is used to search project items and folders (for example all files, files in a specific folder, material coded to codes, etc.) for specific words and phrases.
To run a simple text search query, for example to search for the word ‘erosion’, do the following:
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 choose to either save the results as a new code (or merged with an existing code) or to save the query criteria (for future use), by selecting the ‘Save Results…’ or ‘Save Criteria…’ buttons respectively. For example, to save the query criteria of your most recent search do the following:
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, to run the previous query again but this time only for items classified as a ‘Reference’ with the Year attribute set to 2010, open the saved Erosion query criteria (located in the List View of Query Criteria) and do the following:
The search results will only include occurrences of the word ‘erosion’ in files of the type ‘Reference’ from the ‘Year’ 2010. You can then save these results as a code (if wished) as follows:
A word frequency query is used to determine the most frequently occurring words in various project items and folders, and to display them in different ways.
To run a word frequency query for project materials in the Interviews folder, for example, do the following:
The results of the word frequency query will then be displayed underneath in a series of tabs, two of which are as follows:
Note that you can remove a particular word from the search results, and therefore also from the word cloud, by selecting it in the Summary tab and then either right clicking and selecting ‘Add to Stop Words List’, or choosing this from the menu at the top of the screen. Either way, press ‘OK’ and then run the query again to the view the updated results.
If you want to keep a copy of your word frequency query you can choose to save the results in the Queries Results folder (in the ‘Queries’ group) by selecting the ‘Save Criteria…’ button and naming the query as appropriate.
Coding queries allow you to search content that has been coded, either to code(s) or case(s), according to specific combinations of codes, cases or attribute values. For example, if you are interested in knowing what males think about infrastructure in the sample project you would do the following:
The results of the coding query will then be displayed underneath in a series of tabs, as per a code. If you want to keep a copy of your coding query you can do so by choosing ‘Save Results…’ or ‘Save Criteria…’. In this case it would be appropriate to choose ‘Save Results…’ and to change the location to be a sub-code of the Infrastructure code (by clicking on ‘Select…’, clicking on the plus sign next to the Codes folder, selecting the Infrastructure code and pressing ‘OK’), so that the new code sits with the 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. For example, you can look at how much and what content has been coded at intersections of different codes, and at how much and what content has been coded for different cases for different codes. For example, you can compare positive and negative attitudes to four different issues in the sample project by finding which content has been coded at the intersection of different codes, as follows:
Once you have your matrix, to view the codings for each intersection (cell in the matrix) you can double click on it. You can also choose to colour code the matrix according to which intersections have the most and least coding by selecting the appropriate cell shading option from the ribbon, and can save the matrix by choosing ‘Save Results…’ or ‘Save Criteria…’
As with a matrix coding query, you can use a crosstab query to make comparisons and look for patterns in your data. While the two queries are very similar, and indeed can both be used in similar ways, a crosstab query is the best choice when you want to compare codes between different values for an attribute of a classification. For example, you can compare how often people from different townships responded to four different issues in the sample project as follows:
Once you have your table, to view the codings for each intersection (cell in the table) you can double click on it. You can also choose to colour code the table according to which intersections have the most and least coding by selecting the appropriate cell shading option from the ribbon, and can save the table by choosing ‘Save Results…’ or ‘Save Criteria…’