Queries


About Queries


Running a query is a great way to organize your data in different ways, explore different theories you have about your data, and find different patterns within your data.

There are 7 different types of queries that you can run on your data:

  1. Text Search Query
  2. Word Frequency Query
  3. Coding Query
  4. Martix Coding Query
  5. Compound Query
  6. Coding Comparison Query
  7. Group Query

 

General Query Instructions | General Tab | Criteria Tab | Options Tab

 

General Query Instructions

file

 

Select the "Query" section of the Navigation View -> Right-click in the List View -> Select “New Query” option -> Select the type of queries from the drop-down menu.

When you first open a query there will be two tabs. However, at the top of the query window you have the option of adding the query to your NVivo project, if you are unsure if this query will be useful to the overall project, you can leave this box unchecked and view as a preview.

In general this pop-up window will contain three tabs:

  • General = The query name and description. The "General" tab will only be visible if you select the "Add to Project" box located on the top ribbon of the pop-up window.
  • Criteria = The instructions for the query.  This section will differ for each different type of query.
  • Options = The desired organization for the results.

 

 

General Tab

file

 

Add to Project Option:


When you are setting up a Query, there will be an "Add to Project" option at the top of the pop-up window.  This is an important option because selecting it allows you to go back to the search and change any errors you might have made or alter the search to yield different results.

If you select this option the "General" tab will open and prompt you to give the query a name and description.  It is best for your description to be precise enough to remind you which values you used.  It will also help to ensure that you do not run the same query twice as well as help you decide how you may want to tweak the query in the future.

This option is particularly helpful if you are new to queries because it saves you from having to completely re-do your query if you made an error or wish to make a change.

 

file

 

Saving a Query:

If you choose to add the query to your project, you will be prompted to choose a location where you can find the node/set in the future. If you set up a "Query Output" node folder, it is a good idea to save the query here in order to separate what you have "mined" from the data via queries from what you have carefully extracted yourself (which should be located in the "Themes" node folder). You can also send it to the default folder, "Results", however queries located in this folder cannot be altered or edited.

If you are creating a new node or set, there is a space for the name of the query and the description. If you have chosen to check the “Add to project” box, you may want to copy and paste the same information you entered on the tab labeled “General”.

Once you have created a query you can find it again in the upper section of the Navigation View. If you had saved it to the "Results" folder and wish to edit it, the query can be moved from the “Results” via copying and pasting it into a different folder.

 

Criteria Tab

file

 

The Criteria Tab will be different for each type of query.  This is the section of the query set-up where you will set the parameters of your query.

*Some of the parameters will remain consistent across the board; instructions below.

 

Criteria Parameters:

  1. Set your search parameters by selecting the location you would like to "Search in": Text, Annotations, or Text and Annotations.
  2. Set the “Of” option by choosing to search in “All Sources”, “Selected Items”, or “Items in Selected Folders”. If you choose to look within select items click the "Select" button and check the appropriate box.
  3. Set the “Where” option in order to select which project user’s data to search within.

Options Tab

file

Results Option:

Choose to “Open results” and “Create results if empty”. Both these boxes will appear checked already and are good options unless you do not want to open the results right away. If you’d like to run the query later, you can find it again under the lower left-hand menu, under the heading “Query”. To run this query at a later date, simply right click and select “Run Query”.

You can chose to run your query as a “Preview Only” or choose:

  1. “Create Results as New Node”
  2. “Merge Results into Existing Node”
  3. “Create Results as New Set”
  4. “Add Results to Existing Set”
  5. “Create Results as New Node Hierarchy”

If you plan on adding the node/set to your project, it would be preferable to choose one of the later five options from the drop-down menu.

 

file

Coding Spread Option:


The next option under “Spread Coding” allows you to choose how much of the surrounding textual context you would like to include in the results.

Spread Options:

  1. “None” = This option will only code the word you are searching for.
  2. “Coding reference” = This option is only avaliable if you are coding using a node(s) as well. This option will find the text within certain nodes, and when it finds this match you can choose to code the reference area around it.
  3. “Narrow context” = This option codes 5 words surrounding the word, or 5 seconds of audio, or 5% of a source.
  4. “Broad context” = This option codes the entire paragraph, 20 seconds of audio, or 20% of a source.
  5. “Custom context” = If you choose this option you will be prompted to click the “Specify” option. This option will give you a great deal of freedom from choosing a certain number of words to accompany the results or if you are working with multimedia materials, how much audio will accompany the results or how much of a photograph will be highlighted. This is a great option for texts, media, transcripts, regions of PDFs, logs, and datasets.
  6. “Entire source” = This option will code the entire source.

If you choose a wide “Coding Spread” during this step you will end up with that word within its context. Keep in mind this may make the word more difficult to find. You can always right-click on the indiviual query results and change the “Context Spread” after the query is run to expand the context.

 



Text Search Query

 

A text search query will allow you to search for the occurrence of a certain word, word stem, or word meaning within your data.

 

file

Setting Up a Text Search Query:

1.  See General Query Instructions

