Data Mining and Data Warehousing

Chapter 5
OLAP, Business Intelligence and Reporting

Bachelors Program in AI & ML
Data Mining and Data Warehousing   •   Bachelor

OLAP, Business Intelligence and Reporting

Introduction and Context

Organizations collect data from transaction-processing systems, websites, sensors, enterprise applications, and external sources. Raw data, however, does not automatically support good decisions. Managers need timely answers to questions such as: Which products are most profitable? How do sales vary by region and quarter? Which customers are becoming inactive? What operational conditions are associated with delayed delivery?

Online Analytical Processing (OLAP), business intelligence (BI), and reporting provide the structures and tools needed to answer such questions. OLAP organizes data for multidimensional analysis. BI combines data, technologies, processes, and people to support evidence-based decisions. Reporting communicates information through tables, charts, dashboards, alerts, and narrative explanations.

This chapter explains multidimensional models, facts and dimensions, data cubes, aggregation, roll-up, drill-down, slice, dice, and pivot operations. It also examines dashboard and KPI design, self-service analytics, governance, limitations, and practical implementation.

Learning Objectives

After completing this chapter, students should be able to:

1. Explain the purposes and architecture of OLAP and BI.

2. Design a multidimensional model using facts, dimensions, measures, and hierarchies.

3. Apply roll-up, drill-down, slice, dice, and pivot operations.

4. Distinguish additive, semi-additive, and non-additive measures.

5. Design meaningful KPIs, reports, and dashboards.

6. Evaluate self-service analytics, governance, performance, and ethical risks.

7. Use analytical results to support organizational decisions.

1. From Operational Data to Analytical Information

Operational systems are optimized for recording business events. A point-of-sale system records an individual purchase, while a payroll system records an employee payment. Such systems usually emphasize transaction consistency, rapid updates, and normalized data structures. Analytical systems emphasize historical comparison, aggregation, exploration, and complex queries.

A common BI architecture contains the following layers:

  • Source systems: Enterprise resource planning, customer relationship management, websites, sensors, spreadsheets, and external datasets.
  • Data integration layer: Processes extract, transform, and load (ETL) data into analytical storage. Modern pipelines may also use extract, load, and transform (ELT).
  • Data warehouse or lakehouse: A governed repository containing integrated, historical, and analysis-ready data.
  • Semantic or OLAP layer: Business concepts such as revenue, customer, region, and fiscal quarter are defined consistently.
  • Analytics and presentation layer: Reports, dashboards, ad hoc queries, alerts, and machine-learning applications.
  • Governance layer: Security, quality management, metadata, lineage, privacy, and compliance controls.

A data warehouse is not merely a large database. It is designed to provide a consistent analytical view of the organization. Typical warehouse characteristics include subject orientation, integration across sources, historical persistence, and relative stability after data loading.

2. The Multidimensional Model

The multidimensional model represents business activity using measurable events and descriptive contexts. Its principal elements are facts, dimensions, measures, and hierarchies.

2.1 Facts and Fact Tables

A fact is a business event or state that can be analyzed, such as a sale, shipment, insurance claim, website session, or bank transaction. A fact table normally contains foreign keys to dimensions and numerical measures.

For example, a retail sales fact table may contain:

  • Date key
  • Product key
  • Store key
  • Customer key
  • Quantity sold
  • Sales amount
  • Discount amount
  • Cost amount

The grain of a fact table specifies exactly what one row represents. For example, “one row per product per receipt line” is a clear grain. Grain must be declared before selecting measures; otherwise, double counting and incorrect joins may result.

2.2 Dimensions

A dimension describes the context of a fact. Common dimensions include time, product, customer, employee, store, supplier, and geography. Dimensions often contain descriptive attributes used for filtering and grouping.

A product dimension might include product name, brand, category, department, package size, and supplier. A geography dimension might include city, state, country, and sales territory.

Dimensions frequently contain hierarchies. A time hierarchy may be:

Day → Month → Quarter → Year

A geographic hierarchy may be:

Store → City → Region → Country

Hierarchies support navigation between levels of detail.

2.3 Measures and Their Additivity

A measure is a numerical value analyzed in relation to dimensions. Measures should be classified according to how safely they can be aggregated.

  • Additive measures can be summed across all relevant dimensions. Sales revenue and units sold are usually additive.
  • Semi-additive measures can be summed across some dimensions but not others. An account balance can be summed across accounts, but summing balances across dates usually produces a meaningless result.
  • Non-additive measures cannot generally be summed. Percentages, ratios, and unit prices are examples.

