Publication date: 07/08/2024

Example of Sorting Data

Use the Sort command to sort a data table by one or more columns in the data table. For example, look at financial data for computer and pharmaceutical companies. Suppose that you want to sort the data table by Type, then by Profits ($M). Also, you want Profits ($M) to be in descending order within each Type.

1. Select Help > Sample Data Folder and open Companies.jmp.

2. Select Tables > Sort.

3. Select Type and click By to assign Type as a sorting variable.

4. Select Profits ($M) and click By.

At this point, both variables are set to be sorted in ascending order. See the ascending icon next to the variables in Figure 3.29.

Figure 3.29 Sort Ascending IconĀ 

Sort Ascending Icon

5. To change Profits ($M) to sort in descending order, select Profits ($M) and click the descending button.

Figure 3.30 Change Profits to DescendingĀ 

Change Profits to Descending

The icon next to Profits ($M) changes to descending.

6. Select the Replace Table check box.

When selected, the Replace Table option tells JMP to sort the original data table instead of creating a new table with the sorted values. This option is not available if there are any open report windows created from the original data table. Sorting a data table with open report windows might change how some of the data is displayed in the report window, especially in graphs.

7. Click OK.

The data table is now sorted by type alphabetically, and by descending profit totals within type.

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).