Oracle9i OLAP Services Developer's Guide to the OLAP DML Release 1 (9.0.1) Part Number A86720-01 |
|
Defining Data Objects, 3 of 9
A dimension is an OLAP DML object that holds a list of values that provide the organization for one or more OLAP DML variables. A dimension value is similar to a key in a relational analytic workspace; it acts as an index to data. For example, if you have sales data with a separate sales figure for each month, then the data has a MONTH dimension; that is, the data is organized by month. The dimension values you add might be Feb98, Mar98, and Apr98.
Dimension values let you identify your data and provide an easy way to target the data you need for a particular purpose. When your users display or analyze your data, they select the values to work with.
OLAP DML supports both flat and hierarchical dimensions:
Note: When you define a variable using the SPARSE keyword, an internal object called a composite is automatically created. A composite shares some of the characteristics of a dimension and contains values that are combinations of values in other dimensions. For more information on composites, see "Defining Variables That Handle Sparse Data Efficiently".
If you want your analytic workspace to contain only flat dimensions, you need to define dimensions for each level of detail in your data that users will access.
For example, if your company is divided into sales districts and each district handles several store accounts, then you need to decide whether you want sales figures for every store or only for each district. As shown in the following table, the answer to this question determines the structure of your analytic workspace.
Sometimes, you will decide to store data of varying levels of aggregation within a single variable, because this type of storage affords a quicker response time for users who want to view the data. In this case, you need to define a hierarchical dimension.
For example, if you want to look at data both ways instead of defining both a STORE and a DISTRICT dimension as described above, then you can define a single hierarchical dimension. This hierarchical dimension would contain all of the values for stores and districts. If you dimension a variable by this hierarchical dimension then you can store data of varying levels of aggregation within that single variable. You can still view store data and district data separately.
The data for a simple flat dimension is stored in a one-dimensional array. As you add values to the dimension, it stores each new value at the end of the array.
Assume that the PRODUCT dimension has been defined as a TEXT data type. The first three values that are added to the dimension are TENTS, CANOES, and RACQUETS. At this point, a report of the dimension shows the following values.
PRODUCT -------------- TENTS CANOES RACQUETS
The values are actually stored as shown below.
PRODUCT Dimension |
|||
---|---|---|---|
Position |
1 |
2 |
3 |
Value |
|
|
|
Later, the values SPORTSWEAR and FOOTWEAR are added. At this point, a report of the dimension shows the following values.
PRODUCT -------------- TENTS CANOES RACQUETS SPORTSWEAR FOOTWEAR
Now the dimension array looks like the following figure.
PRODUCT Dimension |
|||||
---|---|---|---|---|---|
Position |
1 |
2 |
3 |
4 |
5 |
Value |
|
|
|
|
|
For more information, see the following table.
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|