Skip Headers

Oracle9i OLAP Developer's Guide to the OLAP DML
Release 2 (9.2)

Part Number A95298-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Aggregating Data, 9 of 12


Creating Custom Aggregates

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:

  1. Create a dimension value for the custom aggregate. The following command adds `bb' to the letter dimension:
    maintain letter add 'bb'
    
    
  2. Create a 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')
    
    
  3. Execute an 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
    
    
  4. The model is executed only by the AGGREGATE function like the one shown here; the AGGREGATE command ignores it.
    REPORT AGGREGATE(units USING letter.aggmap)
    
    
  5. If you wish to remove the model from the aggregation map during a session, use the AGGMAP REMOVE command.


    Important:

    The AGGMAP ADD command is automatically removed from an aggmap object at the end of a session.



Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 2001, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback