Note: SPSS considers missing values the "smallest" value, so they will appear first if sorting in ascending order, and will appear last if sorting in descending order. In this example, cases have been sorted according to class rank, and then sorted by most to least recent birthdate. You can check that your cases were sorted correctly by visually inspecting the data in Data View. (Optional) If you wish to save your newly sorted data to a new file, select the Save file with sorted data check box in the Save Sorted Data area. Then click File to specify a name and location for the new dataset file. Notice that an “(A)” appears to the right of variables that will be sorted in ascending order, and a “(D)” appears to the right of variables that will be sorted in descending order. That is, the birthdates will be sorted within each category of class rank. In this example, the data will first be sorted by class rank in ascending order, and will then by sorted by birthdates in descending order. Click on the variable in the Sort by box to highlight it, then click the radio button that corresponds to your sort order choice. In the Sort Order area, you can choose an “Ascending” or “Descending” sort order for each variable in the "Sort by" list. You can click and drag the variables to reorder them within the Sort by box. If you are sorting by two or more variables, then the order that the variables appear in the "Sort by" list matters. If you want to sort your data with respect to two or more variables, or if you want to have the sorted data written to a new file, you'll want to use the Sort Cases procedure:ĭouble-click on the variable(s) you want to sort your data by to move them to the Sort by box. In the Data View, you can quickly sort your data with respect to a single variable by right-clicking on the variable name and selecting Sort Ascending or Sort Descending. If the original order of your rows is important, make sure you have a variable of that specifically and uniquely identifies the correct order of the cases first! That way, you can return to the original row order by sorting on the "order identifier" variable.
![spss support number spss support number](https://demo.fdocuments.in/img/378x509/reader019/reader/2020040623/5b0774d57f8b9ae9628e7e8c/r-1.jpg)
Once you sort the cases of a dataset, it is not possible to "un-sort" the data to its original order. The values for the selected variables can be sorted in ascending (smallest to largest, or alphabetical) or descending order (largest to smallest, or reverse alphabetical). Sorting cases will rearrange the rows based on a given variable (or variables).