pivotinformaticainformatica-powercenter

Pivot for Many names in a Cell powercenter informatica


Good day for all! I recently started using PWC, but it doesn't look very much like IMB's DStage... So, i have a CSV archive, i need converte all nick-names in new rows! Example:

Many names separated by comma

1

I need this

2

I'm try to use a Normalize, Sequences, Expression, Filter and Aggregator... But, I can't do!

If anyone can help me, i'll very glad so! Thank so much!


Solution

  • Use java transformation to do this dynamic looping thing.

    1. In java transformation(JTX) create 3 input(id, name,nickname) and 3 output(o_id, o_name,o_nickname) with correct data type.
    2. Under the Java code tab; Import Package tab Place the below code import java.util.; import java.text.;
    3. Under "On InputRow " tab place the following code.
    String[] words = nickname.split(",");
    len=words.length;
    
    for (int i=0;i<len;i++)    //iterate through the array  
    {
    o_id =id
    o_name=name
    o_nickname= words[i];
    generateRow();  
    
    }
    
    1. Save JTX and link output(o_id, o_name,o_nickname) to next transformation.

    I have not tested the code so if it fails pls let me know.

    *And every tool is a king un till XML, JSON, PDF, TB size table arrives on the battlefield.