Search code examples
informatica-powercenter

Combine results of two aggregator expressions in one flat file


I am new to infortmatica powercenter, i have two tables tableA and tableB all i want to achieve is to get the number of records in both the tables in one flat file in a single row as shown below

A_cnt,B_cnt
107,224

i have applied following mapping

SQ(tableA) => Aggregator(tableA) => Union(A/B) => target

SQ(tableB) => Aggregaor(tableB) => Union(A/B) => target

it is giving the result but in seperate rows. how to achieve it in single row.


Solution

  • Instead of Union, you have to use a Joiner transformation. To use joiner, you have to create dummy join ports first. After the aggregator, use an expression transformation to create a dummy output column with a hardcoded value "1". You have to create two such expressions for A and B.

    Now connect them to a Joiner. Use the dummy ports in the condition.

    SQ(tableA) --> Agg(A) --> Exp(A) 
                                      \
                                        --> Joiner(A/B)--> Target
                                      /
    SQ(tableB) --> Agg(B) --> Exp(B)