SORTGEN

Sorts all members added with a member command, such as <CHILDREN, according to the generation of the member in the cube outline. The top member of the dimension is generation 1 for the dimension. The children of the top are generation 2, and so on. Each member's generation is one higher than its parent.

The following are not affected by this command:

  • Members entered directly in the report specification without using a member selection command

  • Calculated rows and column names

  • Member commands encountered in the script prior to the SORTGEN command

This command must precede the selection commands, for example CHILDREN or DESCENDANTS. If no sorting commands are used, members are output in hierarchical order based on the member outline. Any sort command remains in effect until another sort command is issued.

Syntax

<SORTGEN

Notes

  • SORTGEN sorts members from the last generation, which is the leaf member of the dimension, to the first generation in the branch, which is the root of the dimension.

  • SORTGEN is not affected by other sort commands.

Example

The following example is based on Sample Basic.

<PAGE (Product, Measures)
East Sales
<COLUMN (Scenario, Year)

Actual Budget
Jan Feb Mar
<ROW (Market)
<SORTGEN
<IDESCENDANTS Market
     !
         

Which produces the following report:

                                      Product Sales 

                           Actual                     Budget           
                      Jan      Feb      Mar      Jan      Feb      Mar 
                 ======== ======== ======== ======== ======== ======== 
Market             31,538   32,069   32,213   29,480   30,000   30,200 
  East              6,780    6,920    6,921    6,180    6,350    6,360 
  West             10,436   10,564   10,674    9,460    9,530    9,640 
  South             3,976    4,082    4,055    3,870    3,970    3,990 
  Central          10,346   10,503   10,563    9,970   10,150   10,210 
New York            2,479    2,625    2,601    2,300    2,450    2,440 
Massachusetts       1,251    1,206    1,203    1,170    1,130    1,120 
Florida             1,321    1,383    1,428    1,170    1,250    1,290 
Connecticut         1,197    1,157    1,118    1,080    1,040    1,000 
New Hampshire         532      549      571      460      480      510 
California          3,602    3,699    3,755    3,450    3,490    3,570 
Oregon              1,741    1,667    1,650    1,590    1,530    1,500 
Washington          1,605    1,629    1,601    1,420    1,450    1,440 
Utah                1,388    1,397    1,424    1,320    1,320    1,350 
Nevada              2,100    2,172    2,244    1,680    1,740    1,780 
Texas               1,455    1,544    1,506    1,490    1,580    1,560 
Oklahoma              980      980    1,001      920      920      940 
Louisiana             978      980      948      900      910      900 
New Mexico            563      578      600      560      560      590 
Illinois            2,538    2,653    2,697    2,580    2,690    2,740 
Ohio                1,471    1,411    1,390    1,470    1,410    1,380 
Wisconsin           1,341    1,363    1,369    1,280    1,330    1,330 
Missouri            1,009    1,014    1,039      960      980    1,000 
Iowa                2,029    2,042    2,104    1,810    1,800    1,860 
Colorado            1,958    2,020    1,964    1,870    1,940    1,900