SlideShare a Scribd company logo
1 of 44
Advanced Dimensional Modelling SQLBits 8, 9th April 2011, Brighton Vincent Rainardi vrainardi@gmail.com Blog: dwbi1.wordpress.com
Advanced Dimensional Modelling 1. Dimensions - Structure ,[object Object]
1 or 2 Dimensions
When To Snowflake
A Dimension with Only 1 Attribute
Transaction Level Dimension2. Fact Tables ,[object Object]
Snapshotting Transaction Fact Tables
Aggregate Fact Tables
Vertical Fact Tables3. Dimensions - Behavior ,[object Object]
Very Large Dimensions
Banding Dimension Rows
Stamping Dimension Rows
Dimensions with Multi Valued Attributes4. Combinations ,[object Object]
Dealing with Currency Rates
Dealing with Status
4 sections: 2 dims, 1 fact, 1 combi. Lots of material, may not able to finish.
44 slides, some slides we may have to touch lightly.
Questions between sections, available after.,[object Object]
SCD Type 6 2/2 Used for “As Was” reporting e.g. balances by tariff (price plan) at the end of last year,if the customers were on today’s tariff. Fact “Type 12” Dim Natural Key
1 or 2 dimensions 1/4 a) One Dimension b) Two Dimensions Fact Table DimAccount Fact Table DimAccount customerattributes  DimCustomer ,[object Object]
Disadvantage: can’t go from account to customer without going through the fact table - performance
Simplicity, 1 dim
Hierarchy from customer attribute &account attribute
Use when we don’t have fact tables requiring customer grain.,[object Object]
Modular: 2 separate dim tables but we can combine them easily to create a bigger dimension
To get the breakdown of a measure by a customer attribute is a bit more complicated than a)select c. attribute, sum(f.measure1) from fact1 finner join dim_account a on f.account_key = a.account_keyinner join dim_customer c on a.customer_key = c.customer_keygroup by c. attribute
1 or 2 dimensions 3/4 d) Two Dimensions with inter-dimension link Try to fix weakness on b and c: ,[object Object]
We can access dim customer directly from the fact table.Fact Table DimAccount DimCustomer Weakness: maintain customer key in 2 places: fact table and dim account. a.k.a. “Star with a Back Door”
1 or 2 dimensions 4/4 e) One Dimension with Customer Key Fact Table Fact Table Try to fix weakness of a:  unable to build a fact table with grain = customer. Add a column in dim account: customer key DimAccount Not as popular as c) and d) in solving Dim Customer issue. It is “indecisive” : trying to create Dim Customer but doesn’t want to create Dim Customer.  Disadvantage: Dim Customer is hidden inside Dim Account, making it: a) more difficult to maintain (especially for a type 2), and  b) less modular/flexible
When to Snowflake 1/3 1. When the sub dim is used by several dims City-Country-Region columns exist in DimBroker, DimPolicy, DimOffice and DimInsured Replaced by Location/GeoKey pointing to DimLocation / DimGeography Advantage: consistent hierarchy, i.e. relationship between City, Country & Region. Weakness: we would lose flexibility. City to Country are more or less fixed, but the grouping of countries might be different between dimensions.
When to Snowflake 2/3 2. When the sub dim is used by both the main dim and the fact table(s) ,[object Object]
DimManufacturer is used in DimProduct, and is also used in the fact table.
DimProductGroup is used in DimProduct, and is also used in some fact table.The alternative is maintaining two full dimensions (star classic).
When to Snowflake 3/3 3. To make “base dim” and “detail dim” Insurance classes, account types (banking), product lines, diagnosis, treatment (health care) Policies for marine, aviation & property classes have different attributes.  Pull common attributes into 1 dim: DimBasePolicy Put class-specific attributes into DimMarine, DimProperty, DimAviation Ref: Kimball DW Toolkit 2nd edition page 213 4. To enrich a date attribute Month, Quarter, Year, etc. Like #1, a sub dim used by several dims.
A dimension with only 1 attribute 1/2 Should we put the attribute in the fact table? (like DD = Degenerate Dim) Probably, if the grain = fact table,and it’s short or it’s a number. Reasons for putting single attribute in its own dim: Keep fact table slim  (4 bytes int not 100 bytes varchar) When the value changes, we don’t have to update the BIGfact table – ETL performance Grain is much lower than fact table – small dim Yes it’s only 1 attribute today, but in the future there could be another attribute. Could become a junk dim.
A dimension with only 1 attribute 2/2 Exception: snapshot month (or day/week/quarter) Snapshot month is used in periodic snapshot fact table. Snapshot month is in the form of an integer (201104 for April 2011). Doesn’t violate the 3 points above. It is an integer, not char(6). The value never changes, April 2011 will be April 2011 forever There will not be other attributes in the dim
Transaction Level Dimension 1/5 A dim with grain = the transaction fact table Transaction, not accumulative or periodic snapshot Examples: IT Helpdesk DW: Dim Ticket Telco DW: Dim Call Banking/Asset MgtDW: Dim Trade Insurance DW: Dim Premium TransactionLevel Dim Most granular event in any business process
Transaction Level Dimension 2/5 Advantages: Query PerformanceDD columns are moved to a dim, away from the heavy traffic in fact tables. DW queries don’t touch those DD columns unless they need to– performance. DD attributes totalling 30 bytes, replaced by 4 bytes int column. Slimmer fact table, better for queries. Periodic Snapshot Fact TableFor periodic snapshot fact table, saving is even greater. Monthly snapshot fact, 10 years / 120 months. Rather than specifying the DDs repeatedly 120x, they are specified once in the transaction dim. All that is left on the fact table is a slim 1 intcol: the transaction key.
Transaction Level Dimension 3/5 Some fact tables have grains greater than the transactionA payment from a customer is posted into 4 accounts in the GL fact table. That single financial transaction becomes 4 fact rows but only has 1 row in the trans dim. Fact table with 10m rows, trans dim only 3 million rows. Related TransactionsSome transactions are related, e.g. in retail, a purchase of a kitchen might need to be created as 2 related orders, because the worktop is made-to-order. Rather than creating a ‘related order’ column on the fact tables, it might be better (depends on how it’s used) to create it on the trans dim because: a) an order can consist of many fact rows (1 row per item) so the “related order number” will be duplicated across these fact rowsb) slimmer fact tablec) the transaction could be on many fact tables, not only one.
Transaction Level Dimension 4/5 Disadvantages/not suitable: ,[object Object]
Mart/DW only used for SSAS: there is little point of having trans dim physically. In SSAS we can create the transaction dimension “on the fly” from the fact table (“fact dimension”).
Using trans dim to put attributes as opposed to put them in the main dimensions, with the argument of: that’s the value of the attribute when the transaction happened – this is not right, use type 2 SCD for this.Main Acct type Trans Location
Transaction Level Dimension 5/5 Disadvantages/not suitable: ,[object Object]
A dim with grain = fact table - potential performance issue (unless the fact table is small). e.g. fact table = 10m rows, trans dim = 10m rows. Joining 10m to 10m potentially slow, especially if the physical ordering of the trans dim is not the joining column.,[object Object]

