Transpose Data Task

About the Transpose Data Task

The Transpose Data task turns selected columns of an input table into the rows of an output table. If you do not use grouping variables, then each selected column is turned into a single row. If you use grouping variables, then the selected columns are divided into subcolumns based on the values of the grouping variables. Each subcolumn is turned into a row of the output table.

Assigning Data to Roles

To run the Transpose Data task, you must assign a column to the Transpose variables role.
Role
Description
Transpose variables
Each variable that you assign to this role becomes one or more rows of the output table. If you do not select any grouping variables, then an entire column is turned into a single row. If you select one or more grouping variables, then the grouping variables are used to segment each column into subcolumns, each of which is turned into a row. In this case, a column is transposed to the number of rows that is equal to the number of groups that are defined by the grouping variables.
You must assign at least one column to the Transpose variables role. To select a grouping variable, assign a column to the Group analysis by role.
Copy variables
Each variable that you assign to this role is copied directly from the input table to the output table without being transposed. Because these columns are copied directly to the output table, the number of rows in the output table equals the number of rows in the input table. The output table is padded with missing values if the number of rows in the input table does not equal the number of variables that it transposes.
Group analysis by
Each variable that you assign to this role is used to segment the about-to-be-transposed columns into subcolumns that will be transposed separately. Each subcolumn, defined by a set of values of the grouping variables, becomes a row of the output table.
New column names
The variable that you assign to this role is used to name the transposed variables in the output data set. When the variable name is created for the transposed data set, all the nonmissing, formatted values are concatenated in the same order that the variables are assigned to this role.
If you select the Allow duplicate items check box, the transposed output data set contains only the last observation for each BY group.
New column labels
The values of the variable that you assign to this role are used to label the variables in the New column names role.

Setting Options

Option Name
Description
Source Column
Name
Each row of the output table includes the name of the variable in the input table to which the values in that output row belong. To specify a heading for the output column that contains these variable names, enter the heading in the Name box. The name can include special characters, leading numbers, and white space, but it cannot exceed 32 characters. The default name is Source.
Label
Each row of the output table includes the label of the variable in the input table to which the values in that output row belong. To specify a heading for the output column that contains these variable labels, enter the heading in the Label box. The label can include special characters, leading numbers, and white space, but it cannot exceed 32 characters. The default label is Label.
Column Name Prefix
Use prefix
You can specify a prefix to use in constructing the names for the transposed variables in the output data set. When you use a prefix, the variable name begins with the prefix value and is followed by the value of the variable that you assigned to the New column names role.
Results
Name of output table
You can designate a different name for the output table.