For non-additive measures, the correct aggregate is often calculated from underlying components. For example, the overall profit margin should normally be calculated as:

\[

\text{Profit Margin} = \frac{\text{Total Revenue} - \text{Total Cost}}{\text{Total Revenue}} \times 100

\]

Revenue and cost must refer to the same population and period, and revenue must be nonzero. Averaging individual store margins may produce a different and often misleading result because it gives equal weight to stores of different sizes.

2.4 Star and Snowflake Schemas

In a star schema, a central fact table connects directly to denormalized dimension tables. It is simple, intuitive, and often efficient for BI queries.

In a snowflake schema, dimensions are normalized into several related tables. This can reduce redundancy but increases joins and may make business-user exploration more complex.

A star schema is often appropriate when query simplicity and usability are priorities. A snowflake design may be useful when dimensions are very large, shared across processes, or require strong normalization. Neither schema is universally superior; the choice depends on data volume, governance, performance, and maintenance requirements.

3. OLAP Cubes and Analytical Operations

An OLAP cube is a conceptual structure that organizes measures across multiple dimensions. A cube does not necessarily mean a physical three-dimensional object. A sales cube might contain dimensions of time, product, and geography, while a practical implementation may include many more dimensions.

Suppose a business stores sales by product, month, and region. A cell in the cube represents a particular combination, such as sales of Product A in March in the Northern Region. Cube queries can retrieve detailed values or aggregates across dimension levels.

3.1 Aggregation and Cuboids

A complete cube can contain many aggregations, called cuboids. For example, sales may be available by day, month, quarter, product, category, store, and region. Precomputing selected aggregates can make queries fast, but storing every possible combination can consume substantial storage.

Designers therefore choose a balance between query performance, storage, refresh time, and maintenance. Aggregation strategies include materialized views, summary tables, database indexes, columnar storage, and in-memory caches.

3.2 Roll-Up

Roll-up summarizes data by moving upward in a hierarchy or by reducing dimensions. For example, daily sales can be rolled up to monthly sales, or store sales can be rolled up to regional sales.

A roll-up is valid only when the aggregation function is appropriate. Summing daily revenue to monthly revenue is generally valid. Summing daily account balances is not normally meaningful; an ending balance or average balance may be required instead.

3.3 Drill-Down

Drill-down moves from a summary to more detailed information. A manager may begin with annual sales, drill down to quarters, then months, stores, and individual transactions. Drill-down is useful for identifying the source of an unusual aggregate, but excessive detail can obscure the main decision.

3.4 Slice and Dice

A slice selects a single value from one dimension. For example, a report may show sales for the fiscal year 2025 only.

A dice selects a subcube using several restrictions. For example, a user may analyze sales for two product categories, three regions, and the first two quarters.

Slice and dice are filtering operations, but they should not be confused with arbitrary data cleaning. A filter changes the analytical population; it does not correct missing, duplicated, or invalid data.

3.5 Pivot

A pivot, or rotate, changes the arrangement of dimensions in a report. A table may initially show regions as rows and months as columns; pivoting may show months as rows and regions as columns. The underlying data does not change, but the presentation may reveal patterns more clearly.

4. Worked Example: Retail Sales Cube

Consider the following simplified records, where the grain is one product-category sale for one region in one month:

| Month | Region | Category | Revenue | Cost |

|---|---|---|---:|---:|

| January | North | Electronics | 10,000 | 7,000 |

| January | North | Furniture | 6,000 | 4,200 |

| February | North | Electronics | 12,000 | 8,400 |

| February | North | Furniture | 5,000 | 3,500 |

| January | South | Electronics | 8,000 | 5,600 |

| January | South | Furniture | 7,000 | 4,900 |

A roll-up from category to region for January in the North gives revenue of:

\[

10{,}000 + 6{,}000 = 16{,}000

\]

and cost of:

\[

7{,}000 + 4{,}200 = 11{,}200.

\]

The correct regional margin is:

\[

\frac{16{,}000-11{,}200}{16{,}000}\times100 = 30\%.

\]

A slice selecting January produces all January records. A dice selecting North and the Electronics category produces the January and February North Electronics records. A pivot could place months in rows and categories in columns.

This example also demonstrates why margin should be calculated from total revenue and total cost. The category margins are both 30 percent in this particular example, but equal margins should not be assumed in general. If categories have different revenues, an unweighted average of their margins will not necessarily equal the combined margin.

