ORDER

Specifies the order of columns in a report, based on the original ordering of the columns.

Make sure you specify all the report columns in the ORDER command unless you use FIXCOLUMNS. ORDER simply moves the listed columns to locations in the final report but does not shift the unlisted columns to make room for the columns moved. If you have a five column report and you specify the command {ORDER 2 3 4}, you see columns 2, 3 and 4 in the report followed again by columns 3 and 4. If you really want a 3 column report, use {FIXCOLUMNS 3}.

Calculated data columns have column numbers which begin after the last regular data column. In other words, if each output data row had:

  • 2 row names;

  • 3 regular data columns; and

  • 2 calculated data columns

then columns 0 and 1 are the row name column numbers; 2, 3, and 4 are the regular data column numbers; and 5 and 6 are the calculated-data column members.

Syntax

{ ORDER columnList }

Parameters

columnList

Numeric designations of the columns to rearrange, separated by a space between each column number.

Each column number represents the initial positions of each column (from 0 to n where n is the last column, counting names, data, and calculated columns, respectively).

The position of each number in the columnList represents the new order in which you want the columns to be displayed.

Note:

Using the ORDER command without a columnList resets the column order to the default setting (that is, 0, 1, 2, 3, 4, and so on).

Notes

  • ORDER is a setting command.

  • The first name column is designated as column 0. Column numbers then increment, starting with any additional row name columns, then the data columns, followed by calculated data columns.

Example

The following example is based on the Sample Basic database.

<PAGE (Measures, Market)
Texas Sales
{ORDER 0 1 4 2 5 3 6 BLOCKHEADERS}
     <COLUMN (Scenario, Year)
     Actual Budget
     Jan Feb Mar
<ROW (Product)
<DESCENDANTS "100"
     !

This script arranges the Jan, Feb, and Mar columns side-by-side.

                                      Sales Texas 
                   Actual   Budget   Actual   Budget   Actual   Budget 
                      Jan      Jan      Feb      Feb      Mar      Mar    
                 ======== ======== ======== ======== ======== ======== 
100-10                452      560      465      580      467      580 
100-20                190      230      190      230      193      240 
100-30           #Missing #Missing #Missing #Missing #Missing #Missing