More Related Content

What's hot

Date warehousing concepts
Date warehousing conceptsDate warehousing concepts
Date warehousing conceptspcherukumalla
 
Dimensional modeling primer
Dimensional modeling primerDimensional modeling primer
Dimensional modeling primerTerry Bunio
 
Data Warehousing Trends, Best Practices, and Future Outlook
Data Warehousing Trends, Best Practices, and Future OutlookData Warehousing Trends, Best Practices, and Future Outlook
Data Warehousing Trends, Best Practices, and Future OutlookJames Serra
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databasesJames Serra
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional Modelingaksrauf
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional ModelingSunita Sahu
 
Data Warehouse Back to Basics: Dimensional Modeling
Data Warehouse Back to Basics: Dimensional ModelingData Warehouse Back to Basics: Dimensional Modeling
Data Warehouse Back to Basics: Dimensional ModelingDunn Solutions Group
 
Enterprise Architecture vs. Data Architecture
Enterprise Architecture vs. Data ArchitectureEnterprise Architecture vs. Data Architecture
Enterprise Architecture vs. Data ArchitectureDATAVERSITY
 
Data Lakehouse, Data Mesh, and Data Fabric (r1)
Data Lakehouse, Data Mesh, and Data Fabric (r1)Data Lakehouse, Data Mesh, and Data Fabric (r1)
Data Lakehouse, Data Mesh, and Data Fabric (r1)James Serra
 
Data Lake Overview
Data Lake OverviewData Lake Overview
Data Lake OverviewJames Serra
 
Data quality and data profiling
Data quality and data profilingData quality and data profiling
Data quality and data profilingShailja Khurana
 
Databricks Platform.pptx
Databricks Platform.pptxDatabricks Platform.pptx
Databricks Platform.pptxAlex Ivy
 
Data platform architecture
Data platform architectureData platform architecture
Data platform architectureSudheer Kondla
 
ETL VS ELT.pdf
ETL VS ELT.pdfETL VS ELT.pdf
ETL VS ELT.pdfBOSupport
 
OLAP operations
OLAP operationsOLAP operations
OLAP operationskunj desai
 

What's hot (20)

Data modeling
Data modelingData modeling
Data modeling
 
Date warehousing concepts
Date warehousing conceptsDate warehousing concepts
Date warehousing concepts
 
Dimensional modeling primer
Dimensional modeling primerDimensional modeling primer
Dimensional modeling primer
 
Data Warehousing Trends, Best Practices, and Future Outlook
Data Warehousing Trends, Best Practices, and Future OutlookData Warehousing Trends, Best Practices, and Future Outlook
Data Warehousing Trends, Best Practices, and Future Outlook
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional Modeling
 
Data modelling 101
Data modelling 101Data modelling 101
Data modelling 101
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional Modeling
 
Data Warehouse Back to Basics: Dimensional Modeling
Data Warehouse Back to Basics: Dimensional ModelingData Warehouse Back to Basics: Dimensional Modeling
Data Warehouse Back to Basics: Dimensional Modeling
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional Modeling
 
