ArticleslgStudy

science

OLAP cube

OLAP cube is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand OLAP cube rather than just read about it. In short: An OLAP cube is a data cube, a multi-dimensional array of data, used for online analytical processing (OLAP), a computer-based technique of analyzing data to look for insights. Terminology A cube can be considered a multi-dimensional generalization of a two- or three-dimensional spreadsheet.

OLAP cube — main illustration
OLAP cube — illustration

Key takeaways

  • OLAP cube belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect OLAP cube to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of OLAP cube from memory before moving on to harder problems.

Reference excerpt

An OLAP cube is a data cube, a multi-dimensional array of data, used for online analytical processing (OLAP), a computer-based technique of analyzing data to look for insights.

Terminology A cube can be considered a multi-dimensional generalization of a two- or three-dimensional spreadsheet. For example, a company might wish to summarize financial data by product, by time-period, and by city to compare actual and budget expenses. Product, time, city and scenario (actual and budget) are the data's dimensions. Cube is a shorthand for multidimensional dataset, given that data can have an arbitrary number of dimensions. The term hypercube is sometimes used, especially for data with more than three dimensions. A cube is not a "cube" in the strict mathematical sense, as the sides are not all necessarily equal. But this term is used widely. A Slice is a term for a subset of the data, generated by picking a value for one dimension and only showing the data for that value (for instance only the data at one point in time). Spreadsheets are only 2-dimensional, so by (continued) slicing or other techniques, it becomes possible to visualize multidimensional data in them. Each cell of the cube holds a number that represents some measure of the business, such as sales, profits, expenses, budget and forecast. OLAP data is typically stored in a star schema or snowflake schema in a relational data warehouse or in a special-purpose data management system. Measures are derived from the records in the fact table and dimensions are derived from the dimension tables.

Hierarchy The elements of a dimension can be organized as a hierarchy, a set of parent-child relationships, typically where a parent member summarizes its children. Parent elements can further be aggregated as the children of another parent. For example, May 2005's parent is Second Quarter 2005 which is in turn the child of Year 2005. Similarly cities are the children of regions; products roll into product groups and individual expense items into types of expenditure.

Operations Conceiving data as a cube with hierarchical dimensions leads to conceptually straightforward operations to facilitate analysis. Aligning the data content with a familiar visualization enhances analyst learning and productivity. The user-initiated process of navigating by calling for page displays interactively, through the specification of slices via rotations and drill down/up is sometimes called "slice and dice". Common operations include slice and dice, drill down, roll up, and pivot.

Slice is the act of picking a rectangular subset of a cube by choosing a single value for one of its dimensions, creating a new cube with one fewer dimension. The picture shows a slicing operation: The sales figures of all sales regions and all product categories of the company in the year 2005 and 2006 are "sliced" out of the data cube.

Dice: The dice operation produces a subcube by allowing the analyst to pick specific values of multiple dimensions. The picture shows a dicing operation: The new cube shows the sales figures of a limited number of product categories, the time and region dimensions cover the same range as before.

Drill Down/Up allows the user to navigate among levels of data ranging from the most summarized (up) to the most detailed (down). The picture shows a drill-down operation: The analyst moves from the summary category "Outdoor protective equipment" to see the sales figures for the individual products.

Roll-up: A roll-up involves summarizing the data along a dimension. The summarization rule might be an aggregate function, such as computing totals along a hierarchy or applying a set of formulas such as "profit = sales - expenses". General aggregation functions may be costly to compute when rolling up: if they cannot be determined from the cells of the cube, they must be computed from the base data, either computing them online (slow) or precomputing them for possible rollouts (large space). Aggregation functions that can be determined from the cells are known as decomposable aggregation functions, and allow efficient computation. For example, it is easy to support COUNT, MAX, MIN, and SUM in OLAP, since these can be computed for each cell of the OLAP cube and then rolled up, since on overall sum (or count etc.) is the sum of sub-sums, but it is difficult to support MEDIAN, as that must be computed for every view separately: the median of a set is not the median of medians of subsets.

Pivot allows an analyst to rotate the cube in space to see its various faces. For example, cities could be arranged vertically and products horizontally while viewing data for a particular quarter. Pivoting could replace products with time periods to see data across time for a single product. The picture shows a pivoting operation: The whole cube is rotated, giving another perspective on the data.

Mathematical definition

In database theory, an OLAP cube is an abstract representation of a projection of an RDBMS relation. Given a relation of order N, consider a projection that subtends X, Y, and Z as the key and W as the residual attribute. Characterizing this as a function,

f : (X,Y,Z) → W, the attributes X, Y, and Z correspond to the axes of the cube, while the W value corresponds to the data element that populates each cell of the cube. Insofar as two-dimensional output devices cannot readily characterize three dimensions, it is more practical to project "slices" of the data cube (we say project in the classic vector analytic sense of dimensional reduction, not in the SQL sense, although the two are conceptually similar),

g : (X,Y) → W which may suppress a primary key, but still have some semantic significance, perhaps a slice of the triadic functional representation for a given Z value of interest. The motivation behind OLAP displays harks back to the cross-tabbed report paradigm of 1980s DBMS, and to earlier contingency tables from 1904. The result is a spreadsheet-style display, where values of X populate row $1; values of Y populate column $A; and values of g : ( X, Y ) → W populate the individual cells at intersections of X-labeled columns and Y-labeled rows, "southeast", so to speak, of $B$2, with $B$2 itself included.

See also

References

… excerpt ends here. Continue reading the full article.

Illustrations

OLAP cube: An example of an OLAP cube
An example of an OLAP cube
OLAP cube: OLAP slicing
OLAP slicing
OLAP cube: OLAP dicing
OLAP dicing
OLAP cube: OLAP drill-up and drill-down
OLAP drill-up and drill-down
OLAP cube: OLAP pivoting
OLAP pivoting

Worked examples

Example 1 — a first encounter with OLAP cube

Start with the simplest possible case. Write down what OLAP cube claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to OLAP cube before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about OLAP cube ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of OLAP cube

In research
OLAP cube appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses OLAP cube in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
OLAP cube is common in secondary-school and first-year university syllabi. It links to neighbouring topics Data warehousing, Online analytical processing, so understanding it makes those chapters shorter.
In everyday life
Look for OLAP cube outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “OLAP cube” →

How to study OLAP cube in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what OLAP cube means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain OLAP cube out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is OLAP cube in simple terms?

An OLAP cube is a data cube, a multi-dimensional array of data, used for online analytical processing (OLAP), a computer-based technique of analyzing data to look for insights. Terminology A cube can be considered a multi-dimensional generalization of a two- or three-dimensional spreadsheet.

Why does OLAP cube matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study OLAP cube?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on OLAP cube.

Tags

  • Data warehousing
  • Online analytical processing

Keep exploring