Skip to main content

Dimensions

Dimensions provide context and descriptive information about the facts. They represent the "who," "what," "where," "when," and "how" of the business.

Dimensions are categorical attributes that are used to categorize, filter, and group the facts for analysis. They provide the perspective through which the facts are analyzed.

Examples of dimensions include product, customer, time, location, salesperson, etc.

Dimensions are stored in dimension tables, which contain records representing the various categories or attributes, along with any hierarchies and relationships between them.

Dimension tables typically have a primary key that uniquely identifies each record, and foreign keys are used in fact tables to establish relationships with dimension tables.

 

 

Dimensions can be classified into different types. Here are the main types of dimensions:

 

Conformed Dimensions:

Conformed dimensions are dimensions that are consistent and standardized across multiple data marts or data sources within an organization.

They provide a unified view of common business entities (such as customers, products, time, etc.) across different departments or business units.

Conformed dimensions ensure consistency and interoperability between different parts of the organization's data infrastructure.

 

Junk Dimensions:

Junk dimensions are dimensions that contain low-cardinality attributes or flags that do not warrant their own dimension table.

They are often used to store a combination of miscellaneous or non-standard attributes that are not significant enough to merit individual dimensions.

Examples of attributes stored in junk dimensions include flags for "active/inactive," "on sale/not on sale," etc.

Junk dimensions help reduce the number of dimension tables and simplify the data model.

 

Degenerated Dimensions:

Degenerate dimensions are attributes from transactional fact tables that are not dimension keys but are treated as dimensions.

They represent transactional data that does not have a corresponding dimension table.

Examples of degenerate dimensions include transaction numbers, invoice numbers, order numbers, etc.

Degenerate dimensions are useful for analyzing transactional data without the need to join with separate

 

Roll-Playing Dimensions :

Role-playing dimensions are dimensions that are used multiple times in a fact table, each time representing a different perspective or role.

Examples include date dimensions (used for order date, ship date, delivery date, etc.) and geographic dimensions (used for shipping location, billing location, customer location, etc.).

Role-playing dimensions allow for efficient reuse of dimension tables and simplify the data model.

 

Hierarchical Dimensions :

Hierarchical dimensions represent hierarchical or nested relationships between different levels of attributes.

They are used to model parent-child relationships, such as organizational hierarchies, product categories, or geographic hierarchies.

Hierarchical dimensions enable drill-down and roll-up analysis to explore data at different levels of granularity.

 

Slowly Changing Dimensions (SCDs):

Slowly changing dimensions are dimensions that change over time, but at a slow rate.

They capture historical information about entities such as customers, products, or employees and their attributes.

SCDs are classified into different types based on how they handle changes: Type 1 (overwrite), Type 2 (add new row), Type 3 (add new attribute), etc.

Slowly changing dimensions allow for historical analysis and tracking of changes in dimensional attributes over time.

 

Slowly Changing Dimensions (SCD1):

SCD1, or Type 1, is the simplest type of slowly changing dimension.

In SCD1, when a change occurs to a dimension attribute, the existing value is simply overwritten with the new value.

Historical data is not preserved, and only the most recent information is retained in the dimension.

SCD1 is suitable for dimensions where historical changes are not important or can be safely ignored.

While SCD1 offers simplicity, it does not support historical analysis or tracking changes over time.

 

Slowly Changing Dimensions (SCD2):

SCD2, or Type 2, is the most commonly used type of slowly changing dimension.

In SCD2, when a change occurs to a dimension attribute, a new row is added to the dimension table to represent the new version of the dimension.

The existing row is marked as inactive (or end-dated), indicating that it is no longer the current version of the dimension.

This allows historical data to be preserved, and users can analyze data at different points in time.

SCD2 is suitable for dimensions where historical changes are significant and need to be tracked over time.

 

Slowly Changing Dimensions (SCD3):

SCD3, or Type 3, is a less common type of slowly changing dimension compared to SCD1 and SCD2.

In SCD3, when a change occurs to a dimension attribute, both the current and previous values are stored in the dimension table.

A separate column or set of columns is used to represent the current and previous versions of the attribute.

SCD3 provides a compromise between SCD1 and SCD2 by allowing limited historical analysis while maintaining a smaller dimension table size compared to SCD2.

However, SCD3 is limited in its ability to track multiple historical changes over time.

 

 

 

 

 

Comments

Popular posts from this blog

TechUplift: Elevating Your Expertise in Every Click

  Unlock the potential of data with SQL Fundamental: Master querying, managing, and manipulating databases effortlessly. Empower your database mastery with PL/SQL: Unleash the full potential of Oracle databases through advanced programming and optimization. Unlock the Potential of Programming for Innovation and Efficiency.  Transform raw data into actionable insights effortlessly. Empower Your Data Strategy with Power Dataware: Unleash the Potential of Data for Strategic Insights and Decision Making.

Relationships between tables

In Power BI, relationships between tables are essential for creating accurate and insightful reports. These relationships define how data from different tables interact with each other when performing analyses or creating visualizations. Here's a detailed overview of how relationships between tables work in Power BI: Types of Relationships: One-to-one (1:1):   This is the most common type of relationship in Power BI. It signifies that one record in a table can have multiple related records in another table. For example, each customer can have multiple orders. Many-to-One (N:1):   This relationship type is essentially the reverse of a one-to-many relationship. Many records in one table can correspond to one record in another table. For instance, multiple orders belong to one customer. One-to-Many (1:N):   Power BI doesn't support direct one-to-many relationships.  One record in table can correspond to many records in another table.  Many-to-Many (N:N):  ...

SQL Fundamentals

SQL, or Structured Query Language, is the go-to language for managing relational databases. It allows users to interact with databases to retrieve, manipulate, and control data efficiently. SQL provides a standardized way to define database structures, perform data operations, and ensure data integrity. From querying data to managing access and transactions, SQL is a fundamental tool for anyone working with databases. 1. Basics of SQL Introduction : SQL (Structured Query Language) is used for managing and manipulating relational databases. SQL Syntax : Basic structure of SQL statements (e.g., SELECT, INSERT, UPDATE, DELETE). Data Types : Different types of data that can be stored (e.g., INTEGER, VARCHAR, DATE). 2. SQL Commands DDL (Data Definition Language) : CREATE TABLE : Define new tables. ALTER TABLE : Modify existing tables. DROP TABLE : Delete tables. DML (Data Manipulation Language) : INSERT : Add new records. UPDATE : Modify existing records. DELETE : Remove records. DQL (Da...