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

Performance Optimization

Performance optimization in SQL is crucial for ensuring that your database queries run efficiently, especially as the size and complexity of your data grow. Here are several strategies and techniques to optimize SQL performance: Indexing Create Indexes : Primary Key and Unique Indexes : These are automatically indexed. Ensure that your tables have primary keys and unique constraints where applicable. Foreign Keys : Index foreign key columns to speed up join operations. Composite Indexes : Use these when queries filter on multiple columns. The order of columns in the index should match the order in the query conditions. Avoid Over-Indexing:  Too many indexes can slow down write operations (INSERT, UPDATE, DELETE). Only index columns that are frequently used in WHERE clauses, JOIN conditions, and as sorting keys. Query Optimization Use SELECT Statements Efficiently : SELECT Only Necessary Columns : Avoid using SELECT * ; specify only ...

DAX UPPER Function

The DAX UPPER function in Power BI is used to convert all characters in a text string to uppercase. This function is useful for standardizing text data, ensuring consistency in text values, and performing case-insensitive comparisons. Syntax: UPPER(<text>) <text>: The text string that you want to convert to uppercase. Purpose: The UPPER function helps ensure that text data is consistently formatted in uppercase. This can be essential for tasks like data cleaning, preparing text for comparisons, and ensuring uniformity in text-based fields. E xample: Suppose you have a table named "Customers" with a column "Name" that contains names in mixed case. You want to create a new column that shows all names in uppercase. UppercaseName = UPPER(Customers[Name]) Example Scenario: Assume you have the following "Customers" table: You can use the UPPER function as follows: Using the UPPER function, you can convert all names to uppercase: UppercaseName = ...

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.