Learning Informatica PowerCenter 10.x(Second Edition)
上QQ阅读APP看书,第一时间看更新

Sorter transformation

Sorter transformation is used to sort the data in ascending or descending order based on single key or multiple keys. A sample mapping showing sorter transformation is indicated in the following screenshot:

In the preceding mapping, we wish to sort the data based on the DEPARTMENT_ID field. To achieve this, mark the key port for the DEPARTMENT_ID columns in the sorter transformation, and select from the drop-down you wish to have Ascending or Descending sorting as shown in the following screenshot:

If you wish to sort the data on multiple columns, check the Key ports corresponding to the required port.

Apart from ordering the data in ascending or descending order, you can also use sorter transformation to remove duplicates from the data using the distinct option in the properties. Sorter can remove duplicates only if the complete record is duplicate, and not only a particular column. To remove the duplicate, check the Distinct option in sorter transformation as shown in the following screenshot:

Sorter transformation accepts the data in a row-wise manner and stores the data in cache internally. Once the data in received completely, it sorts the data in ascending or descending order based on the condition and sends the data to the output port.