Enterprise Architecture vs. Data Architecture
Enterprise Architecture vs. Data ArchitectureEnterprise Architecture vs. Data Architecture
Enterprise Architecture vs. Data Architecture
 
Data Lakehouse, Data Mesh, and Data Fabric (r1)
Data Lakehouse, Data Mesh, and Data Fabric (r1)Data Lakehouse, Data Mesh, and Data Fabric (r1)
Data Lakehouse, Data Mesh, and Data Fabric (r1)
 
Data Lake Overview
Data Lake OverviewData Lake Overview
Data Lake Overview
 
Data quality and data profiling
Data quality and data profilingData quality and data profiling
Data quality and data profiling
 
Databricks Platform.pptx
Databricks Platform.pptxDatabricks Platform.pptx
Databricks Platform.pptx
 
Data partitioning
Data partitioningData partitioning
Data partitioning
 
Data platform architecture
Data platform architectureData platform architecture
Data platform architecture
 
Star schema PPT
Star schema PPTStar schema PPT
Star schema PPT
 
ETL VS ELT.pdf
ETL VS ELT.pdfETL VS ELT.pdf
ETL VS ELT.pdf
 
OLAP operations
OLAP operationsOLAP operations
OLAP operations
 

Viewers also liked

Data Warehouse Modeling
Data Warehouse ModelingData Warehouse Modeling
Data Warehouse Modelingvivekjv
 
Unicenter Autosys Job Management
Unicenter Autosys Job ManagementUnicenter Autosys Job Management
Unicenter Autosys Job ManagementVenkata Duvvuri
 
Day 1 - Introduction to Cloud Computing with Amazon Web Services
Day 1 - Introduction to Cloud Computing with Amazon Web ServicesDay 1 - Introduction to Cloud Computing with Amazon Web Services
Day 1 - Introduction to Cloud Computing with Amazon Web ServicesAmazon Web Services
 
Dimensional Modeling Basic Concept with Example
Dimensional Modeling Basic Concept with ExampleDimensional Modeling Basic Concept with Example
Dimensional Modeling Basic Concept with ExampleSajjad Zaheer
 
Data-Ed: Data Warehousing Strategies
Data-Ed: Data Warehousing StrategiesData-Ed: Data Warehousing Strategies
Data-Ed: Data Warehousing StrategiesData Blueprint
 
AWSome Day 2016 - Module 5: AWS Elasticity and Management Tools
AWSome Day 2016 - Module 5: AWS Elasticity and Management ToolsAWSome Day 2016 - Module 5: AWS Elasticity and Management Tools
AWSome Day 2016 - Module 5: AWS Elasticity and Management ToolsAmazon Web Services
 
AWSome Day 2016 - Module 4: Databases: Amazon DynamoDB and Amazon RDS
AWSome Day 2016 - Module 4: Databases: Amazon DynamoDB and Amazon RDSAWSome Day 2016 - Module 4: Databases: Amazon DynamoDB and Amazon RDS
AWSome Day 2016 - Module 4: Databases: Amazon DynamoDB and Amazon RDSAmazon Web Services
 
RDS and DynamoDB - Module 3 Part 2 - AWSome Day 2017
RDS and DynamoDB - Module 3 Part 2 - AWSome Day 2017RDS and DynamoDB - Module 3 Part 2 - AWSome Day 2017
RDS and DynamoDB - Module 3 Part 2 - AWSome Day 2017Amazon Web Services
 
AWS Foundational and Platform Services - Module 1 Parts 2 & 3 - AWSome Day 2017
AWS Foundational and Platform Services - Module 1 Parts 2 & 3 - AWSome Day 2017AWS Foundational and Platform Services - Module 1 Parts 2 & 3 - AWSome Day 2017
AWS Foundational and Platform Services - Module 1 Parts 2 & 3 - AWSome Day 2017Amazon Web Services
 
Big Data Warehousing Meetup: Dimensional Modeling Still Matters!!!
Big Data Warehousing Meetup: Dimensional Modeling Still Matters!!!Big Data Warehousing Meetup: Dimensional Modeling Still Matters!!!
Big Data Warehousing Meetup: Dimensional Modeling Still Matters!!!Caserta
 
Architecting a Data Warehouse: A Case Study
Architecting a Data Warehouse: A Case StudyArchitecting a Data Warehouse: A Case Study
Architecting a Data Warehouse: A Case StudyMark Ginnebaugh
 
AWSome Day 2016 - Module 3: Security, Identity, and Access Management
AWSome Day 2016 - Module 3: Security, Identity, and Access ManagementAWSome Day 2016 - Module 3: Security, Identity, and Access Management
AWSome Day 2016 - Module 3: Security, Identity, and Access ManagementAmazon Web Services
 
Elias - Invest in Greek residential RE
Elias - Invest in Greek residential REElias - Invest in Greek residential RE
Elias - Invest in Greek residential RE2alibaba
 
C’era una volta una farfallina di mille colori
C’era una volta una farfallina di mille coloriC’era una volta una farfallina di mille colori
C’era una volta una farfallina di mille coloriJorgos Pittas
 
