Normalizing and denormalizing values
We have already seen the ADF Flatten activity, which helps to denormalize data. There are two more such transformations to help normalize and denormalize datasets—Pivot and Unpivot. Let's look at them in detail.
Denormalizing values using Pivot
Let's assume that you have a table with a normalized column to store City
values, but for reporting purposes, you want to have one column per city in your tables. In such a case, you can use the Pivot function to denormalize the table. The Pivot function takes the unique row values and converts them into table columns. Here is an example of how to pivot the tables:
- Let's consider the following sample table:
- Select the Pivot activity from the ADF Data Flow tile, and in the Group by tab, specify
Gender
, as illustrated in the following screenshot: