![]() Previous |
![]() Next |
A simple MAINTAIN MOVE statement changes the position of one or more values in a non-concat dimension or a dimension of type TEXT, ID, or INTEGER. You cannot use the MOVE keyword of the MAINTAIN command with composites or with dimensions of type DAY, WEEK, MONTH, QUARTER, or YEAR.
Note: You can also issue a MAINTAIN MOVE statement for a surrogate dimension that has a Maintain trigger. In this case, Oracle OLAP only executes the Maintain trigger program; no other action occurs. See "Trigger Programs" for more information for more information. Issuing a MAINTAIN statement for a surrogate dimension that does not have a Maintain trigger, returns an error. |
Syntax
MAINTAIN dimension MOVE limit-clause
Parameters
A non-concat dimension, already defined in an attached analytic workspace, whose values are to be entered or changed. The dimension must be of type TEXT, ID, or INTEGER. You cannot specify a dimension of type DAY, WEEK, MONTH, QUARTER, or YEAR.
Specifies the values you want to move.
The syntax of limit-clause is the same syntax as any of the limit-clause arguments in the various forms of the LIMIT command (that is, the syntax of the LIMIT command after the limit-type argument such as "TO"). For the syntax of these arguments, see LIMIT (using values) command, LIMIT using LEVELREL command, LIMIT (using parent relation), LIMIT (using related dimension) command, LIMIT NOCONVERT command, and LIMIT command (using POSLIST).
Usage Notes
What Effects Performance of MAINTAIN MOVE
The performance cost of issuing a MAINTAIN MOVE command is dependent on the length of the dimension, not on the number of values being moved. Consequently, when moving values in a large dimension, do not issue several MAINTAIN MOVE statements one after another; instead, set up the dimension status to what you want and then issue a single MAINTAIN MOVE command.
Reordering or Sorting Values within a Dimension
When you want to reorder or sort dimension values using a MAINTAIN MOVE statement, to specify that you want to use all of the dimension values that are in status, use the STATUS keyword of the limit-clause argument of LIMIT (using values) command rather than a VALUES command.
Examples
Moving a Dimension Value to a Specific Position
This statement moves the position of the city Houston
to the position following the fifth dimension value.
MAINTAIN city MOVE 'Houston' AFTER 5
Moving a Dimension Value to the End of the Status List
In this example, you use the TEXT variable textvar
to move Seattle
to the end of the list of cities.
textvar = 'Seattle' MAINTAIN city MOVE textvar LAST
Moving Values of Concat Dimensions
The following statement moves the reg.dist.ccdim
concat dimension value <district: 'Denver'>
after the concat dimension value <region: 'West'>
.
MAINTAIN reg.dist.ccdim MOVE <district: 'Denver'> AFTER <region: 'West'>
The following statement moves the concat dimension value <district: 'Denver'>
after the position that corresponds to the first value of the component district
dimension. If the first value in the status of district
is Atlanta
, then <district: 'Denver'>
moves after the value <district: 'Atlanta'>
in the concat dimension.
MAINTAIN reg.dist.ccdim MOVE <district: 'Denver'> AFTER <district: 1>
The following statement moves the concat dimension value <district: 'Dallas'>
after the third value of the concat dimension.
MAINTAIN reg.dist.ccdim MOVE <district: 'Dallas'> AFTER 3