Creating variables
You can create variables using the following options on the Variables menu:
Copy
Creates a new variable based on an existing variable. This is useful when you want to define alternative ways of tabulating a variable. Select the variable you want to copy. This can be any numeric, categorical, text, date, or Boolean variable, provided it is not a derived variable. Then choose
Copy on the main Variables menu. This opens the New Variable dialog box, in which you can enter a name and description for the new variable and define how you want it to appear in your tables. See
New Variable dialog box for more information.
Merge
Combines two or more variables to form a new variable. This is useful when you want to create a total awareness variable or when you want two or more categorical variables to be treated as one variable in your tables.
▪When merging categorical variables, the new variable will automatically have the same categories as the categorical variables you are merging. If the same category appears in more than one of the variables, it will appear only once in the new variable.
▪When merging text variables, the new variable will contain the texts from the text variables you are merging, concatenated together.
▪When merging numeric or date variables, the new variable will contain the sum of the values stored in the variables you are merging.
Before you choose
Merge on the Variables menu, you need to select the variables you want to merge. The variables must have the same data type, must not be derived, and if you are using the hierarchical view, they must be at the same
level. For example, provided they are at the same level, the variables could all be categorical (although they can be a mixture of single response and multiple response), or they could all be text, or all numeric. This option opens the New Variable dialog box, in which you can enter a name and description for the new variable and define how you want it to appear in your tables. See
New Variable dialog box for more information.
New Advanced
Creates a new variable based on other variables using your own formula. Before you select this option, select the variable in front of which you want the new variable to appear. If this is a hierarchical project and you want the new variable to be inside a loop, you need to expand the loop and select a variable inside the loop. This option opens the New Variable dialog box. First, select the new variable's
Data Type and then click the
Variable Definition link in the top right corner to define how the variable is to be derived. Then click
OK to return to the New Variable dialog box to specify the name and description and how you want the new variable to appear in your tables. See
New Variable dialog box for more information.
New from Side/Top
Creates a new variable based on the current definition of the side or top of a table. Click in the Side or Top area of the Table Structure section of the Define tab to select the side or top definition:
Then, choose
New Variable from Side/Top from the Variables menu, or click the
New Variable from Side/Top icon in the Table Definition toolbar
.
In the Table Variable Dialog box that appears, enter a name and description for the variable, and click OK.
Notes
▪You cannot base a new variable on a derived variable.
▪Copying a variable does not copy any changes you made to the original variable. For example, suppose you band a numeric variable and then use the Copy option to copy it. You will need to band or summarize the new variable before you can include it in a table, because it will not contain the banding you set up in the original variable. Similarly, suppose you insert some nets in a multiple response variable and delete some of the original categories. If you then copy the variable, the new variable will contain the original categories (including the deleted categories) but not the nets. The same thing applies when you create new variables using the Merge and New Advanced commands.
▪Copying or merging categorical variables that contain built-in special elements does not copy the built-in special elements. You are most likely to see this when you are working with Quanvert data, which typically contains built-in special elements. For example, if you copy a Quanvert variable that contains a built-in mean, the new variable will not contain the mean. Similarly, built-in bases are not copied and UNICOM Intelligence Reporter - Survey Tabulation will therefore insert an autobase into the new variable. This may mean that the base is different in tables created using the new variable compared to the original variable.
▪Sometimes you may want to merge variables of different data types. For example, suppose you want to create a categorical variable for use as a banner or breakdown in your tables and you want this new categorical variable to combine a categorical gender variable and a numeric age variable. This is possible in UNICOM Intelligence Reporter - Survey Tabulation, but not using the Merge option. See
Merging a categorical and a numeric variable for more information.
▪If you are using the hierarchical view of the data, the position of the variable(s) that you select before choosing these commands will define the level of the new variable. For example, if you select a top-level variable, the new variable will be at the top level. Whereas, if you select a variable in the Person loop, the new variable will be at the Person level.
▪From release 4.5, new variables and changes you make to existing variables are saved in the Table Document (.
mtd) file and apply to the current table document only, not to the whole project. When you share a table document with colleagues, they can see the variable edits you have made. When you create a new table document, the variables revert to their original form. If you want variable edits to apply to all your table documents, you can create a template document that includes the variable edits. Any new table documents created using the template will automatically include the variable edits. See
Managing template table documents for more information.
See
See also