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.
Figure 29.11. Defining Sort Key and Sort Order
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 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
d letter in parentheses (with the meaning:
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
Example 29.3. Sorting
If your sort key is the following:
Salary(d);LastName(a);FirstName(a). 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
(both in ascending order) value.
Thus, any person with
will be processed after any other person with a salary of
And, within the same
will be processed before any
Smith. And again, within the
same salary, any
John Smith will be processed before any
Peter Smith. The highest priority is
the lowest is
Sort key is used in the following cases: