To use Cognos product documentation, you must enable JavaScript in your browser.

Sort Values

By default, Analysis Studio retrieves items in the order defined in the data source. You can sort items to quickly view the most important data.

You can list items in ascending or descending order based on

Whether you select a set or an individual row or column, items are sorted based on the default measure and the summary values of the opposite axis.

In nested crosstabs, items are sorted based on the values of the innermost nested row or column of the opposite axis. For example, a crosstab contains Years in the columns and Retailers nested within Products in the rows. Select 2005, sort in descending order, and you see Retailers listed from the largest value to the smallest value for each product.

Sorted items are automatically resorted when you perform a drill or replace operation on the opposite axis, if Based on the row or Based on the column in the Sort dialog box is set to the default.

When you replace the sorted set itself, the new set uses the default sort order. If you replace Employees in the previous example with Order Method, the Order Method set is unsorted.

Steps
  1. Select a set, row, or column to sort.

  2. Click the sort button  on the toolbar.

  3. If the item you select contains alphanumeric values, choose either Sort by labels or Sort by values.

  4. Do one of the following:

The items appear sorted in the crosstab. An icon  next to the label in the overview area shows you that a sort is applied to that set.

Tip: To remove a sort or restore the default order, click No Sort.

Use Custom Sorting

You can use the custom sort options to override the default sorting behavior. For example, you can sort items based on a measure other than the default measure, or based on a row or column other than the summary values of the opposite axis. The custom sort options also lets you sort by attributes.

By default, items in nested sets are sorted based on the values of the innermost nested row or column. You can use custom sorting to sort nested or stacked sets differently than this default.

For an example of custom sorting, see Example - Perform a Custom Sort.

You must select a set to perform a custom sort.

Note: When a selection-based set contains members from different levels, sorting the set by an attribute that is not common to all levels may result in a server error.

Similarly, if you append a member from a different level to a selection-based set that is sorted by attribute, the same error may occur.

Steps
  1. Select a set.

  2. Click the sort button  on the toolbar, and click Custom.

    The Sort dialog box opens.

  3. Under Sort order, select Ascending or Descending.

  4. Under Options, select whether to sort

  5. Click OK.

    Tip: To remove a sort or restore the default order, click No Sort.