Dimensions, elements, hierarchies, and cubes

Dimensions, elements, hierarchies, and cubes are the building blocks of OLAP multidimensional databases.

A dimension is made up of a group of similar items. These items are called elements. A dimension can be used as a list of items that makes up columns or rows in a report. For example, the Region dimension contains the elements Germany, France, Italy, and Spain. The Account dimension contains the elements Revenues, Units, Variable Costs, and Gross Margin. The Product dimension is a list of all products. Dimensions contain no values, they are indices to the values contained in the cubes.

OLAP dimensions do not need to be flat lists, they can also be hierarchical, defined by parent-child relations. The highest level of the hierarchy is made up of base elements. Base elements point to data physically stored in the database. The parent-child relations define a set of automatic data aggregations. Numerical data related to dimension elements that are not base elements are calculated on the fly and never stored in the database.

Relationships between dimension elements can also be defined in plain English. For example:

Central Europe = Germany + France

Or:

Southern Europe = Spain + Italy

A single dimension can have multiple alternate hierarchies. Each alternate hierarchy has a unique name within the dimension. Base elements of the dimension are available to all alternate hierarchies. This means a base element can be used in one or more alternate hierarchies.

Cubes are the components of an OLAP database that contain data. A cube is a collection of dimensions assembled to create a matrix. For example, a three-dimensional cube that contains the Region, Account, and Month dimensions.

Cube diagram

By specifying the elements for a value, that value can be located and retrieved from the database or stored to the database.

In the diagram, the marked cube cell is specified by the elements Jan, Germany, and Units.

You can think of cube cells in a multidimensional cube in the same way as cells in a spreadsheet. The most apparent differences are that OLAP uses meaningful names to designate these cells and you are not limited to two dimensions.