5. Business Intelligence and Decision Support

BI is an organizational capability rather than a single software product. It includes data architecture, analytical methods, governance, processes, and user skills. BI supports several decision levels:

  • Operational decisions: Which orders require attention today?
  • Tactical decisions: Which stores need additional inventory next month?
  • Strategic decisions: Should the organization enter a new market?

Descriptive analytics explains what happened. Diagnostic analytics investigates why it happened. Predictive analytics estimates what may happen, while prescriptive analytics compares possible actions. OLAP and reporting are especially central to descriptive and diagnostic work, but their outputs may also become features or monitoring inputs for predictive systems.

A trustworthy BI result requires more than an attractive visualization. Users need definitions, data lineage, refresh time, population scope, filters, and limitations. A dashboard displaying “customer churn” is incomplete unless churn is defined, such as customers with no qualifying purchase for a specified period.

6. KPI and Metric Design

A metric is a measured quantity. A key performance indicator (KPI) is a metric judged to be especially important for a defined objective and accompanied by a target, threshold, or interpretation.

Effective KPI design begins with the decision or objective. A logistics organization may use on-time delivery rate, but the definition must specify the denominator, delivery window, exclusions, and data source. A generic rate can be expressed as:

\[

\text{Rate} = \frac{\text{Number of qualifying events}}{\text{Number of eligible events}} \times 100

\]

The numerator must be a subset of the denominator, and both must use the same time period and eligibility rules. A rate without a stable denominator can create false impressions of improvement.

Good KPIs are relevant, understandable, measurable, comparable over time, and connected to action. Too many KPIs create attention dilution. Targets should also avoid encouraging harmful gaming. For example, measuring call-center staff only by call duration may encourage premature call termination and reduce service quality.

7. Reports and Dashboard Design

A report is generally a structured presentation intended for recurring or detailed consumption. A dashboard is usually a compact visual interface that highlights status, trends, exceptions, and actions. The distinction is not absolute, but reports often emphasize completeness while dashboards emphasize rapid monitoring.

A well-designed dashboard should:

1. Identify its audience and decision purpose.

2. Present the most important measures first.

3. Use consistent definitions and units.

4. Show comparisons, such as target versus actual or current versus prior period.

5. Use appropriate visual encodings.

6. Provide filters without allowing misleading combinations.

7. Display refresh time and data quality warnings.

8. Support drill-through when investigation is necessary.

9. Remain readable on the intended device.

Line charts are often suitable for time trends, bars for category comparisons, and maps for genuinely geographic questions. Pie charts can be difficult to compare when there are many categories. Color should communicate meaning consistently; red may indicate a problem, but color should not be the only method of communicating status because of accessibility needs.

Dashboard design must avoid decorative complexity, three-dimensional effects, excessive gauges, truncated axes that exaggerate differences, and unexplained percentages. A visualization should make the intended comparison easier, not merely make the screen attractive.

8. Self-Service Analytics

Self-service BI allows business users to explore governed data without requesting every query from a technical team. Benefits include faster investigation, local expertise, and reduced reporting backlog. Risks include inconsistent definitions, uncontrolled data copying, privacy violations, duplicated reports, and poor statistical interpretation.

A sustainable self-service model combines autonomy with guardrails. Important practices include:

  • Certified datasets and semantic models.
  • A business glossary and metric catalog.
  • Role-based access control.
  • Row-level security where users should see only permitted records.
  • Data lineage and ownership information.
  • Training in visualization, statistics, and data ethics.
  • A review process for high-impact dashboards.
  • Archiving of obsolete content.

Self-service does not mean that every user should directly access raw production tables. Curated analytical models reduce ambiguity and protect operational systems.

9. Illustrative Case: Regional Retail Performance

Background

The fictional retailer Meridian Home sells electronics and furniture through stores in four regions. Executives receive monthly spreadsheets, but regional managers report conflicting revenue figures and cannot easily investigate declining margins.

Problem

The organization needs a common view of sales, profitability, inventory, and delivery performance. Existing reports use different fiscal calendars and calculate margin by averaging store percentages.

Analysis

A data audit finds that sales systems identify products differently, store regions have changed over time, and canceled orders are inconsistently excluded. The apparent margin decline is partly caused by a reporting definition rather than actual performance.

Approach and Solution

The BI team defines the grain as one completed order line. It creates conformed date, product, store, customer, and promotion dimensions. Historical region assignments are preserved using an appropriate slowly changing dimension approach. Revenue, cost, discount, and units are stored as measures. Margin is calculated from aggregated revenue and cost rather than averaged store margins.