மரண பயம் மாற்றம் உண்டாக்கும் Fear of death will change the life style
மரண பயம் மாற்றம் உண்டாக்கும் Fear of death will change the life styleமரண பயம் மாற்றம் உண்டாக்கும் Fear of death will change the life style
மரண பயம் மாற்றம் உண்டாக்கும் Fear of death will change the life styleNarayanasamy Prasannam
 
Marketing an artist - Reuben J
Marketing an artist - Reuben JMarketing an artist - Reuben J
Marketing an artist - Reuben Jmward1
 

Viewers also liked (20)

Data Warehouse Modeling
Data Warehouse ModelingData Warehouse Modeling
Data Warehouse Modeling
 
Dimensional management-services-egs-india
Dimensional management-services-egs-indiaDimensional management-services-egs-india
Dimensional management-services-egs-india
 
Unicenter Autosys Job Management
Unicenter Autosys Job ManagementUnicenter Autosys Job Management
Unicenter Autosys Job Management
 
Day 1 - Introduction to Cloud Computing with Amazon Web Services
Day 1 - Introduction to Cloud Computing with Amazon Web ServicesDay 1 - Introduction to Cloud Computing with Amazon Web Services
Day 1 - Introduction to Cloud Computing with Amazon Web Services
 
Inmon & kimball method
Inmon & kimball methodInmon & kimball method
Inmon & kimball method
 
Dimensional Modeling Basic Concept with Example
Dimensional Modeling Basic Concept with ExampleDimensional Modeling Basic Concept with Example
Dimensional Modeling Basic Concept with Example
 
Data-Ed: Data Warehousing Strategies
Data-Ed: Data Warehousing StrategiesData-Ed: Data Warehousing Strategies
Data-Ed: Data Warehousing Strategies
 
AWSome Day 2016 - Module 5: AWS Elasticity and Management Tools
AWSome Day 2016 - Module 5: AWS Elasticity and Management ToolsAWSome Day 2016 - Module 5: AWS Elasticity and Management Tools
AWSome Day 2016 - Module 5: AWS Elasticity and Management Tools
 
AWSome Day 2016 - Module 4: Databases: Amazon DynamoDB and Amazon RDS
AWSome Day 2016 - Module 4: Databases: Amazon DynamoDB and Amazon RDSAWSome Day 2016 - Module 4: Databases: Amazon DynamoDB and Amazon RDS
AWSome Day 2016 - Module 4: Databases: Amazon DynamoDB and Amazon RDS
 
RDS and DynamoDB - Module 3 Part 2 - AWSome Day 2017
RDS and DynamoDB - Module 3 Part 2 - AWSome Day 2017RDS and DynamoDB - Module 3 Part 2 - AWSome Day 2017
RDS and DynamoDB - Module 3 Part 2 - AWSome Day 2017
 
AWS Foundational and Platform Services - Module 1 Parts 2 & 3 - AWSome Day 2017
AWS Foundational and Platform Services - Module 1 Parts 2 & 3 - AWSome Day 2017AWS Foundational and Platform Services - Module 1 Parts 2 & 3 - AWSome Day 2017
AWS Foundational and Platform Services - Module 1 Parts 2 & 3 - AWSome Day 2017
 
Big Data Warehousing Meetup: Dimensional Modeling Still Matters!!!
Big Data Warehousing Meetup: Dimensional Modeling Still Matters!!!Big Data Warehousing Meetup: Dimensional Modeling Still Matters!!!
Big Data Warehousing Meetup: Dimensional Modeling Still Matters!!!
 
Architecting a Data Warehouse: A Case Study
Architecting a Data Warehouse: A Case StudyArchitecting a Data Warehouse: A Case Study
Architecting a Data Warehouse: A Case Study
 
AWSome Day 2016 - Module 3: Security, Identity, and Access Management
AWSome Day 2016 - Module 3: Security, Identity, and Access ManagementAWSome Day 2016 - Module 3: Security, Identity, and Access Management
AWSome Day 2016 - Module 3: Security, Identity, and Access Management
 
Locations
LocationsLocations
Locations
 
Elias - Invest in Greek residential RE
Elias - Invest in Greek residential REElias - Invest in Greek residential RE
Elias - Invest in Greek residential RE
 
C’era una volta una farfallina di mille colori
C’era una volta una farfallina di mille coloriC’era una volta una farfallina di mille colori
C’era una volta una farfallina di mille colori
 
மரண பயம் மாற்றம் உண்டாக்கும் Fear of death will change the life style
மரண பயம் மாற்றம் உண்டாக்கும் Fear of death will change the life styleமரண பயம் மாற்றம் உண்டாக்கும் Fear of death will change the life style
மரண பயம் மாற்றம் உண்டாக்கும் Fear of death will change the life style
 
Marketing an artist - Reuben J
Marketing an artist - Reuben JMarketing an artist - Reuben J
Marketing an artist - Reuben J
 
8º pag118 147
8º pag118 1478º pag118 147
8º pag118 147
 

