# Overview

The *Sorting* analysis ranks the values of a series in an ascending or descending order. It’s most useful after calculating output series using another analysis such as* scalar* or *cross section*. You can then use sorting to rank categories and for arranging output series order.

# Settings

## Direction

Here, set the order in which values of the series are sorted. When you have one input series, you have the options of *ascending* and *descending. *

When working with multiple series, you can select a main series to rank, and sort the other series by the sorting off the main series. You can do so by selecting “by [series name]” under direction.

## Observation limit

This sets the limit for the number of 'items' (i.e. observations or categories) to which the sorting should be applied.

This is very useful when you only want to display a smaller number of observations / categories than you have in the document.

*Example:* In a document containing 50 series, you would set the observation limit to 10 if you only want to display the top ten observations.

## Missing values

You can choose to exclude values that are missing values in the master series by selecting this option.

# Example

Here, we created two category series using the scalar analysis, one with the last available values and one with the values at 2015. We sorted the last available values series in descending order and sorted the second series by the order set for the first series.