The executive dashboard shows total revenue, gross margin, units, on-time delivery, and inventory coverage. A regional manager can slice the dashboard by region, dice it by category and quarter, drill down from region to store, and pivot between monthly and category views. Certified definitions and refresh timestamps appear beside each KPI.

Outcome

Managers identify that the margin reduction is concentrated in a furniture category sold under a high-discount promotion. They also discover that late deliveries are concentrated in two distribution centers. The new model reduces contradictory reports and enables managers to investigate causes rather than debate totals.

Learning Points

The case illustrates that BI success depends on grain, shared definitions, historical modeling, and decision-oriented presentation. Visualization cannot repair incorrect data or ambiguous measures. Governance and usability must be designed together.

10. Challenges, Governance, and Ethics

Data Quality and Semantic Consistency

Missing values, duplicate transactions, late-arriving data, incorrect time zones, and inconsistent product codes can invalidate analysis. Quality rules should monitor completeness, validity, uniqueness, consistency, and timeliness. Data owners should document known limitations rather than conceal them.

Security and Privacy

Analytical data may contain personal, financial, health, or employment information. Access should follow least privilege. Sensitive attributes may require masking, aggregation, pseudonymization, retention limits, and audit logging. Legal obligations vary by jurisdiction, but responsible practice requires a legitimate purpose, transparency, controlled access, and appropriate protection.

Small-cell reporting can also create re-identification risks. A dashboard showing a single employee, patient, or customer group may reveal sensitive information even if names are removed.

Bias and Misinterpretation

Historical data can reflect unequal service, biased measurement, or selective participation. A dashboard may make biased patterns appear objective. Analysts should examine missingness, subgroup performance, measurement definitions, and unintended consequences. When BI outputs influence credit, employment, education, or healthcare decisions, additional validation, explanation, human oversight, and appeal mechanisms may be necessary.

Performance and Cost

High-cardinality dimensions, inefficient joins, excessive dashboard queries, and over-materialization can increase cost and latency. Performance tuning should begin with workload analysis rather than indiscriminate aggregation. Columnar storage, partitioning, caching, query folding, and incremental refresh can help, but each introduces design trade-offs.

11. Contemporary Developments and Best Practices

Cloud data warehouses and lakehouses increasingly combine scalable storage with SQL analytics, streaming, and machine-learning workflows. Semantic layers are becoming important because they define reusable business measures across dashboards, notebooks, and AI applications. Natural-language interfaces can help users ask questions, but generated queries and explanations require validation, especially when data definitions are ambiguous.

Organizations are also adopting data catalogs, data contracts, observability tools, and data-product practices. These approaches emphasize explicit ownership, quality expectations, lineage, and reliable interfaces between data producers and consumers.

Recommended practice is to:

1. Begin with decisions and users, not visualization software.

2. Declare fact-table grain before building measures.

3. Define dimensions, hierarchies, time periods, and business rules explicitly.

4. Distinguish additive, semi-additive, and non-additive measures.

5. Calculate ratios from valid aggregated components.

6. Provide certified semantic models and a business glossary.

7. Display targets, comparisons, definitions, and refresh status.

8. Test dashboards with real users and realistic decisions.

9. Apply security, privacy, accessibility, and retention controls.

10. Monitor adoption, data quality, performance, and decision outcomes.

Chapter Summary

OLAP and BI transform integrated data into information for analysis and decision support. The multidimensional model organizes business events as facts, descriptive contexts as dimensions, and numerical values as measures. Declaring the grain of a fact table is essential for reliable aggregation. Star and snowflake schemas provide alternative ways to organize analytical data.

OLAP operations include roll-up, drill-down, slice, dice, and pivot. Their usefulness depends on valid hierarchies and appropriate aggregation functions. Additive measures can be summed broadly, whereas semi-additive and non-additive measures require special treatment. Ratios such as margins should generally be calculated from aggregated components rather than averaged blindly.

BI encompasses architecture, governance, analytics, people, and processes. Effective KPIs connect measures to objectives and action. Reports provide structured detail, while dashboards emphasize monitoring and investigation. Self-service analytics increases flexibility but requires semantic governance, security, training, and certified data.

Finally, trustworthy BI requires attention to data quality, privacy, bias, accessibility, performance, and accountability. The central professional lesson is that a dashboard is not merely a visual artifact: it is an organizational claim about what matters, how it is measured, and what action should follow.

