Tuesday, December 11, 2012

Segregating rows on group count basis


There are 4 departments in Emp table. The first one with 100,2nd with 5, 3rd with 30 and 4th dept has 12 employees. Extract those dept numbers which has more than 5 employees in it, to a target table.

Solution:
1. Put the source to mapping and connect the ports to aggregator transformation.


2. Make 4 output ports in aggregator as in the picture above : count_d10, count_d20, count_d30, count_d40.
For each port write expression like in the picture below.


3. Then send it to expression transformation.


4. In expression make four output ports (dept10, dept20, dept30, dept40) to validate dept no
And provide the expression like in the picture below.


5. Then connect to router transformation. And create a group and fill condition like below.


Finally connect to target table having one column that is dept no.

2 comments:

Thank you :
- kareem