In order to use table post calculations to add additional calculations to the tabulated data, you first need a place in the table to put these calculations. This section describes how to add additional rows or columns to a table.
As an example, take adding a third column to the following table in which we will place the male to female ratio.
There are two ways to add a new column. We can add a new value to the existing value set for the existing variable or we can drag a new variable onto the table next to the existing one. Adding a new value to the value set creates a new column under the existing spanner while adding a new variable creates a new column under a new spanner.
Male/Female Ratio column added as new value to value set for the variable Sex. The new column is under the Sex spanner.
Male/Female Ratio column added by dragging a new variable onto the table. The new column is under a separate spanner.
If you add a new value to the value set, make sure to set the value for the new value set entry to a number that does not exist in your data file, otherwise your totals will be incorrect. In the case of Sex, you can use 3, which should not appear in the edited data.
If you would rather add a new variable to the table to create the additional column, you can add any variable in the dictionary since the numbers in the new column will be overwritten by the postcalc logic. You can either add a new value set to the variable which uses the text you want for the column header (for example "Male/Female Ratio") or you can use an existing value set and customize the column header text once you have placed the variable on the table.
New rows can be added in the same ways, adding a new value to the value set of a variable on the rows or dragging a new variable onto the rows of the table.
See also: Add a Variable to a Tabulation, Implications of Data Dictionary Value Sets