Oracle9i OLAP User's Guide Release 2 (9.2.0.2) Part Number A95295-02 |
|
|
View PDF |
In the Sales History sample schema, COSTS
is a fact table with the following columns.I
Column Name | Data Type |
---|---|
|
|
|
|
|
|
|
|
The following statements create a logical CWM2
cube object, ANALYTIC_CUBE
, for the COSTS
fact table. The dimensions of the cube are: PRODUCT_DIM
, shown in "Example: Creating OLAP Metadata for a Dimension Table", and TIME_DIM
, a time dimension mapped to a table TIME
.
--- Create the ANALYTIC_CUBE Cube --- cwm2_olap_cube.create_cube('SH', 'ANALYTIC_CUBE', 'Analytics', 'Analytic Cube','Unit Cost and Price Analysis'); --- Add the dimensions to the cube --- cwm2_olap_cube.add_dimension_to_cube('SH', 'ANALYTIC_CUBE', 'SH', 'TIME_DIM'); cwm2_olap_cube.add_dimension_to_cube('SH', 'ANALYTIC_CUBE', 'SH', 'PRODUCT_DIM'); --- Create the measures --- cwm2_olap_measure.create_measure('SH', 'ANALYTIC_CUBE', 'UNIT_COST', 'Unit Cost','Unit Cost', 'Unit Cost'); cwm2_olap_measure.create_measure('SH', 'ANALYTIC_CUBE', 'UNIT_PRICE', 'Unit Price','Unit Price', 'Unit Price'); --- Create the mappings --- cwm2_olap_table_map.Map_FactTbl_LevelKey ('SH', 'ANALYTIC_CUBE','SH', 'COSTS', 'LOWEST LEVEL', 'DIM:SH.PRODUCTS/HIER:STANDARD/LVL:L4/COL:PROD_ID; DIM:SH.TIME/HIER:CALENDAR/LVL:L3/COL:MONTH;'); cwm2_olap_table_map.Map_FactTbl_Measure ('SH', 'ANALYTIC_CUBE','UNIT_COST', 'SH', 'COSTS', 'UNIT_COST', 'DIM:SH.PRODUCTS/HIER:STANDARD/LVL:L4/COL:PROD_ID; DIM:SH.TIME/HIER:CALENDAR/LVL:L3/COL:MONTH;'); cwm2_olap_table_map.Map_FactTbl_Measure ('SH', 'ANALYTIC_CUBE','UNIT_PRICE', 'SH', 'COSTS', 'UNIT_PRICE', 'DIM:SH.PRODUCTS/HIER:STANDARD/LVL:L4/COL:PROD_ID; DIM:SH.TIME/HIER:CALENDAR/LVL:L3/COL:MONTH;');