Data Warehousing Series
What are dimension tables?
Dimension tables group related attributes that provide context to a business process. They contain associated context with a business process or measurement event. Dimensions are descriptive in nature, they typically describe : who, what, where, why, and when usually associated with a business process. These are usually so that we can slice, dice and filter data in different ways when querying our data.
How do we determine dimensions and attributes? A common methodology is to examine forms and instruments that are used to track the sale of business processes. Good example of such forms are receipts and invoices. Lets take a look a case study using examples from a receipt.
Case Study : Designing dimensions for a retail store
The first step is usually to examine the "what", "when", "who", "where", according to the relevant form that records the business process. An example of such a decomposition is highlighted in the table below.
Description | Value |
What | Item #1, Item #3 |
When(transaction date) | 5/10/2024 |
Where (store location) | Mombasa, Kenya |
Who (customer) | Jeffrey Preston |
Who (saleperson) | Jordan Beltford |
The next step is to determine the attributes from the table.
Attribute | Value |
Item ID | # 1 |
Item Name | Corsair gaming keyboard |
Item Brand | Corsair |
Date | 1 |
Month | 8 |
Year | 2024 |
City Name | Nairobi |
County | Nairobi county |
Customer Name | Tom Hanks |
Customer sex | Male |
Salesperson name | Albus Dumbledore |
The next step is to the logically group the related attributes into dimension tables. Grouping related attributes into dimension tables enables the end user to effectively slice, dice and filter the data.
Attributes | Dimension table |
Item ID, Item Name, Item Brand | Item |
Date, Month, Year | Date |
City Name, County | Geography |
Customer Name, Customer Sex | Customer |
Salesperson name | Employee |
After logically grouping your attributes into dimension tables, you can proceed to create your database tables in your data warehouse.
Subscribe to my newsletter
Read articles from Cavin Karema directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Cavin Karema
Cavin Karema
I am a big data enthusiast with a passion for working with data. Databases, distributed computing, cloud and analytics are technologies I am keen on honing. Writing is my avenue to deepen my understanding of these technologies.