In some of the components you need to define a sort key. Like a group key, this sort key can also be defined by selecting key fields using the Edit key dialog. There you can also choose what sort order should be used for each of the selected fields.
In the Edit key dialog, select the fields you want and drag and drop each of the selected key fields to the Key column of the Key parts pane on the right. (You can also use the Arrow buttons.)
Unlike in the case of a group key, in any sort key the order in which the fields are selected is of importance.
In every sort key, the field at the top has the highest sorting priority. Then the sorting priority descends down from top. The field at the bottom has the lowest sorting priority.
When you click the OK button, the selected fields will turn to a sequence of the same field names and an
d letter in parentheses (with the meaning:
descending, respectively) separated by a semicolon.
It can look like this:
This sequence can be seen in the corresponding attribute row. (The highest sorting priority has the first field in the sequence. The priority descends towards the end of the sequence.)
As you can see, in this kind of key, the sort order is expressed separately for each key field (either Ascending or Descending). The default sort order is Ascending. The default sort order can also be changed in the Order column of the Key parts pane.
ASCIIbetical vs. alphabetical order
If your sort key is the following:
The records will be sorted according to the
Salary values in descending order, then the records will be sorted according to
LastName within the same
Salary value and they will be sorted according to
FirstName within the same
LastName and the same
Salary (both in ascending order) value.
Thus, any person with
25000 will be processed after any other person with a salary of
And, within the same
Brown will be processed before any
And again, within the same salary, any
John Smith will be processed before any
The highest priority is
Salary, the lowest is
Sort key is used in the following cases:
Sort key in ExtSort
Sort key in FastSort
Sort key in SortWithinGroups
Sort key in SequenceChecker