Presentation is loading. Please wait.

Presentation is loading. Please wait.

SQL Bits 8 Dimensional Modelling for a Flexible Cube John Stevens-Taylor

Similar presentations


Presentation on theme: "SQL Bits 8 Dimensional Modelling for a Flexible Cube John Stevens-Taylor"— Presentation transcript:

1 SQL Bits 8 Dimensional Modelling for a Flexible Cube John Stevens-Taylor

2 What is a ‘Flexible Cube’ Each Reseller may have a different way of measuring sales Each Reseller can be compared to a number of others When Resellers are compared they should be anonymous Each Reseller may have different buckets with boundaries at any point When Resellers are compared they should use the measures and buckets of the ‘main’ Reseller

3 We need to define each method of calculation a measure that any reseller uses This is done through a number of views which are combined into a single view using a UNION statement. Each Reseller may have a different way of measuring sales *

4 We need to create a table to hold which measure method each reseller uses This will hold… The reseller key to join back to the Dim Reseller table The measure group A key for the measure calculation method The measure group name and the measure description to assist maintenance through self documentation Each Reseller may have a different way of measuring sales *

5 We also need to extend the Reseller dimension to provide a reference to the appropriate measure method This is done using a view onto the dimension table and the configuration table. Each Reseller may have a different way of measuring sales *

6 Each Reseller can be compared to a number of others We need to create a table to map each of the resellers that is valid as a comparison for each reseller. This holds the key for each reseller plus the text we want to be displayed. When Resellers are compared they should be anonymous *

7 We need to extend the Reseller dimension again to provide a reference comparison resellers with the display text This is done using a view onto the dimension table and the configuration table. Each Reseller can be compared to a number of others * When Resellers are compared they should be anonymous

8 Each Reseller may have different buckets with boundaries at any point We need new tables to define the boundaries of our buckets for each data type we want to analyse. These contain the upper and lower limits, the text to display and a key. This allows us to use an INNER JOIN to obtain the correct bucket key in the fact views *

9 Each Reseller may have different buckets with boundaries at any point These new table are referenced in views to create sources for bucket dimension. These use the reseller dimension joined on the bucket definition table and the bucket configuration table. *

10 We create a new table to map the bucket definitions to the resellers This also needs to map the buckets to the appropriate measure groups Each Reseller may have different buckets with boundaries at any point *

11 When Resellers are compared they should use the measures and buckets of the ‘main’ Reseller This is achieved by joining the fact rows on the comparison reseller key in the view but selecting the view to use based upon the main reseller key *

12 A Flexible Cube Building the flexible cube from these views is quite standard The dimensions are drawn from the reseller and bucket views and the facts from the UNIONed fact view These need to use a composite key in the relationships between fact and dimension *

13 Questions Dimensional Modelling for a Flexible Cube John Stevens-Taylor


Download ppt "SQL Bits 8 Dimensional Modelling for a Flexible Cube John Stevens-Taylor"

Similar presentations


Ads by Google