To use sorted input, you pass sorted data through an Aggregator transformation.
You must sort data by the Aggregator group by ports in the order they appear in the Aggregator transformation.
For relational and flat file input, use the Sorter transformation to sort data in the mapping before passing it to the Aggregator transformation. You can place the Sorter transformation anywhere in the mapping before the Aggregator if no transformation changes the order of the sorted data. Group by columns in the Aggregator transformation must be in the same order as they appear in the Sorter transformation.
The following mapping shows a Sorter transformation configured to sort the source data in ascending order by ITEM_NO:
The Sorter transformation sorts the data as follows:
ITEM_NO
ITEM_NAME
QTY
PRICE
345
Soup
4
2.95
345
Soup
1
2.95
345
Soup
2
3.25
546
Cereal
1
4.49
546
Cereal
2
5.25
With sorted input, the Aggregator transformation returns the following results: