Workflow: Swapping rows and columns with the Transpose block


The Transpose block enables you to restructure a dataset to convert rows to columns.

The following demonstrates how the Transpose block is used to change the loandatasample.csv dataset (containing observations describing a loan and the person taking the loan out) structure such that each column represents an individual customer.

  1. Import the loandatasample.csv dataset onto a Workflow canvas using the Text File Import block.
  2. Expand the Data Preparation group in the Workflow palette, then click and drag a Transpose block onto the Workflow canvas.
  3. Click the Output port of the loandatasample dataset block and drag a connection towards the Input port of the Transpose block.
  4. Double-click the Transpose block to display the Configure Transpose dialog box.
  5. In the Configure Transpose dialog box:
    1. Click Select all to move all variables from the Unselected Transpose Variables box to the Selected Transpose Variables box.
    2. Click the Variable Names tab, in the Prefix text box, type Customer.
  6. Click OK to save the configuration and close the Configure Transpose dialog box.

A green execution status is displayed in the Output ports of the Transpose block and the new Working Dataset. The Transpose block output dataset is the transformed loandatasample dataset with each column representing a customer.