Similar to Advanced Dimensional Modelling

Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory optionStar Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory optionFranck Pachot
 
Biug 20112026 dimensional modeling and mdx best practices
Biug 20112026   dimensional modeling and mdx best practicesBiug 20112026   dimensional modeling and mdx best practices
Biug 20112026 dimensional modeling and mdx best practicesItay Braun
 
Sterling Integrator Map Editor
Sterling Integrator Map EditorSterling Integrator Map Editor
Sterling Integrator Map EditorJeyhind M
 
Dwh lecture slides-week5&6
Dwh lecture slides-week5&6Dwh lecture slides-week5&6
Dwh lecture slides-week5&6Shani729
 
Basics+of+Datawarehousing
Basics+of+DatawarehousingBasics+of+Datawarehousing
Basics+of+Datawarehousingtheextraaedge
 
Intro to Data warehousing lecture 13
Intro to Data warehousing   lecture 13Intro to Data warehousing   lecture 13
Intro to Data warehousing lecture 13AnwarrChaudary
 
(Lecture 4)Slowly Changing Dimensions.pdf
(Lecture 4)Slowly Changing Dimensions.pdf(Lecture 4)Slowly Changing Dimensions.pdf
(Lecture 4)Slowly Changing Dimensions.pdfMobeenMasoudi
 
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docxAB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docxbartholomeocoombs
 
Découverte d'Einstein Analytics (Tableau CRM)
Découverte d'Einstein Analytics (Tableau CRM)Découverte d'Einstein Analytics (Tableau CRM)
Découverte d'Einstein Analytics (Tableau CRM)Doria Hamelryk
 
Sdn beginners bi
Sdn beginners biSdn beginners bi
Sdn beginners biRam Tomar
 
Dimensional Modelling Session 2
Dimensional Modelling Session 2Dimensional Modelling Session 2
Dimensional Modelling Session 2akitda
 
OLAP Cubes in Datawarehousing
OLAP Cubes in DatawarehousingOLAP Cubes in Datawarehousing
OLAP Cubes in DatawarehousingPrithwis Mukerjee
 
Statistics Linear Regression Model by Maqsood Asalam
Statistics Linear Regression Model by Maqsood AsalamStatistics Linear Regression Model by Maqsood Asalam
Statistics Linear Regression Model by Maqsood AsalamUsamaIqbal83
 
Dimensional modelling-mod-3
Dimensional modelling-mod-3Dimensional modelling-mod-3
Dimensional modelling-mod-3Malik Alig
 
Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Aeric Poon
 
Microsoft MCSE 70-469 it braindumps
Microsoft MCSE 70-469 it braindumpsMicrosoft MCSE 70-469 it braindumps
Microsoft MCSE 70-469 it braindumpslilylucy
 
SQL Server 2008 Performance Enhancements
SQL Server 2008 Performance EnhancementsSQL Server 2008 Performance Enhancements
SQL Server 2008 Performance Enhancementsinfusiondev
 

Similar to Advanced Dimensional Modelling (20)

Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory optionStar Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
 
Biug 20112026 dimensional modeling and mdx best practices
Biug 20112026   dimensional modeling and mdx best practicesBiug 20112026   dimensional modeling and mdx best practices
Biug 20112026 dimensional modeling and mdx best practices
 
Sterling Integrator Map Editor
Sterling Integrator Map EditorSterling Integrator Map Editor
Sterling Integrator Map Editor
 
Data modelling interview question
Data modelling interview questionData modelling interview question
Data modelling interview question
 
Dwh lecture slides-week5&6
Dwh lecture slides-week5&6Dwh lecture slides-week5&6
Dwh lecture slides-week5&6
 
Basics+of+Datawarehousing
Basics+of+DatawarehousingBasics+of+Datawarehousing
Basics+of+Datawarehousing
 
Intro to Data warehousing lecture 13
Intro to Data warehousing   lecture 13Intro to Data warehousing   lecture 13
Intro to Data warehousing lecture 13
 
(Lecture 4)Slowly Changing Dimensions.pdf
(Lecture 4)Slowly Changing Dimensions.pdf(Lecture 4)Slowly Changing Dimensions.pdf
(Lecture 4)Slowly Changing Dimensions.pdf
 
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docxAB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
AB Database Assignment 1 –FOR STUDENTS TO COMPLETEFirst create .docx
 
Découverte d'Einstein Analytics (Tableau CRM)
Découverte d'Einstein Analytics (Tableau CRM)Découverte d'Einstein Analytics (Tableau CRM)
Découverte d'Einstein Analytics (Tableau CRM)
 
Fahri tugas cloud1
Fahri tugas cloud1Fahri tugas cloud1
Fahri tugas cloud1
 
Sdn beginners bi
Sdn beginners biSdn beginners bi
Sdn beginners bi
 
Dimensional Modelling Session 2
Dimensional Modelling Session 2Dimensional Modelling Session 2
Dimensional Modelling Session 2
 
Getting power bi
Getting power biGetting power bi
Getting power bi
 
OLAP Cubes in Datawarehousing
OLAP Cubes in DatawarehousingOLAP Cubes in Datawarehousing
OLAP Cubes in Datawarehousing
 
