Reporter > Using variables > Editing variables > Creating a category based on other categories
 
Creating a category based on other categories
Sometimes you may want to add a category 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. To create formula for the category, you can add or subtract the values in the other categories, or use a function from the UNICOM Intelligence Data Model.
For example, in this table the age variable has a derived category called "55 or over", created by adding together the values in the 55-64 years and 65+ years categories.
Table showing category "55 or over" calculated from two other categories
To create a derived category
1 In the Variables pane, select the variable.
2 From the menu, choose Variables > Edit Variable.
This opens the Edit Variable window and displays details of the variable.
3 From the menu, choose Categories > Insert Categories.
This opens the Insert Categories dialog box.
4 In the list of Available Items, select Derived category and click the >> button to add it to the Items to insert list.
5 In the description field, replace the default description with the text that you want to appear on the table, for example, 55 or over.
6 Click Edit Item to open the Edit Derived Category dialog box and display a list of all the categories in the variable.
7 Drag the 55-64 years category to the text box on the right of the screen.
8 Type a + symbol (optionally, include a space before and after the symbol to make it easier to read).
9 Drag the 65+ years category onto the right of the screen after the + symbol. The expression should now look like this:
E5564_years + E65_years
10 Click OK to close the Edit Derived Category dialog box, and then click OK again to close the Insert Categories dialog box.
11 Choose Save and Close to close the Edit Variable dialog box.
See also
Editing variables