Key Terms

Fact: A business event or state represented for analysis.

Fact table: A table containing event references and analytical measures.

Dimension: Descriptive context used to group, filter, or explain facts.

Measure: A numerical value analyzed in relation to dimensions.

Grain: The precise meaning of one row in a fact table.

Hierarchy: An ordered set of levels within a dimension.

OLAP: Online Analytical Processing for multidimensional analysis.

Data cube: A conceptual structure of measures across dimensions.

Cuboid: A particular aggregation or dimensional view of a cube.

Roll-up: Aggregation toward a higher level of a hierarchy.

Drill-down: Navigation from summary data to greater detail.

Slice: Selection of one value from a dimension.

Dice: Selection of a multidimensional subcube.

Pivot: Reorientation of dimensions in a presentation.

Additive measure: A measure safely summed across relevant dimensions.

Semi-additive measure: A measure additive across some but not all dimensions.

KPI: A strategically important metric linked to a target or threshold.

Semantic layer: A governed business-oriented layer defining analytical concepts.

Self-service BI: User-led analysis supported by governed data and tools.

Data lineage: Documentation of data origins, transformations, and destinations.

Review Questions

Short Answer Questions

1. What is the purpose of declaring the grain of a fact table?

2. Distinguish between a dimension and a measure.

3. Define roll-up and drill-down.

4. What is the difference between a slice and a dice operation?

5. Why should a profit margin usually be calculated from aggregated revenue and cost?

Long Answer Questions

1. Explain the architecture of a BI environment from source systems to dashboards.

2. Compare star and snowflake schemas, including their advantages and limitations.

3. Explain additive, semi-additive, and non-additive measures with examples.

4. Discuss the principles of effective KPI and dashboard design.

5. Evaluate the benefits and risks of self-service BI and propose governance controls.

Analytical / Application Questions

1. Design a multidimensional model for a university library. Specify the fact-table grain, dimensions, hierarchies, and measures.

2. A company reports an increase in average store margin but a decrease in overall margin. Explain how this can occur and identify the correct calculation approach.

3. Design a dashboard for a delivery company. Select five KPIs, define each one, identify suitable visualizations, and describe how users would drill down to investigate late deliveries.

Multiple Choice Questions with Answers

Question 1

Which statement best describes the grain of a fact table?

A. The number of dimensions in a cube

B. The exact meaning of one row in the table

C. The storage size of the table

D. The number of measures in a report

Correct Answer: B. The exact meaning of one row in the table

Question 2

Which measure is generally additive across products, stores, and dates?

A. Account balance

B. Average unit price

C. Sales revenue

D. Profit margin percentage

Correct Answer: C. Sales revenue

Question 3

Which OLAP operation moves from annual sales to quarterly and monthly sales?

A. Roll-up

B. Pivot

C. Slice

D. Drill-down

Correct Answer: D. Drill-down

Question 4

Selecting only the year 2025 from a time dimension is an example of which operation?

A. Slice

B. Dice

C. Roll-up

D. Drill-down

Correct Answer: A. Slice

Question 5

Why can averaging store-level profit margins be misleading?

A. Margins are always additive

B. Stores may have different revenue weights

C. Revenue cannot be stored in a fact table

D. Dimensions cannot contain stores

Correct Answer: B. Stores may have different revenue weights

Question 6

What is the primary purpose of a KPI?

A. To increase the number of dashboard colors

B. To replace all operational systems

C. To link an important measure to an objective or target

D. To normalize every dimension table

Correct Answer: C. To link an important measure to an objective or target

Question 7

Which visualization is usually most appropriate for showing a measure over time?

A. Line chart

B. Pie chart with many categories

C. Three-dimensional surface chart

D. Word cloud

Correct Answer: A. Line chart

Question 8

What does a pivot operation change?

A. The underlying transaction values

B. The physical grain of the fact table

C. The arrangement of dimensions in a presentation

D. The privacy classification of data

Correct Answer: C. The arrangement of dimensions in a presentation

Question 9

Which control is most directly associated with ensuring users see only authorized rows?

A. Row-level security

B. Data compression

C. Chart sorting

D. Materialized aggregation

Correct Answer: A. Row-level security

Question 10

A dashboard shows 90 on-time deliveries out of 100 eligible deliveries. What is the on-time delivery rate?

A. 9%

B. 10%

C. 90%

D. 190%

Correct Answer: C. 90%

Data Mining and Data Warehousing
Chapter 5 of 15