Configure Sort Keys
Define the sort key on the Sort tab of the transformation Properties view.
This is the start of the concept.
The following image shows the Sort tab:
The Sort tab contains the following options:
- Output
- Choose whether to return all the sorted rows or to discard duplicate rows. Duplicate rows are rows where all the column values are the same.
- Specify by
- Select Value or Parameter. Select Value to use port names. Choose Parameter to use a sort list parameter.
- Add
- Accepts a port name that you type in manually. You must type a valid port name before you click Add.
- Choose
- Click Choose to select ports to add to the sort key. The Developer tool provides a list of ports from the transformation to choose from.
- Move Up and Move Down
- You can change the order of the ports in the group. Select the port name and then click one of the move buttons to move it up or down in the sort order.
Parameterize the Sort Keys
You can create a sort list parameter that contains a list of ports for the sort keys.
If the Sort transformation is in a dynamic mapping, the Sorter transformation might contain generated ports. You can parameterize the sort keys. Create a sort list parameter that contains a list of ports to sort by.
On the Sort tab of the transformation properties, choose Specify by Parameter. Click New to create a parameter.
The following image shows the Parameters dialog box:
Choose ports or generated ports for the sort keys. You can choose an ascending or descending sort type.
You can manually enter port names. Type the port name in the Default Value field and click Add. The Developer tool adds the port name to the sort list.
The following image shows the Sort tab after you configure a parameter for the sort keys: