In this article
Note: This process is ONLY required if you want to import variables from a different project (not the one used for generating the template). If you wish to import variables from the same project, use the “Update from project” function.
Imagine the following scenario:
You have generated a template for Project A and would like to use this template for Project B, which differs slightly from Project A. After duplicating the template, you would run the import process. This allows you to import new variables and to replace existing ones if they also exist in Project B.
- In the Template List, click on the template you wish to import the variable to.
- In the Available Variables toolbar, click Import.
- Assuming you wish to proceed, confirm the import by clicking Yes.
- Select the database you wish to use and click Next.
- Select the project containing the variable you wish to import (the project you are working with), then click Next.
- Make the appropriate settings and click Finish.
- If you click Ignore, only new variables will be imported to the Available Variables list; any variables that already exist in the template will be ignored.
- If you click Replace, new variables will be imported to the Available Variables list AND any variables in the survey that have been changed will be updated in the template.
- As in this exercise you wish to import the new variable and update one that has been changed, click Replace.
- In this case, click Replace All.
The Template Editor page opens.
A confirmation message appears.
The Webpage Dialog opens - .
Figure 1 - The Webpage Dialog
The Webpage Dialog changes to show a list of the projects you have access to.
The Advanced Template Options window opens. The layout of this window will depend on the type of template you are working with.
The Template Generator task is executed. As in this case you are importing variables into a template that already contains some variables, a warning message appears - .
Figure 2 - Import warning message
The Import Variables dialog opens - . The variables you are importing are now listed one by one, allowing you to accept or stop each import/change separately. Alternatively, if you are certain your previous selections are correct, you can click Replace All to accept all the imports/changes in one go.
Figure 3 - The Import Variables dialog
The new variables (in this case one imported and one changed) are added to the Available Variables list - .
Figure 4 - The Available Variables list with the new and updated variables
Note: An Undo button is available, however the import process itself is not reversible. You are recommended to export the template before you import a project so that you have a backup copy of the variables before you make the changes.
The import process is different when the template is flattened. In a flattened template, the Import button in the available variable section is not visible unless you are in the Source mode of the template.
- Click on Source (the Source button changes to Target). The template changes to hierarchical view and the import button is now visible in the “Available variables” section.
- Go through the import process as before.
After the import process the template must be flattened again.
Note: If you want to maintain the column positions, make sure the column positions are fixed (Fix by should be set to Position) before you start the import process. If the column positions are fixed, then re-flattening after the import process will not change the positions.
You now need to ensure that any changed variables are correctly set up, and new variables are added into the template in the desired position(s). Any variables that are incorrectly set up will be displayed in red. To check for these:
- In the Selected Variables pane on the right, scroll down and look for red variables, or apply a filter.
- Click in the grid to apply the filter. Only variables that include errors will be listed. The selected variable is presented in dark red - .
- Toggle the Show Variable Properties button (ringed in the figure above) to open the Variable Properties pane towards the bottom of the window. Here you can view the properties (go to Variable Properties for more information) and see the changes that have been made. In this case, the new category is displayed (“new brand in wave2” - arrowed).
To apply the filter: In the last Error column, click on the down-arrow and deselect “With no errors” - .
Figure 5 - Selecting the error filter
Figure 6 - Only those variables containing errors are now listed
Note: In this case, the reason why the variables are displayed with a red background is that the “Fix By” positions are set to Position. This was originally set to ensure that the columns are maintained even when the project is changed and exported again. To fix this, when generating the template the first time, ensure that there is enough space reserved (using Set Length), or apply Split Multi, change the variable to Spread now (this uses less space), or move the variable to the end.
To change the setting to Spread:
- Click on first "red" variable to select it.
- In the Variable Properties window, check Use spread.
- In this case, set Sub-fields number to 2 and Sub-field width to 2.
- Repeat the procedure for the remaining red variables.
Two additional fields appear - .
Figure 7 - Checking the Use Spread property box
The red background should change to blue for this variable.
To select the variables that have been added to the Available Variables list:
In the column between the Available Variables list and the Selected Variables panes, click the >> button.
All the variables are added to the template.
Remove the filter from the error column to view the new variables in the Selected Variables pane. In this case, the two new variables (q50,q15_E99) have been added to the bottom of the list. You can now position then as required in the list using the Move Up and Move Down buttons.