What are Facts and Dimensions

24 October 2024

|
6 min read
Blog Image

Introduction

Nowadays, in a data driven environment, businesses mainly rely on Data Warehousing to take an educated decision. What exactly does happen in the background, though? This blog will discuss Facts and Dimensions, that are the basic elements of a data warehouse. You’ll learn how these parts work together to give clear insights and support smart decisions.

Ready to explore data warehousing with TrainingHub.io? Let’s get started!

Dimensions and Facts: What Are They?

Facts and dimensions form the basis of data warehousing. These two combined allow businesses to measure and interpret their data well. Now let’s look at each one in turn.

Facts

The Facts in data warehousing are nothing but data points in the numbers which illustrate how a business is performing. In other words, they are the "what" you want to measure. In other words, Facts can be total sales, revenue or the number of items sold. Think of them as the raw data, with an associated measurable value.

Some common characteristics of facts include:

a. Aggregatable: Facts are often combined, averaged, or used in calculations to provide insights.

b. Quantitative: Facts are always numbers. They represent things like quantities, costs, and earnings.

c. Time-sensitive: Facts are usually dynamic so they are very useful in time basing e.g. tracking monthly sales.

Example of Facts:

(i) Total Sales: $5,000 in a day.

(ii) Units Sold: 250 products in a week.

Dimensions

However, the description components that provide context for the facts are the Dimensions. The “what”, “who”, “where” and “when” of the facts are what they stand for. According to another definition, dimensions can be characteristics that help in dividing the facts into substantial groups so as to increase their accessibility and simplifying the analysis of data.

Common dimension attributes include:

(i) Customer Name

(ii) Product Category

(iii) Geography

(iv) Time

Example of Dimensions:

(i) Customer: John

(ii) Product: Mobile

(iii) Region: Texas

(iv) Date: July 15, 2024

Facts and Dimensions combined provide the basic building block for most data warehousing models, including Star schema and Snowflake schema. In these models, the dimensions that provide the context are that surrounding the point through which everything radiates from, the point of measurement—the facts.

"Data Warehousing: Your Key to Managing Complex Data Systems – Enroll With Us for a Brighter Tomorrow!"

So Why Dimensions and Facts Important in Data Warehousing

Facts and dimensions are the building blocks of data warehousing because they define how to organize, handle, and query your data. Without them it would be impossible to develop dashboards or do complex searches.

Key Reasons Why They Matter:

a. Optimized Query Performance: Data is organized by facts and dimensions making the data query much faster. Data structure will be correct so you don’t need to manually go through huge datasets manually. Alternatively, your particular facts and dimensions can also be queried for you to quickly get the information you need.

b. Enhanced Reporting: Fact and dimension tables are designed to make reports flexible and clear. You can view overall data, like total revenue for Q1, or detailed data, like sales by product category.

c. Scalability: Facts and dimensions give you structure for your data, making it easier to grow as the data grows. You can add new dimensions, facts, or metrics without rebuilding the database.

d. Improved Data Integrity: Keeping things consistent is easier when facts and dimensions are separate, so each piece of data is stored only once. For example, even if a customer makes multiple purchases, their information will only appear once in the customer dimension table.

Dimensions: Types and Hierarchies

To make the most use of them, it’s important to understand not all dimensions are created equal and we have different types in the business.

Types of Dimensions

a. Conformed Dimensions: Dimension are standardized measures that are used across different fact tables. For example, a Sales, Inventory, and an HR can use the same Date dimension, guaranteeing that all departments are speaking the same language.

b. Slowly Changing Dimensions (SCDs): While facts have a specific continuous value in a dimension, these dimensions are unlike facts in that they have a continuous value, but the values change over time — more slowly. For example, the address of a client instance. But perhaps it doesn’t change very often — not as often as a daily sales figure.

c. Junk Dimensions: These factors reduce data storage and simplification by combining a series of low cardinality features (e.g. yes/no flags like "IsPromotional" or "IsDiscounted") into one dimension.

Hierarchies in Dimensions

Dimensions often have hierarchies that help you explore data. For example:

(i) Time Dimension: Day → Month → Quarter → Year

Hierarchies offer analysts the capability to obtain greater insight into how the data is connected. For instance, you could think annual sales first and show quarterly results, followed by month end results.

"Transform Data into Strategy – Get Certified in Business Intelligence Tools at TrainingHub.io!"

Best Practice on managing Facts and dimensions

Efficient management of facts and dimensions is critical for a well working Data Warehouse. Here are some best practices below:

a. Maintain Consistent Naming Conventions: Make sure to be consistent while naming the fact and dimension table throughout the data warehouse. In this way, everyone will be able to easily understand and use the data.

b. Use Appropriate Grain for Facts: The ‘grain’ of a fact table is the degree of detail. Make sure that your information ties to this analysis if it has any grain, that the axes variables actually say what you’re trying to say. For instance, a daily sale should be recorded using day level grain.

c. Optimize Dimensions for Analysis: Do not stuff dimensions with data. Just be sure that if you are going to embed them on your site in front of your readers... When there is a need – divide highly complex dimensions into smaller, easier to manage segments.

d. Regularly Update Slowly Changing Dimensions: Watch SCD modifications carefully to ensure data in your reports are as accurate as possible. Create procedures for how you’re going to manage your modifications, such as keeping old data around and using your company’s needs to know if you should update it with the new data.

Final Thoughts

A stronger data warehouse is formed by facts and dimensions. They help organize data and provide powerful insights for businesses. Understanding how they work will help you use your data warehouse effectively and make smarter business decisions.

At TrainingHub.io, we help professionals learn the basics of data warehousing. If you're ready to expand your skills, explore our detailed courses on data warehousing and business intelligence.

"Shape the Future of Data – Enroll in Our Courses at TrainingHub.io and Lead the Way!"