2.  Criteria Tab: Type the word(s) or stem word(s) that you want to find in the “search for” box -> If desired, insert certain commands from the "Special" option's drop-down menu -> Set the slider to the search setting you desire.

 

More on the Slider:

  1. “Exact Match Only” = which will find only the words that exactly match the search word in question.
  2. “Including Stemmed Words” = which will find the search word in question and any words with the same stem as that word.
  3. “Including Synonyms” = which will find any synonyms of the search word.
  4. “Including Specializations” = which will find the word and the different types of that word. For instance, if the word is 'fish', words such as 'salmon' and 'haddock' will also be found.
  5. “Including Generalizations” = which will find the hierarchy of the search word as well. For instance, if the word is 'deer', words such as 'animal' and 'mammal' will be found.

The slider is all-inclusive and will pick up everything to the left as well as the level you have set the slider at. The further from “exact match” you set this slider, the wider your search results will be.

Depending upon the words that you wish to search, you may not be able to use the slider on all the settings. If this occurs NVivo will prompt you to make changes, simply adjust as necessary.


3. Set the appropriate Criteria Parameters.

4.  See the Options Tab.

5. Click "Run".



Word Frequency Query

 

A Word Frequency Query will allow you to search either all your sources or certain selected sources for the most commonly appearing terms.  This query can help you see what sort of words are appearing most in your data and may give you ideas as to what subjects may be coming up more often that others. and may therefore be worth looking into further.

 

file

Setting Up a Word Frequency Query:

1.  See General Query Instructions

2.  Criteria Tab: In the "Finding Matches" section select from the options on the slider -> Select the appropriate Criteria Parameters -> Finally set the "Display Words" to indicate how many words you want on your frequency list (all or a number) and the shortest length of those words.

More on the Slider:

  1. "Exact" = which will only count words that match each other exactly.
  2. "Including Stemmed Words" = which will count the exact word and any words that share the same stem.
  3. "Including Synonyms" = which will count the exact word, stemmed words, and synonyms of that word.
  4. "Including Specializations" = in which different types of the word will be included in the count, for instance if the word is 'fish', words such as 'salmon' and 'haddock' will be included.
  5. "Including Generalizations" = in which the hierarchy of the word will be included in the count, for instance if the word is 'deer', words such as 'animal' and 'mammal' will be included.

The slider is all-inclusive and will pick up everything to the left as well as the level you have set the slider at. The further from "exact match" you set this slider, the wider your search results will be.

3.  Click "Run".



Coding Query

 

There are two basic types of Coding Queries you can run, a "Simple" one and an "Advanced" one. A "Simple Coding Query" will allow you to choose one node or one node where there is a certain attribute, and the query will pull up all the sources that have nodes that meet that description. An "Advanced Coding Query" will allow you to search for overlaps in certain, selected nodes. For instance you can search for the intersection of “memorable quotes” AND “landscape” OR “environment”.

 

file

Setting Up a Coding Query:

1.  See General Query Instructions.

2. Criteria Tab:

  • For a "Simple Coding Query" select the "Simple" tab -> Select to either search for content at "Node" or at "Any Node Where Attribute" -> Select the appropriate Criteria Parameters.
  • For an "Advanced Coding Query" select the "Advanced" tab -> This option will allow you to compare more than one node by adding them into the "content box" -> To add items to this list select "Coded At" or "Not Coded At" -> Choose "All Selected Nodes" or "Any Selected Nodes" ("All" is a synonym for intersection and this option will only include items that have been coded at "all" the nodes you specify, whereas "Any" will include items coded at any of the nodes you specify) -> Click "Select" and choose the nodes you wish to specify -> Check the box of the nodes -> Select "OK" -> Select "Add to List" -> Select the appropriate Criteria Parameters.

3. See Options Tab.

4. Click "Run".

 

 



Matrix Coding Query

 

A Matrix Coding query will allow you to create a chart with either singular or multiple nodes on each axis. This chart can help to show patterns and overlaps in your data.

 

file

Setting Up a Matrix Coding Query:

1.  See General Query Instructions.

2.  Criteria Tab: Here you will set up the rows and columns of your chart -> Begin with “Rows” -> Under the heading “Define more rows” you can set two options. The defaults that are automatically chosen (“Selected Items” and “By Any User”) will search within data of your project, so unless you have multiple users on one project and only wish to use the data of a particular user(s) or want to use a nicknamed node you do not need to change these default options -> Click “Select” -> From the new window choose to compare any of your data. For instance if you are looking to compare nodes click on “nodes”, in the right hand side of the window all of your nodes and their hierarchies will appear. If you want every node in a certain hierarchy to be chosen, you may click the box at the top of the window “automatically choose hierarchy” -> Choose one or more nodes that you want to see in the row(s) of your chart -> Click “Okay”, this will bring you back to the previous window -> Choose “Add To List”.

3. Choose the second tab for “Columns” -> Repeat the process for the values you would like to see in the column(s) of your chart.

file

