The Sort window has two columns; the Items list on the left contains all items available for use as sort keys. The Keys list on the right contains all items that have been selected as keys for the sort. If you begin Sort Data using a dictionary, then no items are selected and hence, all items will appear in the left column. If you begin Sort Data with a sort specification file, then you will most likely have one or more items in the right column.
Refer to the choose type of sort
help screen for details on how this will impact the items shown in the left column.
If the Questionnaire IDs listed in the Items List are incomplete or incorrect, the only way to modify its contents is via Data Dictionary. Likewise, the order in which the fields are presented is determined by their definition within Data Dictionary.
The Keys column indicates the order in which the original (source) data file will be sorted to the new (destination) data file. Normally, if the files are structured in a hierarchical manner using geography as the keys, you would sort from a top-level (the largest geographical region) to some mid- or low-level (a small or local geographic region, such as enumeration area). It may not be necessary to sort by all case IDs (i.e., those fields which make the questionnaire/record unique), but it will usually will make CSPro perform better.
To transfer dictionary items to the Key column, do the following:
- Select names from the Items list on the left in the order in which you want Sort Data to sort them.
- Click Add --> to add selected items to the sort keys column.
- If necessary, use the Move Up and/or Move Down buttons to promote/demote the key(s) to the desired sequence.
- Use the Ascending and Descending buttons to specify the order of the sorting (the default is ascending).
- To select several items, hold the Ctrl key down while you make the additional selections.
- Click on Add All --> to add all items to the key list.
- Click on <-- Remove, to remove selected keys, or <-- Remove All, to remove all keys from the key list.
Suppose you failed to add an item as a key field, added it, but then realized the sort sequence is out of order—you can correct it quite easily. Select the item in question in the Keys column, then click on the Move Up and/or Move Down buttons to promote or demote the key to the desired sequence. Multiple clicks of the same key "sifts" the item up/down.
For each item that you have added to the Key column, you have the ability to change its sort value. Ascending means it will be sorted in A-Z sequence (if alphabetic), 0-9 (if numeric), or a combination of the two (if an alpha-numeric field). Descending order, therefore, means it will be sorted in Z-A sequence (if alphabetic), 9-0 (if numeric), or a combination of the two (if an alpha-numeric field).
- If you'd like to change multiple keys at one time, use standard Windows functionality, i.e., hold down the Ctrl key when clicking on items to select additional items.
- To select a sequential block of items, click on the first item, then hold down the Ctrl+Shift keys simultaneously while clicking on the last item.