Thursday, December 27, 2012

Sorter Transformation

Explain about Sorter Transformation

Sorter Transformation is an active and connected transformation. 



It is used to sorts the data either in ascending or descending order based on a specific key. The port which is used in sorting operation is known as "Key"

Sorter Transformation can also sort on case sensitivity, it is can also be used to eliminate duplicates, hence it is an Active Transformation. Sorter transformation can be used before the Aggregator transformation for sorting the input to aggregator transformation.


The Sorter function as "order by" clause in SQL


You can specify multiple sort keys. When you specify multiple sort keys, the Integration service sorts in the order of the ports. The primary sort is on the first sort key from the top. 

Let us see a small example




Consider the following input data

EMPNO                 ENAME                    SAL                     DEPTNO
1001                      MARK                     5000                            10
1002                      TOM                       8000                             40
1003                      HARRY                   7000                            10
1004                      MARK                     6500                             20
1005                      WILL                       4000                             20


The Integration service groups first by ENAME annd then by DEPTNO
After sorting the data


EMPNO                 ENAME                    SAL                     DEPTNO
1003                      HARRY                    7000                          10
1004                      MARK                      6500                           20
1001                      MARK                      5000                           10
1002                      TOM                         8000                          40
1005                      WILL                        4000                           20



In the above example the data is first sorted by ENAME ascending  and then by DEPTNO descending









No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...