Transforming data with the Pivot transform

The Pivot transform belongs to the Data Integrator group of transform objects, which are usually all about generation or transformation (changing the structure) of data. Simply put, the Pivot transform allows you to convert columns into rows. Pivoting transformation increases the number of rows in the dataset as for each column converted into a row, an extra row is created for every key (non-pivoted column) pair. Converted columns are called pivot columns.

Getting ready

Run the SQL following statements against the AdventureWorks_OLTP database to create a source table and populate it with data:

create table Sales.AccountBalance ( [AccountID] integer, [AccountNumber] integer, [Year] integer, [Q1] decimal(10,2), ...

Get SAP Data Services 4.x Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.