OLAP/OLTP Review of Star Schema Dimension Tables and Fact Table Real world changes SAP BI Enhanced Star Schema Fact Table Dimension Tables Master Data Tables MetaData Objects
OLTP vs. OLAP systems
Detailed Can be updated Accurate up to the second Used for clerical purposes Built based on requirements Supports small uniform transactions Data designed for optimal storage Very current data Data is application oriented Referential Integrity is useful High availability is normal
Summarised Snapshot records, no updates allowed Timestamp on each record Used by management Built without knowing requirements Supports mixed workload Data designed for optimal access Mainly historical data Data is integrated Referential integrity is not useful High availability is nice to have
Product Dimension Customer Dimension
Review of Star Schema
Multidimensional data models are needed for the creation of data warehouses The classic star schema is a commonly used multidimensional model This database schema classifies two groups of data: facts (sales or quantity, for example) and dimension attributes (customer, material, time, for example). Facts are the focus of the analysis of a business' activities. The fact data (values for the facts) are stored in a highly normalized fact table.
.Real World Changes
The Star schema reflects changes in the ‘real world’
normally by adding rows to the fact table. which is identified by the combination of key attributes in the dimension tables. More precise ‘real world’ changes like Customer ‘4711’ purchase Material ‘BBB’ at Day ‘19980802’ for $100 creates a new record in the fact table.
Date ID Year Fiscal Year Quarter Month
Customer ID Customer Name City Region Type
Material ID Customer ID Date ID
Sales Amount (K) Unit Price (K) Quantity (K)
Material ID Material Name Material Type Material Group
.Star Schema Limitations
• No support for multiple languages • Reduced performance due to the use of Alphanumeric keys • No support for time dependent changes • Duplication of Dimensional data.
called master data tables (outside the dimension tables).
. which was developed as an enhanced star schema as a response to problems experienced with the classic star schema.SAP BI Schema
The multi-dimensional model in SAP BI is based on the SAP BI schema. The enhancement comes from the fact that the dimension tables do not contain master data information! Master data is stored in separate tables.
A dimension is said to be snowflaked when the lowcardinality columns in the dimension have been removed to separate normalized tables that then link back into the original dimension table.
SAP BI uses a snowflake model instead of the star schema Further normalization and expansion of the dimension
tables in a star schema result in the implementation of a snowflake design.
When do you snowflake?
Snowflaking a dimension table can typically be performed under the following two conditions:
The dimension table consists of two or more sets of
attributes which define information at different grains (detail) The sets of attributes of the same dimension table are being populated by different source systems (very common in data warehouses)
2.g. The center of an InfoCube forms the fact table containing the key figures (e.
. material). The fact table is surrounded by several dimensions. sales amount). The meta data object in BI that describes characteristics and also key figures (facts) is called InfoObject. A dimension consist of different table types: Dimension Table
Attributes of the dimension tables are called
characteristics (e. 3.Details of the SAP BI Schema
SAP BI Extended Star Schema
Represents Dimensional data Independent of any Fact table Reusable in multiple Fact tables Designed to support multi lingual systems Designed to support time dependent data. Designed to improve query performance.
Acts as a link between Master data and Fact table records
Consists of Fact and Dimensional tables.
Consists of Dimensional Keys and Key Figures (facts).
InfoCubes are the central objects of the multi-
dimensional model in SAP BI Reports and analyses are based on these InfoCubes It is a self-enclosed dataset for a business area from a reporting viewpoint Queries can be defined and executed on the basis of an InfoCube
(Remember master data is not part of the InfoCube.
Technical name of SAP provided InfoCubes starts with 0.) Dimension – Grouping of logically related characteristics. Max 233 key
figures! Dimension Tables – Linked by SID tables to the master data tables. Your
own Cubes begin with A-Z. SAP BI allows a total of 16 dimensions.InfoCubes
InfoCube consists of a number of relational tables arranged
Fact Table – One table in which key figures are stored. Those are stored and maintained outside the InfoCube. Max 248 characteristics per dimension. 3-9 characters long
SAP BI Schema
data can be loaded into it A type of InfoProvider BI objects are called InfoProviders when queries can be
executed based on them Standard InfoCubes are technically optimized for read access.Types of InfoCubes
Physically contains data in the database They are data targets ie. Virtual Cubes (Virtual Provider) Only represent logical views of a dataset Data resides in data source
Viewing InfoCube Schema
Go to the Data Warehousing Workbench Metadata
Repository Choose InfoCube Find the InfoCube you want to view Eg. SAP Demo Sales and Distribution overview 0D_SD_C03 Choose InfoCube .schematic display as star schema
Execute 6. Choose value ranges (if desired) 7.1. Note that this is a flat file 21 derived from a relational database (star schema)
2. Execute 8.0D_SD_C03)
Right click and Display data 3. 4. View the data in the spreadsheet. Request export to a local spreadsheet file 9. Click on Fld Selection for output. Select the fields (characterisitcs and key figures that you want) 5.
Viewing/Downloading Data in an InfoCube
Start Data Warehousing Workbench: Modeling (RSA1)
Choose Modeling InfoProvider Navigate to the InfoCube using the hierarchy of InfoAreas (SAP Demo Sales and Distribution overview .
InfoCube and Master Data
. Additional information about characteristics is referred to as master data. Master data types:
Attributes Texts (External) Hierarchies
Master Data Tables
Eg. the text description for 'material name' is stored in the text table and the material hierarchy is stored in the hierarchy table for the characteristic 'MATERIAL'. the attribute 'material group' is stored in the attribute table.
SAP BI MetaData Objects – Master Data Tables
3 possible components Text
Textual description of Master Data element (AU =
Australia). Telephone. Can be language and time dependent.
Characteristics which describe another Characteristic. Can be language and time dependent. (Address.
Tree like structures to group master data.) Can be language and time dependent.
Note: Master Tables = Attribute Tables in this slide
Key Figure Characteristic InfoCube Dimension Hierarchies Maintain Master Data Text InfoObject InfoSource Source System InfoArea
SAP BI MetaData Objects
InfoObjects Represent the structure that allows data to be stored in a BI systems. Either Characteristics or Key Figures.
. Used in BI to create structures and tables. Used to describe business processes and information requirements (fields):
Customers Sales revenue
Contain technical and specialist information for master
data and transaction data in the Meta Data Repository.
EUR USD ZWD
.Key Figures Any kind of numeric information used to measure a business process. size) for further clarification
Amount * Quantity * Number Integer Date Time
1000 1500 30.
Date 1/1/08 1/1/08 Customer Jones Rosemann Material Racer 26 Mountain B Sales Quantity 2 5
SAP BI MetaData Objects – Key Figures
Amount $2000 $4000
Six different types
* Requires Unit (currency.
2007 SalesRep NO S1 S1 S1 S2 S2 S1 S3 S2 S3 S2 Product NO P1 P1 P2 P1 P2 P2 P1 P2 P1 P2 Sales 300 200 100 200 300 400 100 200 200 150
.2007 26.10.10.Aggregation Key Figures are stored in Fact Table Aggregation defines how they are stored
Sum Maximum Minimum
SAP BI MetaData Objects – Key Figures
SalesRep NO S1 S1 S2 S2 S3 Year 2007 2007 2007 2007 2007 Month 10 10 10 10 10 Product NO P1 P2 P1 P2 P1 Sales 500 500 200 650 300
OrdDate 23.10.2007 25.2007 30.10.2007 30.2007 126.96.36.1997 27.10.2007 188.8.131.52.2007 27.2007 24.
SAP BI MetaData Objects – Key Figures
They are the attributes of the dimension table
Date 1/1/08 1/1/08 Customer Jones Rosemann Material Racer 26 Mountain B Sales Quantity 2 5 Amount $2000 $4000
Could be made up of more than one field Used to analyze Key Figures
. product. date.SAP BI MetaData Objects – Characteristics
Characteristics Designed to describe objects used with in the business process
customer. postcode. unit etc.
SAP BI MetaData Objects – Characteristics
Region City Customer Name Customer Phone
State City Customer Name Customer Phone
(Attributes of Customer)
etc) Display properties Transfer routines (executed when data is uploaded) Master data descriptions (time dependency. length. language dependency. (Calendar
only technical use in BI (Request ID)
currencies and units of measure are required for Amount and
compulsory assignment to time dimension in InfoCube.SAP BI MetaData Objects – Characteristics
Quantity data types year)
Technical field descriptions (data type. text properties. navigational properties.
SAP BI MetaData Objects – Characteristics
Types of Master Data Tables
• Compounding refers to the when more than one characteristic is
required to uniquely identify a master data record.Characteristic .
• The Characteristics
combine to form a concatenated primary key within a Dimension table.
Entity Relationship Model Department
DepartNO (PK) CostCenterNO (PK)
SAP BI MetaData Objects – InfoCube
Contains two types of data
Key Figures (transactional data) Characteristics
1 Fact Table and 16 Dimension Tables
3 Dimensions are predefined by SAP
Time Unit Data Package
Dim2 Dim3 Dim4 Dim5 Dim6 KF1 KF2
Up to 13 User-defined
• A SID table is used to store the reference between the two keys.Surrogate Keys
• In order to improve query execution the system assigns a numeric (surrogate) key to represent the structured alpha numeric key assigned in Master data.
Master Data SID Table
DIM ID 1 2 3 SID 1 2 3
DIM ID SalesRep
DIM ID DIM ID Product Time
. It contains a series of surrogate keys that link the Fact table and Master data together.Dimension Table
• A Dimension table does not store any master data records.
SAP BI Meta Data Objects – InfoArea/InfoCatalog
An InfoArea is a directory that stores all related InfoObjects within the same business context.
Separate InfoObject Catalogs are used for Key Figures
Displayed via a tree structure or directory
. An InfoObject Catalog is a folder within an InfoArea that stores specific InfoObjects.
Amount Unit Quantity Unit Number Integer Date Time Time Unit Package
Characteristic Attribute Text Hierarchy
Characteristic InfoObject Catalog Key Figure InfoObject Catalog
Here you would determine a time characteristic as an exception characteristic with. the aggregation Last Value. The key figure Number of Employees would. for example.Aggregation
The system has to aggregate using multiple
characteristics. for example. be totaled using the characteristic Cost Center.
. The system can aggregate with another rule for each key figure (exception aggregation). and not a time characteristic.
Hierarchies allow data to be presented in alternative
ways. Version Dependent
. Time or Interval dependent. Hierarchies can be either Version.
node may now represent a range of values.
• Time Dependent
• Interval Dependent
Instead of each node representing a single value.
InfoCube: Quick build
1 2 3 4 5 6 7
• Create InfoArea • Create InfoObject Catalogues • Create Characteristics and Key Figures • Create InfoCube and Define Dimensions • Assign Characteristics to Dimensions • Choose Key Figures
• Save and Activate InfoCube
Start with the Data Warehousing Workbench 2. 5. 4.
– Modeling Since InfoCubes are InfoProviders. go to InfoProvider Create InfoArea if needed Create InfoCube in the context menu of your InfoArea Specify name and description (you can copy an
existing InfoCube too)
6.InfoCube: Detailed build
. Choose a Standard Cube. 3.
You can view the Data Model in the context menu of the cube.Add the InfoObjects that you want to be part of the Time dimension 8.
. Then add and modify dimensions as modeled in your star schema 9.7. Save and Activate the InfoCube 12. Add Key figures InfoObjects 11. These InfoObjects were created previously 10. Add InfoObjects (characteristics) to the dimensions. Time dimension.
SAP BI uses an extended (snowflake) star schema Dimension tables. fact table and master data tables are
used to create the snowflake Master data tables reside outside the InfoCube Characteristics and key figure InfoObjects are used to model attributes of dimension tables and fact tables respectively