Oracle9i OLAP Developer's Guide to the OLAP DML Release 2 (9.2) Part Number A95298-01 |
|
Aggregating Data, 9 of 12
Most aggregates are defined with a parent relation that identifies the parent-child relationships within the dimension. However, users may wish to create their own aggregates at runtime, perhaps for forecasting or what-if analysis, or just because they want to view the data in an unforeseen way. This is the process by which a custom aggregate is created:
bb
' to the letter dimension:
maintain letter add 'bb'
MODEL
object that contains an AGGREGATION
function, which associates child dimension values with the new dimension value. The following model identifies bb
as the parent of aab
and aba
. Note that the parent dimension value (in this case, bb
) cannot already be defined as a parent in the parent relation (letter.letter
).
DEFINE LETTER.MODEL MODEL MODEL DIMENSION letter bb=AGGREGATION('aab' 'aba')
AGGMAP ADD
command to append the model to an existing AGGMAP
object.
AGGMAP ADD letter.model TO letter.aggmap
The aggregation map from Example 12-8 now looks like this:
DEFINE LETTER.AGGMAP AGGMAP AGGMAP RELATION letter.letter PRECOMPUTE ('aa') END AGGMAP ADD letter.model
AGGREGATE
function like the one shown here; the AGGREGATE
command ignores it.
REPORT AGGREGATE(units USING letter.aggmap)
AGGMAP REMOVE
command.
|
Copyright © 2001, 2002 Oracle Corporation. All Rights Reserved. |
|