When you sort the members you include in a report, be aware that sorting commands affect members differently, depending on whether they are referenced by member selection commands or by static member definitions. Report Writer commands sort members by member name or data values.
Member selection commands such as <CHILDREN and <DESCENDANTS, select members in the order specified by the database outline. By default, a report that includes member selection commands displays members in their hierarchical database outline order. You can override this default by specifying a sort order with a sort command.
Because sort commands affect the order of the members selected by the member selection commands, they must precede any member selection commands to which they apply. If you specify a sort command, the sort order is preserved until another sort command overrides it.
Sort commands modify member selection commands, such as <CHILDREN and <DESCENDANTS. Sort commands do not perform final sorting of rows during formatting. Be careful when you place a sort command in the report script that you do not start the sort too soon, and that you override it to turn it off, if necessary, before the next selection command.
Sort commands have no effect on static member definitions.
Table 107 lists the member sort commands:
Table 107. Report Writer Commands: Member Sort