The Sorter stage allows you to sort records using the fields you specify.
- Under Control Stages, drag Sorter to the canvas, placing it where you want on the dataflow.
- Double-click Sorter.
- Click Add.
-
Click the down-arrow in the Field Name column and select
the field that you want to sort on.
Note: The list of available fields is based on the fields used in the previous stages in the dataflow.
- In the Order column, choose whether you want to sort in ascending or descending order.
-
In the Type column, select the field's data type.
Note: If your incoming data is not in string format, the Type column will be disabled.
- bigdecimal
- A numeric data type that supports 38 decimal points of precision. Use this data type for data that will be used in mathematical calculations requiring a high degree of precision, especially those involving financial data. The bigdecimal data type supports more precise calculations than the double data type.
- double
- A numeric data type that contains both negative and positive double precision numbers between 2-1074 and (2-2-52)×21023. In E notation, the range of values is -1.79769313486232E+308 to 1.79769313486232E+308.
- float
- A numeric data type that contains both negative and positive single precision numbers between 2-149 and (2-223)×2127. In E notation, the range of values -3.402823E+38 to 3.402823E+38.
- integer
- A numeric data type that contains both negative and positive whole numbers between -231 (-2,147,483,648) and 231-1 (2,147,483,647).
- long
- A numeric data type that contains both negative and positive whole numbers between -263 (-9,223,372,036,854,775,808) and 263-1 (9,223,372,036,854,775,807).
- string
- A sequence of characters.
- To remove blank space from before and after the value before sorting, check the box in the Trim column. The trim option does not modify the value of the field. It only trims the value for the purpose of sorting. Note that if your incoming data is not in string format, the Trim column will be disabled.
-
In the Treat Null As column, select
Largest or Smallest to
indicate the placement of null values in the sorted list. The placement depends
on the combination of options selected in the Order and
Treat Null As fields, as shown in the table
below:
Order Treat Null As Placement of null values in the sorted list Ascending Largest Bottom of the list Ascending Smallest Top of the list Descending Largest Top of the list Descending Smallest Bottom of the list - Repeat until you have added all the fields you want to sort.
- Rearrange the sort order as desired by clicking Up or Down. This allows you to sort first by one field, then sort the resulting order again by another field.
-
If you want to override the default sort performance options that have been
defined by your administrator, click Advanced, check the
Override sort performance options box, then specify these
options:
Note: The optimal sort performance settings depends on your server's hardware configuration. You can use this equation as a general guideline to produce good sort performance:
(InMemoryRecordLimit × MaxNumberOfTempFiles ÷ 2) >= TotalNumberOfRecords
-
Click OK.
Note: You can remove the sort criteria as desired by highlighting a row and clicking Remove.