Data warehousing combines data and information from multiple sources into a single, comprehensive database.
Facts in data warehousing represent numerical or measurable data that describe a business event or transaction. They are stored in a fact table, a central repository for facts, and facilitate efficient analysis.
Following are the three types of facts:
Additive facts
Semi-additive facts
Nonadditive facts
Additive facts support mathematical operations like addition, subtraction, multiplication, and division, allowing aggregation across all associated dimensions.
Consider a sales fact table containing each transaction's total sales amount. This additive fact can be aggregated across dimensions such as time (e.g., monthly, quarterly, yearly), product category, or sales region.
Transaction date | Product | Category | Sales amount | Quantity |
2023-07-01 | A | Electronics | 5000 | 15 |
2023-07-02 | B | Appliances | 2000 | 16 |
2023-07-03 | C | Clothing | 1500 | 10 |
This sales fact table includes transaction details such as the transaction date, product, category, sales amount, and quantity sold. It represents individual sales transactions that can be aggregated across dimensions for analysis and decision-making.
Semi-additive facts exhibit different aggregation behavior across dimensions, allowing aggregation across some but not all. These facts capture time-dependent information but lack meaningful aggregation capabilities across certain dimensions. Semi-additive facts require special treatment during aggregation, as they do not exhibit uniform behavior across all dimensions.
An inventory fact table may include a "current stock quantity" field. While this fact can be aggregated over time (e.g., summing stock quantities daily, weekly, or monthly), it cannot be aggregated across dimensions such as product or location, as the stock levels are specific to each individual item or store.
Product | Location | Date | Stock Quantity |
A | X | 2023-07-02 | 80 |
B | Y | 2023-07-03 | 50 |
C | Z | 2023-07-04 | 100 |
This inventory fact table captures the stock levels for individual products at specific locations, allowing aggregation over time but not across dimensions such as product or location.
In a data warehouse, nonadditive facts are data elements that do not align with simple
It often involves ratios, percentages, averages of proportions, or values derived from calculations.
The customer satisfaction score is a nonadditive fact that represents the rating indicating the level of customer satisfaction for a particular product or category. Surveys or feedback systems typically provide the scores.
Customer ID | Product | Category | Satisfaction Score |
100 | A | Electronics | 4.6 |
101 | B | Appliances | 3.9 |
102 | C | Clothing | 2.8 |
The nonadditive nature of customer satisfaction scores arises because they cannot be meaningfully summed or averaged across dimensions such as product or category. Aggregating satisfaction scores across different products or categories is not possible.
Understanding the different types of facts in data warehouses is essential for effective data analysis and decision-making. Data warehousing is a complex and evolving field, and the specific types of facts may vary depending on the industry and business requirements.
Which type of fact can be aggregated across all dimensions associated with it?
Additive facts
Non-additive facts
Semi-additive facts
Free Resources