n alternative way of displaying the data using a cube is shown in Figure 16.4.
Here the independent variables (year, region, and category) appear as the dimensions
making up the edges of the cube, and the values for the dependent variable or measure
(units sold) appear in the relevant cells. Only the software sales figures are shown here
in the 12 cells making up the front half of the cube. You can imagine seeing the hardware
sales figures by rotating the cube to see its other side.
OLAP cubes can be much more complex than this example. For any set of independent
dimensions, there may be more than one measure (e.g., units sold, and revenue).
These different measures are often collectively referred to as the Measures dimension.
Moreover, each independent dimension typically has a hierarchy of levels.
For example, a Location dimension might have regions at its top level, composed of
states at the second level, with cities at the third level, and stores at the fourth level.
Similarly a Time dimension may be decomposed into Years, then Quarters, then
Months, and then Days. Finally, the Item dimension may be decomposed into categories
and then items.
So our data mart example can be used to construct a cube with three independent,
hierarchical dimensions (Location, Time, and Item) and one dependent dimension for
UnitsSold and Revenue measures. The neat thing about the cube structure is that it
enables aggregate values for the measures to be efficiently stored and accessed for all
levels of the hierarchies. When analyzing a cube, you can choose to consolidate or
rollup these aggregates (e.g., roll up sales figures for cities to regional sales figures).
You can also do the opposite, drilling down to a finer level of granularity. Moreover
you can slice and dice the cube whichever way you like by taking a subcube of it (e.g.,
if you restrict the item category in Figure 16.4 to software, you get the front slice of
the cube)