Transposing Data

Transposing datasets converts rows into columns and vice versa.

This conversion may be required to merge data tables prior to performing in-depth analyses.


Prerequisites


Procedure

  1. Drag the Transpose task onto the stage.

  2. Connect a task that contains the attributes you want to transform to the Transpose task.

  3. Double click the Transpose task.

  4. Select Put attribute names as first column to include attribute names as the first column in the transpose table. If not selected the attribute names will be removed in the resulting dataset.

  5. Select Use first column as attribute names to use the first column of the original dataset to determine the attribute names of the transpose table. If not selected generic names are employed.

  6. Save and compute the task.


Example

The following example uses the Sales_2016 dataset.

Description

Screenshot

  • After having imported the dataset, right click on the import task and select Take a look to check the data.

  • The dataset contains 3 attributes (2 integer attributes and 1 continuous attribute) and 12 rows.

  • Drag a Transpose task onto the stage and link it to the import task.

  • Double click the task to open it and select both the Put attribute names as first column and Use first column as attribute names options (default value); then compute the task.

  • Drag a Data Manager onto the stage: as we can see, the columns Month_ID, Year_ID and Sales have been converted to rows.