Survey Tabulation > Working with variables > Adding a category that is calculated from other categories
 
Adding a category that is calculated from other categories
Sometimes you may want to add a category to a table that contains the results of a calculation based on the values in other categories. You can do this by adding a derived category to the variable. For example, you can add a "55 and over" category to the age variable that is calculated by adding the values in the 55-64 years and 65+ years categories.
These instructions describe how to add a derived category to a variable so that it appears in all tables. If you want to create the derived category in a specific table, use the Edit Axis dialog box instead of the Edit Variable dialog box. The steps within the dialog box are the same. See Edit Axis dialog box for more information.
To add a derived category to a variable
1 Select the Define tab.
2 In the Variable List, select the variable you want to change.
3 From the menu, choose Variables > Edit.
This opens the Edit Variable dialog box: see Edit Variable dialog box.
4 Select the category in front of which you want the derived category to appear. To add the category at the end of the list, do not select anything.
5 From the menu at the top of the Edit tab, choose Insert.
This opens the Insert Item dialog box (see Insert Item dialog box).
6 In the list of Available Items, select Derived Element.
7 Click Add.
8 Click OK.
This inserts the new category into the list of items on the Edit tab.
9 Enter a label for the new category, for example, 55 and Over
10 In the row that contains the new category, click Edit item. This opens the Define Derived Element dialog box (see Define Derived Element dialog box).
11 Type in the expression that defines the new category (using the names, not the labels, of the categories that the derived category is based on), for example:
E5564_years + E65_years
Click OK.
12 Click OK again to close the Edit Variable dialog box.
Note The changes will be applied to any existing tables that include the variable next time you populate them, provided you haven't used the Edit Axis dialog box (see Edit Axis dialog box) to specify how the variable is to appear in any of those tables).
See also
Working with variables