Working with Codes

  1. Before we work some more with Codes, create two more codes called “Energy Efficiency” and “Water Consumption”.

  2. Next, code at least 5 small text fragments to each new code.

  3. You can see now there are useful counts associated with our codes to see how many files have content that has been coded in that code, and how many text snippets or references have been coded into that code.

    Codes list open and highlighted with the two new codes.

  4. You will notice that all of our codes are top-level or parent codes, meaning we haven’t established a hierarchy, none of our codes are nested under other codes. NVivo can help you organize your codes in a hierarchical structure. You are often, in the end, trying to create a hierarchical codes list to group common codes together into broader categories and themes to help make sense of your coding. Create a new code and call it Sustainability.

    Code properties for a new code with the name field completed with Sustainability and Done highlighted.

  5. You could use this code to group some of your existing codes. Drag Energy Efficiency and Water Consumption onto the Sustainability code (First click on a code to highlight, wait a moment, then drag it on).

    Energy Efficiency and Water Consumption Nodes selected, with arrows pointing to the Sustainability code.

  6. Now you can see that they are grouped beneath. Codes grouped beneath another code are called Child Codes.

    Red box around the sustainability code with the two codes nested under it.

  7. You can use Sustainability as its own broader code now in coding, or just keep it as a heading in the hierarchy. If you double click on Sustainability, you should see an empty window pop up as there are no references coded to that Code right now.

    The Sustainability code opened, with no references.

  8. Hold down the Control key and click on Sustainability and select Get Info.

    Context menu for the Sustainability code with a red box around get Info.

  9. Click the box next to Aggregate coding from children. Then click OK.
    Code properties for the Sustainability Code, with Aggregate coding for children box outlined and checked.

  10. Now you will see all the references to it, plus its children codes, show up in the window that should be still open. You will need to decide how to want to handle your code hierarchies in terms of this aggregation for your own projects. In some cases, this is very useful, but it may affect queries where references are double counted for the parent and the child. We will talk more about queries later in the tutorial.

    The Sustainability code opened, with all the references from child codes visible.

  11. In the window with all the Sustainability references, highlight all the text. A quick way to do this is to click anywhere in that window and press the Command key and A on your keyboard at the same time to select all.

    The Sustainability code opened, with all the references selected.

  12. Then go to the View menu from the top menu bar, and select Coding Context, and then select Broad.

    View menu drop down is selected, followed by coding context and broad

  13. You will see that the references have changed. There is grey text that isn’t coded, but comes directly before or after the coded text to give you more context for what you have coded. This is useful when examining small snippets of coded text. You can apply this Broad context (or explore the other options in the menu) any time you are presented with a list of references.

    Please note that under the Home tab within the program, there is the option to select ‘broad’ under Spread Coding. This is not the same function. While selecting broad under Coding Context will display the context of your code, selecting broad under Spread Coding will instead add the surrounding context to your original code.

    The Sustainability code opened, with grey text above and below each reference. One example outlined in red.

  14. Close the window for now by clicking on Close “Sustainability” in the View drop-down menu.

    Within the view tab from the mac menu bar, Close Sustainability is selected.

  15. Another way to get a better idea of how your files are coded is to use coding stripes and highlighting. First, go to your interviews folder. You can see how many codes have been applied to the content and how many references in the document have been coded.

    In the interviews folder, the codes and references columns are outlined.

  16. Double click on an interview that has some coded references.

  17. At the top of the selected file tab, from the Coding Stripes drop-down menu, select All. Then go back into the Coding Stripes drop-down menu again and select Automatic Colors.

    Under the selected file, Coding stripes and All are selected. Automatic Colors option from the Coding Stripes menu is highlighted.

  18. As you scroll through the document, you should see coloured stripes along the right to tell you what parts of the document have been coded and how. Note that you can customize the colours if you’d like by holding down the Control key and clicking on each code, and then picking your colour of choice in the Color section. After you’ve set up all your colours, click anywhere on the text of the interview, select the Coding Stripes drop-down menu, and select Item Colors instead of leaving Automatic Colors selected.

    Red box around the coloured stripes along the right of the transcript text.

  19. At the top of the selected file tab, from the Highlight drop-down menu, select Coding for All Codes or Cases.

    Under the selected document, Highlight and Coding for All Codes or Cases is selected.

  20. You will see the coded text in yellow highlighting throughout the document.

    The coded transcript text is highlighted in yellow and outlined with a red box.

    Note: Both Highlight and Coding Stripes can also be found in the View menu in the top menu bar.

Technique: Qualitative Data Analysis | Tools: NVivo


First created: November 20, 2023
Last updated: May 12, 2026

Tutorial maintained by Kelly Schultz.

Tutorial created by Kelly Schultz.

Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International icon