![]() Previous |
![]() Next |
The ALLOCMAP command identifies an aggmap object as an allocation specification and enters the contents of the specification. To use AGGMAP to assign an allocation specification to n aggmap object, the definition must be the one most recently defined or considered during the current session. When it is not, you must first use a CONSIDER statement to make it the current definition.
An alternative to the AGGMAP command is the EDIT AGGMAP command, which is available only in OLAP Worksheet. The EDIT AGGMAP command opens an Edit window in which you can delete or change an allocation specification for an aggmap object. To use the OLAP Worksheet, to code an allocation specification follow the instructions given in "Editing a Newly Defined Aggmap to Code an Allocation Specification".
Syntax
ALLOCMAP [specification]
Parameters
A multiline text expression that is the allocation specification for the current aggmap object. An allocation specification begins with an ALLOCMAP statement and ends with an END
statement. Between these statements, you code one or more of the following statements depending on the calculation that you want to specify:
Each statement is a line of the multiline text expression. When coding an ALLOCMAP statement at the command line level, separate statements with newline delimiters (\n
), or use JOINLINES.
For a discussion of how to determine which statements to include, see "Designing an Allocation Specification".
Usage Notes
Designing an Allocation Specification
Minimally, an allocation specification consists of a RELATION statement or a VALUESET statement However, you can create more complex allocation specifications and change the default settings for error handling by including additional OLAP DML statements in the specification, as follows:
For hierarchical allocations, a RELATION statement that specifies a self-relation that identifies the child-parent relationships of the hierarchy. List the statements in the order in which you want to perform the various operations; or if this is not important, list the RELATION statements in the same order as the dimensions appear in the variable definition.
For non-hierarchical allocations, a VALUESET statement that specifies the values to be used when allocating.
A CHILDLOCK statement that tells the ALLOCATE command whether to determine if RELATION statements in the aggmap specify lock on both a parent and a child element of a dimension hierarchy.
A DEADLOCK statement that tells the ALLOCATE command whether to continue an allocation when it encounters a deadlock, which occurs when the allocation cannot distribute a value because the targeted cell is locked or, for some operations, has a basis value of NA.
When a dimension is not shared by the target variable and the source or the basis objects, a DIMENSION (for allocation) statement that specifies a single value to set as the status of that dimension.
An ERRORLOG statement that specifies how many errors to allow in the error log specified by the ALLOCATE command and whether to continue the allocation when the maximum number of errors has occurred.
An ERRORMASK statement that specifies which error conditions to exclude from the error log.
When the source data comes from a variable, a SOURCEVAL statement that specifies whether ALLOCATE changes the source data value after the allocation.
Aggmap Type
You can use the AGGMAPINFO function to learn the type of an aggmap. An aggmap into which you have entered an allocation specification using the ALLOCMAP has the type ALLOCMAP and an aggmap into which you have entered an aggregation specification using an AGGMAP statement has the type AGGMAP. When you have defined an aggmap but have not yet entered a specification in it, its type is NA
.
One RELATION for Each Dimension
An aggmap can have only one RELATION statement for any given dimension.
One Hierarchy For Each Dimension
An allocation operation proceeds down only one hierarchy in a dimension. When a dimension has multiple hierarchies, then you must limit the dimension to a hierarchy with a qualified data reference after the rel-name argument.
Examples
Allocation Specification from an Input File
In this example an aggmap and its specification are defined in an ASCII disk file called salesalloc.txt
. The statements in the file are then executed in the analytic workspace through the use of the INFILE statement. The statements in salesalloc.txt
are the following.
IF NOT EXISTS ('salesalloc') THEN DEFINE salesalloc AGGMAP ELSE CONSIDER salesalloc ALLOCMAP RELATION time.parent OPERATOR EVEN RELATION product.parent OPERATOR EVEN RELATION geography.parent OPERATOR EVEN SOURCEVAL ZERO DEADLOCK SKIP END
To include the salesalloc
aggmap in your analytic workspace, execute the following statement.
INFILE 'salesalloc.txt'
The sales.agg
aggmap has now been defined and contains three RELATION statements and the SOURCEVAL and DEADLOCK statements. In this example, the ALLOCATE statement allocates its source value evenly to all of the aggregate level cells and the detail level cells of the target variable because the relations time.parent
, product.parent
, and geography.parent
relate each child dimension value to its parent in the dimension hierarchy. The DEADLOCK statement tells the ALLOCATE statement to log an error and continue the allocation when a branch of a target hierarchy is locked or has a value of NA
. The SOURCEVAL statement tells ALLOCATE to assign a zero value to the source cells after allocating the source data.
You can now use the salesalloc
aggmap with an ALLOCATE statement, such as.
ALLOCATE sales USING salesalloc
Allocation Specification from a Text Expression
In this example the salesalloc
aggmap has already been defined. The specification is added to the aggmap as a text expression argument to the ALLOCMAP statement.
CONSIDER salesalloc ALLOCMAP RELATION time.parent OPERATOR EVEN RELATION product.parent OPERATOR EVEN RELATION geography.parent OPERATOR EVEN SOURCEVAL ZERO DEADLOCK SKIP
Specifying a Single Dimension Value in an Allocation Specification
This example proportionally allocates a value it calculates from the sales
variable to cells in a projectedsales
variable. The sales
variable is dimensioned by the time
, product
, customer
, and channel
dimensions.
The example defines the projectedsales
variable to use as the target of the allocation and the increasefactor
formula to use as the source. The formula multiplies values from sales
by ten percent. The example limits the time
dimension and creates the ytoq.rel
relation, which relates the year 2001 to the quarters of 2002. The next LIMIT commands limit the dimensions shared by sales
and projectedsales
.
The example creates an aggmap and uses the ALLOCMAP statement to enter a RELATION and a DIMENSION statement into the map. The RELATION statement specifies the ytoq.rel
relation as the dimension hierarchy to use for the allocation and specifies that the allocation is proportional. The DIMENSION statement tells ALLOCATE to set the status of the channel
dimension to totalchannel
for the duration of the allocation.
DEFINE projectedSales DECIMAL VARIABLE <time, SPARSE <product, customer>> DEFINE increaseFactor DECIMAL FORMULA <product> EQ sales * 1.1 LIMIT time TO '2001' 'Q1.02' TO 'Q4.02' DEFINE YtoQ.rel RELATION time <time> LIMIT time TO 'Q1.02' to 'Q4.02' YtoQ.rel = '2001' LIMIT time TO '2001' 'Q1.02' to 'Q4.02' LIMIT product TO 'TotalProduct' 'Videodiv' 'Audiodiv' 'Accdiv' LIMIT customers TO 'TotalCustomer' DEFINE time.alloc AGGMAP ALLOCMAP RELATION YtoQ.rel OPERATOR PROPORTIONAL DIMENSION channel 'TotalChannel' END ALLOCATE increaseFactor BASIS sales TARGET projectedSales USING time.alloc
The sales
values that are the basis of the allocation are the following.
CHANNEL: TOTALCHANNEL CUSTOMERS: TOTALCUSTOMER ---------------PROJECTEDSALES--------------- --------------------TIME-------------------- PRODUCT 2001 Q1.02 Q2.02 Q3.02 Q4.02 ------------ ------ ------ ------ ------ ------ TotalProduct 7000 1000 2000 3000 1000 Videodiv 4100 600 1100 1900 500 Audiodiv 1700 200 600 600 300 Accdiv 1200 200 300 500 200
The following shows a report of projectedsales
for totalchannel
after the allocation.
CHANNEL: TOTALCHANNEL CUSTOMERS: TOTALCUSTOMER ---------------PROJECTEDSALES--------------- --------------------TIME-------------------- PRODUCT 2001 Q1.02 Q2.02 Q3.02 Q4.02 ------------ ------ ------ ------ ------ ------ TotalProduct NA NA NA NA NA Videodiv NA 660 1210 2090 550 Audiodiv NA 220 660 660 330 Accdiv NA 220 330 550 220
Entering RELATION Statements in an Allocation Specification
This example defines a time.type
dimension and adds to it the two hierarchies of the time
dimension. It defines the time.time
relation that relates the hierarchy types (that is, time.type
) to the time
dimension. The example defines the time.alloc
aggmap. With the ALLOCMAP command, it enters a RELATION statement in the aggmap. The RELATION statement specifies the values of the time
dimension hierarchy to use in the allocation, limits the time
dimension to one hierarchy with the QDR, and the specifies the EVEN operation for the allocation. The ALLOCATE command then allocates data from the source object to the target variable using the time.alloc
aggmap. In the ALLOCATE command the source, basis, and target objects are the same sales
variable.
DEFINE time.type TEXT DIMENSION MAINTAIN time.type add 'Fiscal' MAINTAIN time.type add 'Calendar' DEFINE time.time RELATION time <time, time.type> DEFINE time.alloc AGGMAP ALLOCMAP RELATION time.time (time.type 'Fiscal') OPERATOR EVEN END ALLOCATE sales USING time.alloc