Data Warehousing Series

Cavin KaremaCavin Karema
2 min read

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.

DescriptionValue
WhatItem #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.

AttributeValue
Item ID# 1
Item NameCorsair gaming keyboard
Item BrandCorsair
Date1
Month8
Year2024
City NameNairobi
CountyNairobi county
Customer NameTom Hanks
Customer sexMale
Salesperson nameAlbus 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.

AttributesDimension table
Item ID, Item Name, Item BrandItem
Date, Month, YearDate
City Name, CountyGeography
Customer Name, Customer SexCustomer
Salesperson nameEmployee

After logically grouping your attributes into dimension tables, you can proceed to create your database tables in your data warehouse.

0
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.