This article describes how to order a column based on the data in the other column.

For example, if you have a sales summary data by country. It has 2 columns, “Country” column for country names and “Sales_sum” column for the total sales amount for each country.

The order of the Country column is in alphabetical order. If you want to order this Country column based on the value of Sales_sum column, click the column header menu of the Country column, choose Work with Factor (Category) and choose Set Order by Another Column.

It opens up a dialog. Choose Sales_sum column.

It’s done! Let’s check the order. Go to the column header menu of the Country column, choose Arrange (Sort) and choose Ascending.

Now you can see the order of the Country column is ordered by the total sales amount.

By default, the order is set by the ascending order. If you want to make it in descending order, you can use Reverse Order.

Once it’s done, you can do the sort again to check the order. Now, you see it is in descending order.