Coding query

Coding queries can help you to test ideas, explore patterns and see the connections between the themes, topics, people and places in your project.

To see what has been coded to a code, double-click it in the List View to open it. You can use coding queries to find content coded to selected codes, a combination of codes, or cases with particular attribute values.

You could use a coding query to:

  • Gather material coded to combinations of codes—for example, gather content coded to water quality and negative and explore the associations.
  • Gather material from cases with specific attribute values—for example, what do people from Straits town say about fishing or aquaculture?

A coding query will only find content that has been coded. For example, if you ask the question what do commercial fishers say about fishing industry decline?—make sure you have coded content to the code fishing industry decline and to cases with the attribute value Yes for the attribute commercial fishing.

Create a coding query

  1. On the Explore tab, click Queries > Coding.
  2. Choose where you want to search for coding
    • Files and Externals—search for content in all the files and externals in your project
    • Selected Items—restrict your search to selected items (for example, a set containing interview transcripts)
    • Items in Selected Folders—restrict your search to content in selected folders (for example, a folder of interview transcripts)
  3. By default, the query will look for content where All of the following are true (i.e. all of the criteria you specify in the rows below are true). Select Any, from the pop-up menu, if you want content that meets any of your criteria.
  4. Define your criteria—the query will search for content that is coded in the way you specify here. You can find content that is coded to:
    • all of these codes—the content must be coded to every code that you select
    • any of these codes—the content must be coded to at least one of the codes you select
    • any case where—the content must be coded to a case that has the attribute value that you select (e.g. is coded to a case with classification = Person and the attribute value for Sex = Female)
  5. To add additional criteria, click the Add Icon representing add button to the right of the last criteria in your list. 
  6. Click the Run Query button at the top of Detail View.

When the query has finished running, the results are displayed as a temporary preview in Detail View.

NOTES

  • When selecting codes, you can select all descendent codes in a hierarchy by holding down the Option key when you select a code higher in the hierarchy.
  • For more complex Coding queries, you may want to combine an All of the following are true criteria group with an Any of the following are true criteria group. To add an additional criteria group, press the Option key and click the Add Icon with three dots button.
  • To move a criteria row to a new location (for example, move a row down a level into another criteria group), drag the row to a new location.
  • To save query settings so you can run a query again later, click Save Criteria. Name the query criteria file and optionally add a description. The file is saved under Queries / Query Criteria in the Navigation View.

TIP  Click the Expand icon at the top of Detail View to make more room for reviewing query results. Customize the workspace

Examples of coding query criteria

The following examples show how you can build query criteria to answer specific questions:

To answer the question

Do this

what do commercial fishers say about fishing industry decline?

Build a query where all of the following are true:

  • Coded to all of these codes 'fishing industry decline'
  • Coded to any case where Person:Commercial Fishing = Yes

In what ways is the natural environment negatively perceived? 

Build a query where all of the following are true:

  • Coded to all of these codes Negative
  • Coded to any of these codes Environmental change, Landscape, Habitat

View the results

When you run a coding query the results are shown as a preview in the Detail View.

Click on the tabs displayed at the top to see different views of the results.

  • Summary lists the files that contain the content that matches the query criteria.
  • Reference displays the content that was returned by the query.

Click the Undock icon (in the top right of the Detail View) to open the file in the Detail View into its own window, making more space to work. See Customize the workspace

Save the preview results as a code

If your query has returned interesting content, you may want to save it as a code, so that you can explore it further. For example, you might find all the content coded to water quality and real estate development. You can save the results to a new code that holds your evidence that Real estate development negatively impacts water quality.

The code will contain the content displayed on the Reference tab in the query results in Detail View. If you repeatedly run the same query, you may want to merge the references into an existing code, rather than create them as a new code.

  1. Click the Save Results button at the top of Detail View.
  2. If you are creating a new code, enter a name and description.
  3. Click Save Results.

NOTE  By default new codes are created in the Query Results folder, unless you choose another location by clicking The location icon represented by an arrow.