MicroStrategy ONE

Advanced sorting: custom group sorting

A custom group is a convenient way to group at the display level, so by default, custom groups are not sorted on reports. You can sort a custom group in either of the following ways:

  • Sort on the IDs of the attributes that compose the custom group.

  • Inherit the attribute sort, which uses the default sort of the attribute set to display first. This is set in the New Attribute Form dialog box of the Attribute Editor.

For example, a custom group uses the Call Center attribute, which has both a numeric ID and a description. The description is set to display on reports, and its default sort is Ascending. If the criteria is set to Inherit the attribute sort, the custom group is sorted in alphabetical order by the description, as shown below:

West area is displayed as San Diego, San Francisco, Salt Lake City, and Seattle

If ID sort is used, the custom group is sorted by the numeric ID of the attribute, as shown below:

West area is displayed as Seattle, Salt Lake City, San Francisco, and San Diego

Sorting by metric values of items

You can use the Keep Group Structure option to sort by the metric values of the items in each custom group element. For example, the Areas custom group is set to display the individual items within its elements. It is placed on a report with the Revenue metric. Before sorting, the report is displayed as shown below:

West area is displayed as San Diego, San Francisco, Salt Lake City, Seattle

To sort each Call Center (item) within each area (element), add the custom group as a sort and change the Criteria to Keep Group Structure. Add the metric as a second sort. The report now displays the call centers in order of their revenue values, within each element:

West area is displayed as Salt Lake City, Seattle, San Francisco, San Diego

To perform a custom group sort

Sorting for custom groups works differently if you are in a report services document, as opposed to a report. See the topic Sorting grouping fields.

  1. Run the desired report, which must contain at least one custom group. (For steps to run a report, see Running a report.)

  2. From the Data menu, choose Advanced Sorting. The Sorting dialog box opens.

  3. On either the Rows tab or the Columns tab, click Add. One of the objects from the report appears in the list of Currently defined sorts.

  4. If the object is not the desired custom group, click in the Sort by cell. From the drop-down list, select the custom group to sort by.

  5. By default, custom groups are not sorted. To change the Criteria, click in the cell. From the drop-down list, select whether to sort on the attribute IDs or to inherit the attribute sort. Inheriting uses the default sort of the attribute form that is set to display first. This option is set in theAttribute Editor.

    To sort by the metric values of the items of the custom group elements, do not change the Keep Group Structure default. Add the metric as a sort.

  6. To change the Order of the sort, click in the cell and choose Ascending or Descending.

  7. If subtotals have been enabled for the custom group, you can change the Total Position; otherwise it is not available. To change the Total Position, which is the location of the subtotals in a sorted row or column, click in the Total Position cell. From the drop-down list, select one of the following positions:

    • Top, which positions the subtotal at the top of the report

    • Bottom, which positions the subtotal at the bottom of the report

  8. You can change the Parent Position, which is the position of the element headers relative to the child elements. For example, a header could be All Age Groups, while the child elements are Children, Teenagers, 20-29, and so on.

    To change the Parent Position, click in the cell and choose Top, Bottom, orDefault(which uses the position specified in the custom group definition).

  9. To remove an object from the list of Currently defined sorts, select the object and click Remove.

  10. Click OK to return to the report.

  11. To retain the new sort settings, save the report. How?

Related Topics