Codeit Help Site Support Center

Contact Us

Nesting Types Explained


When importing data, Codeit offers the ability to group together columns and import them together as a single unit.
This grouping is referred to as "nesting" and makes it much more efficient to deal with fields that would otherwise be split into multiple variables.
This article explains the concept of nesting, why you might use it and the options available to you in Codeit.

Why do we need nesting?

To answer this question, consider the following example, taken from a fizzy drinks survey:

2FantaLiltDr Pepper

Without nesting, the "Q1" fields would be imported as three separate variables "Q1_1", "Q1_2" and "Q1_3".
This means that each variable would need to be coded in a separate task in Codeit.
In this case, the data is multi-response (i.e. first, second and third mention) so it's more likely that you would want to code them together as one unit.
Nesting in Codeit provides a method to do this.

Nesting Conventions

When using the data import wizard in Codeit, the second step offers the option of specifying a "Nesting Delimiter":

This allows you to specify a sequence of characters for Codeit to use when attempting to group columns together.
For example, taking the example above and using the default nesting delimiter of "_" (underscore), Codeit will group together all columns where the column header is the same up to the delimiter:

Source Column
Target Variable

So, in this example, all three input fields will be written to a single "Q1" variable in Codeit during the import.

Nesting Types

When nesting is activated during an import, the import wizard will prompt you to specify a nesting type:

There are actually a few subtly different reasons why you might want to nest columns on import.
The nesting type allows you to be precise and specify a nesting reason which also controls how the variable values are used in the following ways:

Nesting TypeUsage ReasonExampleCodeit Display
OrderUse this nesting type when the nested columns represent separate responses for a single question.

Order Nesting is usually applied to variables that will be used as source variables for coding.
Q1. "What types of animal can you think of?"

1st Mention: "Dog"
2nd Mention: "Cat"
3rd Mention: "Rabbit"
When a variable is nested in this way, Codeit will display each individual value as a separate item for coding.
So, in the case of Dog, Cat, Rabbit these three responses will be displayed as 3 separate items each to be coded separately.
LoopUse this nesting type when each column within the set represents a different loop iteration within the same question.

Loop Nesting is usually applied to variables that will be used as source variables for coding.
Q2. <for each animal mentioned in Q1> "What do you like most about <animal>?"

1st Iteration (Dog): "They are loyal and fun"
2nd Iteration (Cat): "They are cute"
3rd Iteration (Rabbit): "They are soft"

Loop Nesting is very similar to Order Nesting - Codeit will display individual elements separately for coding.

However, Loop Nesting gives you additional options when displaying context variables relative to a containing loop. See here for more details.

MulticodedUse this nesting type when, taken together, the columns represent a single, multicoded response to a question.

Multicoded Nesting is usually only relevant for variables that will be used a target variables for coding.

The verbatim "They are loyal and fun" might be coded as:  Code 1 (loyalty) and Code 3 (fun/entertaining).

In which case, the data could be imported as two columns:

Q2_c_1: Code 1
Q2_c_2: Code 3

Codeit will display multiple values joined together as a single multicoded value rather than split out into separate responses.


Aside from controlling the display and usage of values within the coding interface, the nesting type is also important when exporting data.
For example, if you import 3 columns with loop nesting, then when you export the data you will most likely want the data exported in the original format (i.e. in 3 columns).
By specifying the nesting type on import, Codeit is able to preserve the format on output.  

Powered by HelpSite