The aggregator transformation will throw the below error if you do not sort the data and specified the "Sorted Input" option in the properties of the aggregator transformation:
TE_7073: Expecting Keys to be ascending
This error is due to the data sorting issues in the mapping. This is quite obvious as the aggregator transformation expects the data to be in sorted order and however it gets the data in unsorted order. To avoid this error, simply follow the below steps:
Sort on Group By Ports:
Be sure to sort the data using a sorter transformation or source qualifier transformation before passing to the aggregator transformation.
The order of the ports is important while sorting the data. The order of the ports that you specify in the sorter transformation should be exactly same as the order of the ports specified in "Group By" ports of aggregator transformation. If the order of the ports does not match, then you will get this error.
Trim String Ports:
If you are using the string or varchar ports in the "Group By" of aggregator transformation, then remove the trailing, leading spaces in the expression transformation and then pass to sorter transformation to sort the data.
Avoid Transformations that Change Sorting Order:
Do not place transformations which change the sorting order before the aggregator transformation.