
Mapping: Columns to rows using Normalizer
Posted by: Informatica Platform
PowerCenter example to pivot columns in a single row into multiple rows in the target using Normalizer Transformation.
Overview
Overview:Developers sometimes need to transform one source row into multiple target rows. For example, attributes that are stored in columns in one table or file may need to be broken into multiple records - one record per column attribute - upon being loaded into a data warehouse. Source
Target
This mapping template demonstrates how to use a Normalizer transformation to split one source row into multiple target rows as shown above. Normalization is the process of organizing data. In database terms, this includes creating normalized tables and establishing relationships between those tables according to rules designed to both protect the data and make the database more flexible by eliminating redundancy and inconsistent dependencies.The Normalizer transformation normalizes records from VSAM and relational sources, allowing you to organize the data according to your own needs. A Normalizer transformation can appear anywhere in a data flow when you normalize a relational source. Use a Normalizer transformation instead of the Source Qualifier transformation when you normalize a VSAM source.The Normalizer transformation is primarily used with VSAM sources, which are often stored in a de-normalized format. The OCCURS statement in a COBOL file, for example, nests multiple records of information in a single row. Using the Normalizer transformation, you can break out repeated data within a record into separate records. For each new record it creates, the Normalizer transformation generates a unique identifier. You can use this key value to join the normalized records.Once you have created a Normalizer transformation in your mapping, you need to customize its properties. On the Normalizer transformation's "Normalizer" tab, you can set the port names, data types, key fields, precision and an Occurs value for each port passing through the Normalizer. Tips:
EMP_Name | EMP_Year | Transport | House_Rent | Food |
---|---|---|---|---|
Rachel Geller | 2000 | 200 | 1500 | 500 |
Chandler Bing | 2000 | 300 | 1200 | 300 |
Joey Frank | 2000 | 300 | 1350 | 350 |
EMP_Name | EMP_Year | Expenses_Type | Expenditure |
---|---|---|---|
Rachel Geller | 2000 | Transport | 200 |
Rachel Geller | 2000 | House_Rent | 1500 |
Rachel Geller | 2000 | Food | 500 |
Chandler Bing | 2000 | Transport | 300 |
Chandler Bing | 2000 | House_Rent | 1200 |
Chandler Bing | 2000 | Food | 300 |
Joey Frank | 2000 | Transport | 300 |
Joey Frank | 2000 | House_Rent | 1350 |
Joey Frank | 2000 | Food | 350 |
- You can use a single Normalizer transformation to handle multiple levels of de-normalization in the same record. For example, a single record might contain two different detail record sets. Rather than using two Normalizer transformations to handle the two different detail record sets, you handle both normalizations in the same transformation.
- If you have de-normalized data for which the Normalizer transformation has created key values, connect the ports representing the repeated data and the output port for the generated keys to a different portion of the data flow in the mapping. Ultimately, you may want to write these values to different targets.
Features
- Informatica PowerCenter 9.1 and above.