Sorting cases
At times it is useful to see if any values look unusual. The Sort
node arranges cases into ascending or descending order based on the values of one or more fields. It also helps in the optimization of other nodes so that they perform more efficiently:
- Place a
Sort
node from theRecord Ops
palette onto the canvas. - Connect the
Select
node to theSort
node. - Edit the
Sort
node.
You can sort data on more than one field. In addition, each field can be sorted in ascending or descending order:
- Click on the
Field
Chooser
button. - Select
Age
in theSort by:
fieldbox. - Click
OK
:
We will now rank the age cases in ascending order (the youngest people will be at the top of the file and the oldest people will be at the bottom of the file):
- Click
OK
.
Now let's take a look at the results from the Sort
node:
- Connect the
Sort
node to aTable
node. - Run the
Table
node:
Notice that there are no longer any children in this file, as the youngest people in the dataset are 18 years old.