In databases and data warehousing, we often speak of facts, measures, and dimensions when talking about organizing and modeling data. But the definition of facts, measures, and dimensions within this context is not exactly what you would find in the dictionary. Let’s look at these concepts, as they will help you understand better how your data will be “understood” by the SAP Data Warehouse Cloud.
First, let’s explore facts. In a data warehouse context, a fact is the part of your data that indicates a specific occurrence or transaction, like the sale of a product or receiving a shipment a certain number of items from a supplier.
If you think of our example company, Best Run Shoes, some of the facts that would appear in their data warehouse are:
- Selling a pair of shoes online for US$49
- Receiving a batch of 100 shoes from a supplier in the physical warehouse
- Shipping two shoes to a customer
- Receiving a late payment of US$347 from a customer
- Paying the salary amount of US$13,097 to an employee
Important to know is that a fact (“I sold a pair of shoes”) is composed of multiple measures. Measures can be qualitative, like a Product ID, or quantitative, like the price of a product. Following the example above, the fact of selling a pair of shoes online is composed of several measures, such as:
- It was sold yesterday at 2 pm
- It was sold for US$49
- ProductID is DWIO854
Each of these details about the fact is called a measure. Part of data modeling is applying calculations or aggregations to quantitative measures as necessary for your data model. The qualitative measures can be then linked to specific characteristics of that measure, which are called dimensions.
In the data warehouse context, dimensions are pieces of data that allow you to understand and index measures in your data models. Dimensions are either characteristics of a measure or pieces of data that help contextualize the fact.
For example, these are some of the dimensions you would find in the data warehouse of our company, Best Run Shoes:
- The shoe was sold online
- Shoe color
- Shoe size
- Brand name
- Name of employee
- Office location of an employee
- Warehouse in which a shoe is stored for sale
The separation between facts and dimensions has an impact on your data models and how their graphical representation looks like. For example, a simple star schema of Best Run Shoes would look something like this:
Now that you know a bit more about facts, measures, and dimensions, how about discovering more about SAP Data Warehouse Cloud?