
Mapping: Convert Rows To Columns
Posted by: Informatica Platform
This template describes a mapping in Informatica PowerCenter which helps to pivot data from multiple rows into columns in a single row.
Overview
This solution describes how to pivot data from the multiple rows into columns in a single row. Source
Target
There are a few different methods of building one record out of several. Often this can be accomplished by using an aggregator. Alternatively, an Expression variable logic can be utilized. This mapping template illustrates all the methods.
CUSTOMER_ID | PRODUCT_CATEGORY | SALES_AMT |
---|---|---|
CUST_1 | CAT_A | 2000 |
CUST_1 | CAT_B | 3000 |
CUST_1 | CAT_C | 4000 |
CUST_2 | CAT_A | 8000 |
CUST_2 | CAT_C | 7000 |
CUSTOMER_ID | CATEGORY_A_AMT | CATEGORY_B_AMT | CATEGORY_C_AMT |
---|---|---|---|
CUST_1 | 2000 | 3000 | 4000 |
CUST_2 | 8000 | 7000 |
Features
Using Expression port variables allows for great flexibility on the condition on which the final record can be built.- Informatica PowerCenter 9.1 and above.