Statistics Linear Regression Model by Maqsood Asalam
Statistics Linear Regression Model by Maqsood AsalamStatistics Linear Regression Model by Maqsood Asalam
Statistics Linear Regression Model by Maqsood Asalam
 
Dimensional modelling-mod-3
Dimensional modelling-mod-3Dimensional modelling-mod-3
Dimensional modelling-mod-3
 
Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...
 
Microsoft MCSE 70-469 it braindumps
Microsoft MCSE 70-469 it braindumpsMicrosoft MCSE 70-469 it braindumps
Microsoft MCSE 70-469 it braindumps
 
SQL Server 2008 Performance Enhancements
SQL Server 2008 Performance EnhancementsSQL Server 2008 Performance Enhancements
SQL Server 2008 Performance Enhancements
 

Recently uploaded

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Recently uploaded (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Advanced Dimensional Modelling

  • 1. Advanced Dimensional Modelling SQLBits 8, 9th April 2011, Brighton Vincent Rainardi vrainardi@gmail.com Blog: dwbi1.wordpress.com
  • 2.
  • 3. 1 or 2 Dimensions
  • 5. A Dimension with Only 1 Attribute
  • 6.
  • 9.
  • 13.
  • 16. 4 sections: 2 dims, 1 fact, 1 combi. Lots of material, may not able to finish.
  • 17. 44 slides, some slides we may have to touch lightly.
  • 18.
  • 19. SCD Type 6 2/2 Used for “As Was” reporting e.g. balances by tariff (price plan) at the end of last year,if the customers were on today’s tariff. Fact “Type 12” Dim Natural Key
  • 20.
  • 21. Disadvantage: can’t go from account to customer without going through the fact table - performance
  • 23. Hierarchy from customer attribute &account attribute
  • 24.
  • 25. Modular: 2 separate dim tables but we can combine them easily to create a bigger dimension
  • 26. To get the breakdown of a measure by a customer attribute is a bit more complicated than a)select c. attribute, sum(f.measure1) from fact1 finner join dim_account a on f.account_key = a.account_keyinner join dim_customer c on a.customer_key = c.customer_keygroup by c. attribute
  • 27.
  • 28. We can access dim customer directly from the fact table.Fact Table DimAccount DimCustomer Weakness: maintain customer key in 2 places: fact table and dim account. a.k.a. “Star with a Back Door”
  • 29. 1 or 2 dimensions 4/4 e) One Dimension with Customer Key Fact Table Fact Table Try to fix weakness of a: unable to build a fact table with grain = customer. Add a column in dim account: customer key DimAccount Not as popular as c) and d) in solving Dim Customer issue. It is “indecisive” : trying to create Dim Customer but doesn’t want to create Dim Customer. Disadvantage: Dim Customer is hidden inside Dim Account, making it: a) more difficult to maintain (especially for a type 2), and b) less modular/flexible
  • 30. When to Snowflake 1/3 1. When the sub dim is used by several dims City-Country-Region columns exist in DimBroker, DimPolicy, DimOffice and DimInsured Replaced by Location/GeoKey pointing to DimLocation / DimGeography Advantage: consistent hierarchy, i.e. relationship between City, Country & Region. Weakness: we would lose flexibility. City to Country are more or less fixed, but the grouping of countries might be different between dimensions.
  • 31.
  • 32. DimManufacturer is used in DimProduct, and is also used in the fact table.
  • 33. DimProductGroup is used in DimProduct, and is also used in some fact table.The alternative is maintaining two full dimensions (star classic).
  • 34. When to Snowflake 3/3 3. To make “base dim” and “detail dim” Insurance classes, account types (banking), product lines, diagnosis, treatment (health care) Policies for marine, aviation & property classes have different attributes. Pull common attributes into 1 dim: DimBasePolicy Put class-specific attributes into DimMarine, DimProperty, DimAviation Ref: Kimball DW Toolkit 2nd edition page 213 4. To enrich a date attribute Month, Quarter, Year, etc. Like #1, a sub dim used by several dims.
  • 35. A dimension with only 1 attribute 1/2 Should we put the attribute in the fact table? (like DD = Degenerate Dim) Probably, if the grain = fact table,and it’s short or it’s a number. Reasons for putting single attribute in its own dim: Keep fact table slim  (4 bytes int not 100 bytes varchar) When the value changes, we don’t have to update the BIGfact table – ETL performance Grain is much lower than fact table – small dim Yes it’s only 1 attribute today, but in the future there could be another attribute. Could become a junk dim.
  • 36. A dimension with only 1 attribute 2/2 Exception: snapshot month (or day/week/quarter) Snapshot month is used in periodic snapshot fact table. Snapshot month is in the form of an integer (201104 for April 2011). Doesn’t violate the 3 points above. It is an integer, not char(6). The value never changes, April 2011 will be April 2011 forever There will not be other attributes in the dim
  • 37. Transaction Level Dimension 1/5 A dim with grain = the transaction fact table Transaction, not accumulative or periodic snapshot Examples: IT Helpdesk DW: Dim Ticket Telco DW: Dim Call Banking/Asset MgtDW: Dim Trade Insurance DW: Dim Premium TransactionLevel Dim Most granular event in any business process
  • 38. Transaction Level Dimension 2/5 Advantages: Query PerformanceDD columns are moved to a dim, away from the heavy traffic in fact tables. DW queries don’t touch those DD columns unless they need to– performance. DD attributes totalling 30 bytes, replaced by 4 bytes int column. Slimmer fact table, better for queries. Periodic Snapshot Fact TableFor periodic snapshot fact table, saving is even greater. Monthly snapshot fact, 10 years / 120 months. Rather than specifying the DDs repeatedly 120x, they are specified once in the transaction dim. All that is left on the fact table is a slim 1 intcol: the transaction key.
  • 39. Transaction Level Dimension 3/5 Some fact tables have grains greater than the transactionA payment from a customer is posted into 4 accounts in the GL fact table. That single financial transaction becomes 4 fact rows but only has 1 row in the trans dim. Fact table with 10m rows, trans dim only 3 million rows. Related TransactionsSome transactions are related, e.g. in retail, a purchase of a kitchen might need to be created as 2 related orders, because the worktop is made-to-order. Rather than creating a ‘related order’ column on the fact tables, it might be better (depends on how it’s used) to create it on the trans dim because: a) an order can consist of many fact rows (1 row per item) so the “related order number” will be duplicated across these fact rowsb) slimmer fact tablec) the transaction could be on many fact tables, not only one.
  • 40.
  • 41. Mart/DW only used for SSAS: there is little point of having trans dim physically. In SSAS we can create the transaction dimension “on the fly” from the fact table (“fact dimension”).
  • 42. Using trans dim to put attributes as opposed to put them in the main dimensions, with the argument of: that’s the value of the attribute when the transaction happened – this is not right, use type 2 SCD for this.Main Acct type Trans Location
  • 43.
  • 44.
  • 45. 1 or 2 Dimensions
  • 47. A Dimension with Only 1 Attribute
  • 48.
  • 51.
  • 55.
  • 57. Dealing with Status25% Time, Questions
  • 58. Fact Table Primary Key 1/3 Should we have a PK? Yes, if we need to be able to identify each fact row Need to refer to a fact row from another fact row e.g. chain of events Many identical fact rows and we need to update/delete only one To link the fact table to another fact table Some experts totally disagree Uniqueness Related Trans Header - Detail PK PK FK PK FK (no RI) (not enforced) previous/next transaction
  • 59. Fact Table Primary Key 2/3 Single or Multi Column? Single Column: Generated Identity Multi Column: Dimension Keys Single-column PK is better than multi-column PK because : 1) A multi-column PK may not be unique. A single-column PK guarantees that the PK is unique, because it is an identity column. 2) A single-column PK is slimmer than a multi-column PK, better query performance. To do a self join in the fact table (e.g. to link the current fact row to the previous fact row), we join on a single integer column.
  • 60. Fact Table Primary Key 3/3 Advantage: Prevent duplicate rows, query performance Disadvantage: loading performance Indexing the PK: cluster or not? Cluster the PK if: the PK is an identity column Don’t cluster the PK if: the PK is a composite, or when you need the cluster index for query performance (with partitioning) Example of not having a PK If duplicate fact rows are allowed. e.g. retail DW: Store Key, Date Key, Product Key, Customer Key Same customer buying the same milk in the same shop on the same day twice --- Order Line ID as DD to make it unique (not all EPOS has it)
  • 61. Snapshotting Transaction Fact Tables 1/1 Potentially huge – billions rows Only take what you need Smart date key/month, e.g. 20110409 Monthly or daily Trunc-reload of current month/day Daily (4 wk), Weekly (1 yr), Monthly (10 yr) Purging & Archiving Load from staging (cached) Index/partition on snapshot date Trans Staging Snapshot
  • 62. Aggregate Fact Tables 1/2 What are they? High level aggregation of base fact tables A “select group by” query on a 2 billion rows fact table can take 30 mins if it joins with two big fact tables, even with indexes in place So we do this query in advance as part of the DW load and store it as an Aggregate Fact Table The report only takes 1 second to run. Base Fact Tables 30 mins Aggregate Fact Table 1 sec Report
  • 63. Aggregate Fact Tables 2/2 What For? For report performance (group by is costly) BO: aggregate aware Not SSAS: aggregate in cubes, not tables Loading & indexing: Best to load from staging (at the same time as loading the main fact table) not from the main fact table (this would be working 2x) Partition for data distribution or narrow query Indexing: by the main dim keys
  • 64. Vertical Fact Tables 1/1 Normalised 1 measure column The meaning of that measure column depends on “measure type” column Used for Finance/GL mart Advantage: flexibility: using accounts, balance, Dr Cr Disadvantage: non additive “Normal” Fact Table many measures (actual & budget) Measure Type Dim Key Vertical Fact Table 1 measure
  • 65.
  • 66. 1 or 2 Dimensions
  • 68. A Dimension with Only 1 Attribute
  • 69.
  • 72.
  • 76.
  • 78. Dealing with Status50% Time, Questions
  • 79. Rapidly Changing Dimension 1/1 Why is it a problem Large SCD2 dim – Attributes change every day Slow query when join with large fact tables What to do Put into a separate dim, link direct to fact table. Just store the latest, type 1 attributes (or dual) Store in the fact table (for small attribute, e.g. indicator) Type2 Type2 Type2 Type2 Type1
  • 80. Very Large Dimension Why is it a problem SSAS: 4 GB string store limit for dimension SSAS: dim is “select distinct” on each attribute – long processing time “Valid date” join on SCD2 for as was Usually customer dim where the “quality stamp” changes daily or because of high number of distinct values Difficult to browse high cardinality attribute Join with fact tables – performance 1/2
  • 81. Very Large Dimension 2/2 What to do Split into 2 dims, same grain. Always cut vertically. Remove SCD2, or at least only certain columns. Most common: separate the attributes with high cardinality/change frequency Bucketing/banding, group values into ranges VLD
  • 82. Banding Dimension Rows 1/1 It is grouping numerical values (numerical attributes, not measure) into several bands, e.g. engine size, distance from station, amount purchased (last complete year). Benefits: easier for analysis & reporting, comparing between categories. Issue/problem: limit e.g. bucketing criteria1 hour to implement, 3 months to argue
  • 83.
  • 84. To reflect c0nsumer interest on the product (product categorisation based on customer interest level)
  • 85. Any other dates or measures summarized as stamped attribute, i.e. “new customer”, “big spender”, or results from recommendation analysis/algorithm e.g. customer behaviour based on previous purchases.
  • 86. Used for analysis / reporting“Stamped” Attributes
  • 87.
  • 88.
  • 89. Dimensions with Multi Valued Attributes 3/4 3. Use a bridge table to link the 2 dims Fact Table Dim Size Bridge Table Dim Product 4. Have several columns in the dim for that attribute If the number of attributes is small and fixed, this is a popular approach. But if the number of attributes is large (e.g. >10) or if it’s variable (e.g. sometimes 2, sometimes 20), approach 2 and 3 above are more popular, and more appropriate.  
  • 90. Dimensions with Multi Valued Attributes 4/4 5. Put the attribute in a snowflake sub dim We can’t really do this, as it is 1 to many (1 row in the main dim corresponds to many rows in the sub dim). So we need a bridge table, which brings us back to approach 3. 6. Keep in one column using delimiters e.g. “Small|Medium″. A crazy idea. More flexible than having several columns (approach 4) and simpler than approach 3 or 2. If the purpose of the attribute is “display only” on a report (rather than analyse or slice & dice), there is an argument for using this approach, particularly if the number of attributes is small (e.g. 1 to 4).
  • 91.
  • 92. 1 or 2 Dimensions
  • 94. A Dimension with Only 1 Attribute
  • 95.
  • 98.
  • 102.
  • 104. Dealing with Status75% Time, Questions
  • 105. Real Time Fact Table 1/1 Reporting the transaction system in real time View to union with the normal fact table, or use partitions Freezing the dims for key lookup, -3 unknown key Key corrections next day Dims as of yesterday Main partition (up to last night) Unknown keys: -1 null in source -2 not in dim table -3 not in dim table as dim was frozen to be resolved next batch Real time partition (intraday today) dimkey
  • 106. Dealing with Currency Rates 1/3 What for/background/requirements Report in 3 reporting currencies, using today rates or past Analyse over time without the impact of currency rates (using fixed currency rates, e.g. 2010 EOY rates) Had the transactions happened today Currency rates historical analysis Reporting Currency DW Currency Transaction Currency Transaction Rates Reporting Rates 100 countries 40 currencies 3-4 currencies GBP, USD, EUR, Original 1 currency (many transaction dates) ( 1 reporting date) e.g. GBP
  • 107. Dealing with Currency Rates 2/3 Approaches Store in original currencies, convert to DW currency at runtime.Or convert at load, store in DW currency – inaccuracy. Or store in both original and DW currency Currency rate fact table (date, currency, rate)Or store rates in the fact table On report/cube: date input at run time (default = today) Fact Tables FX Fact Table Rate
  • 108. Dealing with Currency Rates 3/3 in original currency, DW currency or both Concept of FX Rate Type/Profile
  • 109. Dealing with Status 1/2 What/background Workflow (policies, contracts, documents) Bottleneck analysis (no of days between stages) How many on each stage Status 1 Status 4 Status 6 Status 2 date2 date3 date4 date1 Status 3 Status 5
  • 110. Dealing with Status 2/2 Approaches Accumulative Snapshot Fact, 1 row per application SCD2 on DimApp App Status fact table
  • 111. Thanks Email: vrainardi@gmail.com Blog: http://dwbi1.wordpress.comCovers many of the topics in this presentation This PowerPoint: in my blog, scroll to bottom, click on “SQLBit8” Special thanks to Guang Ming Xing and Simon Jensen who helped reviewing this presentation and provided useful comments (doesn’t mean that they agree with the content)