4. Under the third tab, “Matrix”, you may change how the data is presented to you. If you simply wish to view the nodes frequency (such as a certain word over time) you would want to leave it at “And”, but other options on that drop-down menu will offer different results. For instance, “near content” will allow you to see how often two nodes occur in near proximity to one another. Some of these options will allow you to further specify your search by clicking on the “options” button to the right, whereas others will not. Also on this page you will be able to change the layout of your chart by either lumping nodes together or keeping them separated.

5. Select the appropriate Criteria Parameters.

6.  See Options Tab.

7. Click “Run”.



Compound Query

 

There are three main uses for a Compound Query:

  1. In order to combine a Coding Query with a Text Search Query.
  2. In order to run two Text Search Queries, enabling you to search for two words that occur within the same paragraph/source/or other specified contextual area.
  3. In order to run two Coding Queries.

 

file

Setting Up a Compound Query:

1. See General Query Instructions.

2. Criteria Tab: For "Subquery 1" and "Subquery 2" select either Text Search Query or Coding Query from the drop-down menu -> Select "Criteria" and follow the Criteria Instructions for either Text Search Query or Coding Query -> In the option between the two subqueries select either:

  • "AND" = To consider items that are in both Subquery 1 and Subquery 2.
  • "OR" = To consider items that are in either Subquery 1 or Subquery 2.
  • "AND NOT" = To consider items that are in Subquery 1, but not Subquery 2.
  • "NEAR Content" = To consider coded content in Subquery 1 that is near to coded content in Subquery 2. You will have to add additional specifications by selecting "Options" and setting your desired proximity parameters.
  • "PRECEDING Content" = To consider coded content in Subquery 1 that precedes coded content in Subquery 2. You will have to add additional specifications by selecting "Options" and setting your desired proximity parameters.
  • "SURROUNDING Content = To consider coded content in Subquery 1 that surrounds the coded content in Subquery 2.

3. Select the appropriate Criteria Parameters.

4. See Options Tab.

5. Select "Run".



Coding Comparison Query

 

A Coding Comparison Query is only useful if more than one person is coding within the same NVivo project. Running a Coding Comparison will literally compare the coding of two different users or two different groups of users, it can help you to determine the degree of agreement between the two different coders/groups of coders.

 

file

Setting Up a Coding Comparison Query:

1. See General Query Instructions.

2. Criteria Tab: In order to compare the coding of two different users click "Select" for the "User Group A" -> Check the box preceding one of the users or groups of users you wish to compare -> Select "OK" -> Click "Select" for the "User Group B" -> Check the box preceding the other user or group of users you wish to compare -> Select "OK" -> Select the appropriate Criteria Parameters.

3. Select "Run".

 

Understanding the Coding Comparison Results:

The results will appear in a spreadsheet form in the Detail View.

  1. Node containing the coding that is being compared.
  2. The source name and the source folder location.
  3. The source size.
  4. The Kappa Coefficient (You will have had to check the Kappa Coefficient option when setting up the query): If (K)=1 it means both users/groups of users are in complete agreement. If (K)≤0 it means there is no agreement that is more than chance.
  5. Green Columns: Show percent agreement. The "Agreement Column" represents the sum of "Column A & B" (which is the percentage of data coded to the selected node by both users) and "Column Not A & Not B" (which is the percentage of data coded to the selected node by neither user).
  6. Red Columns: Show percent disagreement. The "Disagreement Column" represents the sum of "Column A and Not B" (which is the percentage of data coded to the selected node by user A, but not by user B) and "Column B and Not A" (which is the percentage of data coded to the selected node by user B, but not user A).


Group Query

 

A Group Query is useful for discovering how certain project items are associated to other project items. For instance, you can run a query on interviews in which a certain node (like water quality) was used.

Types of Associations:

  1. Items Coding = A group query that will allow you to search and compare the nodes that different items have been coded at.
  2. Items Coded At = A group query that will allow you to search for items coded at specific nodes.
  3. Items by Attribute Value = A group query that will allow you to search for project items that have specific attribute values.
  4. Relationships = A group query that will allow you to search your relationships for a certain term, such as "water quality".
  5. See Also Links = A group query that will allow you to search for See Also Links within selected locations of your project.
  6. Model Items = A group query that will give you a list of all the project items that are included in a certain model.
  7. Models = A group query that will allow you to search for models that include certain items.

 

file

 

Setting Up a Group Query:

1. See General Query Instructions.

2. Criteria Tab: Select which type of association you would like to "Look For" from the drop-down menu (items coding, items coded at, items by attribute value, relationships, see also links, model items, or models) -> Set the "Scope" (all sources, selected items, selected folders) -> Set the "Range" (all sources etc., selected items, selected folders).

*For any selected items/folders you will have to click "Select" -> Check the boxes preceding the items/folders you wish to consider -> Select "OK".

3. Select "Run".

 



Results

 

Unless you indicate otherwise when you create a query, the query results will end up in the “Results” folder. Queries that are in the results folder cannot be edited or altered; they are static. However, you can move the query from this folder by copying and pasting into a different folder such as nodes.