MAINTAIN MOVE dimension value


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 OALP 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 dim-arg

Arguments

dimension

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.

dim-arg

Specifies the values to be moved. You can specify these values using the same syntax that you use for limit-clause in the LIMIT command.


See::

There are several types of limit clauses. Because the complete syntax for each type of limit clause is complex, there are individual LIMIT entries for each type of clause:
LIMIT command (using values)
LIMIT command (using LEVELREL)
LIMIT command (using related dimension)
LIMIT command (using parent relation)
LIMIT command (NOCONVERT)
LIMIT command (using POSLIST)

Notes

Sorting Values

You can sort the values of a dimension with the following statements.

LIMIT dimension TO ALL
SORT dimension A sort-criterion
MAINTAIN dimension MOVE VALUES(dimension) FIRST

The sorting criterion can be any expression you choose (see the SORT command). To sort the dimension alphabetically, use the dimension itself as the criterion (see Example: Moving Dimension Values into Sorted Order. After using the SORT command to sort the dimension values, you use the MAINTAIN command to make the sorted order permanent.

You can use the SORT command for a temporary sort of the values of a dimension with a type of DAY, WEEK, MONTH, QUARTER, or YEAR. For example, you might want to use the sorted order in a report. However, you cannot use the MAINTAIN command to save the sorted order as the permanent order of a dimension with the type of DAY, WEEK, MONTH, QUARTER, or YEAR. The values of these types of dimensions must be stored in increasing chronological order.

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 Dimension Values into Sorted Order

Here you put the values of city in alphabetical order.

SORT city A city
MAINTAIN city MOVE VALUES(city) FIRST

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