

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Implementing Dimensional Hierarchies
Dimensional hierarchies are stored as attributes in the dimension tables, and all related hierarchies are typically stored in a single dimension table. A description of each level of hierarchy is kept in the multidimensional metadata. For example, date, day, month, and year are stored in a Date dimension; while product, brand, category, and department are stored in the Product dimension. The example below illustrates a Retail Store database schema and the associated Date and Product dimension tables.
Dimensional Modeling Mohammad A. Rob 11
docsity.com
Use of Dimensional Hierarchy
Hierarchies in dimensions are used for selecting and aggregating data at the desired level of detail. The fact table contains data only in the lowest level of the hierarchy. The higher-level data are obtained through aggregation of lowest-level fact data for the same instances of a dimensional level-attribute.
For the previous example, if we want to find the total Sales Quantity and the Sales Dollar Amount for each of the two departments, Bakery and Frozen Food , we first select Bakery and Frozen Food from the Product Dimension table and then add up all the values of Sales Quantity and Sales Dollar Amount from the fact table corresponding to the two products. This requires adding up separately, fact values for Product key = 1, 2, 3, and 4, and Product key = 5, 6, 7, 8, and 9 , for all possible values of other keys in the Fact table_._ The result is shown below.
Department Description Sales Quantity Sales Dollar Amount Bakery 5,088 $12, Frozen Food 15,565 $31,
Instead of aggregation by Product Description , if we want to go into details for the Brand Description of the product, we project on the Product Description and Brand Description from the Product Dimension , and then select all Sales Quantity and Sales Dollar Amount from the Fact table, and add them up.
docsity.com