Top Banner
Multi-Dimensional Modeling with BW ASAP FOR BW ACCELERATOR BUSINESS INFORMATION WAREHOUSE A background of the techniques used to create SAP BW InfoCubes Document Version 2.0 SAP (SAP America, Inc. and SAP AG) assumes no responsibility for errors or omissions in these materials. These materials are provided “as is” without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages.
116

BW Multi Dimensional Data Modelling

Apr 07, 2015

Download

Documents

sam2sung2
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: BW Multi Dimensional Data Modelling

Multi-Dimensional Modeling with BWASAP FOR BW ACCELERATOR

BUSINESS INFORMATION WAREHOUSE

A background of the techniques used to create SAP BW InfoCubesDocument Version 2.0

SAP (SAP America, Inc. and SAP AG) assumes no responsibility for errors or omissions in these materials.

These materials are provided “as is” without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement.

SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials.

SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages.

Page 2: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL MODELING WITH BW

TH BWASAP FOR BW ACCELERATOR

Table of Contents

MULTI-DIMENSIONAL MODELING WITH BW..............................................................................1

ASAP FOR BW ACCELERATOR............................................................................................................1

TABLE OF CONTENTS........................................................................................................................ 2

1 INTRODUCTION........................................................................................................................... 1

1.1 SOFTWARE VERSION SUPPORTED................................................................................................11.2 REFERENCES............................................................................................................................... 11.3 OVERVIEW................................................................................................................................. 2

2 FROM MULTI-DIMENSIONAL MODEL TO INFOCUBE – FIRST APPROACH.................5

2.1 THE GOALS OF MULTI-DIMENSIONAL DATA MODELS.....................................................................52.2 SUBJECT AREA........................................................................................................................... 52.3 THE ROLE OF THE BW BUSINESS CONTENT.................................................................................52.4 BASIC MODELING STEPS............................................................................................................. 6

2.4.1 Step 1: Develop a complete understanding of the underlying business processes................72.4.1.1 Reaping benefits of BW’s Business Content.................................................................................9

2.4.2 Step 2: Create a valid Schema..........................................................................................102.4.2.1 The Multi-Dimensional Model (MDM)......................................................................................102.4.2.2 The Star Schema.........................................................................................................................10

2.4.3 Step 3 : Create an InfoCube Description..........................................................................132.5 RESUME................................................................................................................................... 14

3 STAR SCHEMA BASICS AND MODELING ISSUES................................................................15

3.1 HOW THE STAR SCHEMA WORKS..............................................................................................153.2 STAR SCHEMA ISSUES............................................................................................................... 16

4 MULTI-DIMENSIONAL SCHEMAS IN BW..............................................................................18

4.1 OVERVIEW................................................................................................................................ 184.2 CONNECTING MASTER TABLES TO INFOCUBES..........................................................................204.3 DIMENSIONS IN A BW SCHEMA.................................................................................................21

4.3.1 Master Data Table...........................................................................................................234.3.1.1 Reference Characteristic Assignment..........................................................................................234.3.1.2 Master Table Existence...............................................................................................................234.3.1.3 Assigning Attributes...................................................................................................................234.3.1.4 Attributes and Querying..............................................................................................................234.3.1.5 InfoObject Names and Names of Attributes................................................................................244.3.1.6 Time Dependent Attributes.........................................................................................................244.3.1.7 Compound Attributes..................................................................................................................25

4.3.2 Text Tables....................................................................................................................... 264.3.3 SID Tables....................................................................................................................... 27

4.3.3.1 InfoObject Definition and SID Tables.........................................................................................274.3.3.2 SID Tables Mainetance...............................................................................................................294.3.3.3 InfoCube Access and SID Tables................................................................................................29

4.3.4 External Hierarchy Table.................................................................................................314.3.4.1 External Hierarchy Types...........................................................................................................314.3.4.2 Tables for External Hierarchies...................................................................................................314.3.4.3 Loading External Hierarchy Data................................................................................................314.3.4.4 External Hierarchies and InfoCube Access..................................................................................31

2000 SAP AMERICA, INC. AND SAP AG TABLE OF CONTENTS

Page 3: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL MODELING WITH BW

TH BWASAP FOR BW ACCELERATOR

4.3.5 Dimension Tables of an InfoCube.....................................................................................334.3.5.1 Defining Dimension Tables........................................................................................................334.3.5.2 Columns of a Dimension Table...................................................................................................334.3.5.3 Limitations.................................................................................................................................344.3.5.4 Dimensions and Navigation........................................................................................................344.3.5.5 Loading data into Dimension Tables...........................................................................................344.3.5.6 Special BW Dimensions.............................................................................................................34

4.3.5.6.1 Packet Dimension................................................................................................................344.3.5.6.2 Unit/ Currency Dimension...................................................................................................34

4.3.5.7 Dimensions with only one Characteristic (Line Item Dimensions)..............................................354.4 FACT TABLE............................................................................................................................. 36

4.4.1 Multiple Fact Tables........................................................................................................364.4.2 Fact Table Partitioning....................................................................................................37

4.5 BW TERMINOLOGY.................................................................................................................. 39

5 MODELING ISSUES AND THE BW SCHEMA.........................................................................40

5.1 GRANULARITY.......................................................................................................................... 415.1.1 Fact Tables and Granularity............................................................................................415.1.2 Impacts on Storage........................................................................................................... 425.1.3 Impacts on Performance...................................................................................................42

5.2 LOCATION OF DEPENDENT ATTRIBUTES IN THE BW SCHEMA.....................................................435.2.1 Performance and Location of Dependent Attributes..........................................................435.2.2 Enterprise Data Warehouse and Location of Dependent Attributes...................................435.2.3 Data Load and Location of Dependent Attributes.............................................................44

5.3 TRACKING HISTORY IN THE BW SCHEMA..................................................................................455.3.1 History and InfoCube.......................................................................................................455.3.2 Slowly Changing Dimensions...........................................................................................47

5.3.2.1 Scenario I: Report the data to today‘s constellation - Today is Yesterday....................................495.3.2.1.1 Scenario I : Description........................................................................................................495.3.2.1.2 Scenario I: Solutions with BW.............................................................................................50

5.3.2.2 Report the data to yesterday‘s constellation as well -Yesterday is Today....................................525.3.2.2.1 Scenario II : Description......................................................................................................525.3.2.2.2 Scenario II: Solutions with BW............................................................................................53

5.3.2.3 Scenario III: Report the data to the respective constellation-Today or Yesterday-.......................565.3.2.3.1 Scenario III : Description.....................................................................................................565.3.2.3.2 Scenario III: Solution with BW...........................................................................................57

5.3.2.4 Scenario IV: Report only on data for constellations valid today and yesterday -Today and Yesterday-................................................................................................................................................... 58

5.3.2.4.1 Scenario IV : Description.....................................................................................................585.3.2.4.2 Scenario IV: Solution with BW...........................................................................................59

5.3.3 Usage of Time Scenarios.................................................................................................615.4 M:N RELATIONSHIPS................................................................................................................ 62

5.4.1 M:N Relationships and the Fact Table.............................................................................625.4.2 M:N Relationships within a Dimension.............................................................................62

5.4.2.1 Designing M:N Relationships using the Dimension Table...........................................................625.4.2.2 Designing M:N Relationships using a Compound Attribute........................................................62

5.5 FREQUENTLY CHANGING ATTRIBUTES (STATUS ATTRIBUTES)....................................................645.6 INFLATION OF DIMENSIONS.......................................................................................................655.7 MULTIPLE PROCESS REPORTING SCENARIOS..............................................................................66

5.7.1 MultiCubes....................................................................................................................... 675.7.2 Partitioning Attributes......................................................................................................70

5.8 ATTRIBUTE OR FACT (KEY FIGURE)...........................................................................................725.9 SAME CHARACTERISTIC SEVERAL TIMES IN THE MODEL.............................................................735.10 ARTIFICIAL KEY FIGURES.........................................................................................................73

5.10.1 Factless Fact tables......................................................................................................... 73

2000 SAP AMERICA, INC. AND SAP AG TABLE OF CONTENTS

Page 4: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL MODELING WITH BW

TH BWASAP FOR BW ACCELERATOR

5.10.2 Counting.......................................................................................................................... 735.11 BIG DIMENSIONS...................................................................................................................... 735.12 HIERARCHIES IN THE BW SCHEMA............................................................................................75

5.12.1 Hierarchies within a Dimension.......................................................................................755.12.2 Hierarchies within a Master Data table of a Characteristic..............................................765.12.3 External Hierarchies........................................................................................................ 76

2000 SAP AMERICA, INC. AND SAP AG TABLE OF CONTENTS

Page 5: BW Multi Dimensional Data Modelling

DATA MODELING WITH BW ASAP FOR BW ACCELERATOR

1 Introduction

This document provides background on the techniques used to create multi-dimensional structures within SAP BW which are called InfoCubes and suggestions to help the customer to understand when to apply the various techniques available.

1.1 Software Version Supported

This document applies to BW Version 2.0B or higher.

1.2 References

For more detailed information on the SAP BW Architecture please refer to The BW ODS Whitepaper and to the paper Hierachies in BW.

2000 SAP AMERICA, INC. AND SAP AG 1

Page 6: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

1.3 Overview

The BW version 2.0 was a major step in the evolution of the BW architecture and functionality. From the architecture point of view the introduction of the new BW Operational Data Store (BW ODS) is most important.

Note: The new BW ODS introduced with version 2.0B may not be confused with layer in version 1.2B which was called ODS. This layer is renamed in Version 2.0B to Persistent Staging Area (PSA).

The BW ODS is a multi-level layer in the BW data warehouse, which offers the functionality to store the result of the data cleansing, and data transformation process in transparent tables that are called ODS Objects. Doing so the BW ODS forms the historical foundation of the data warehouse.

To enable process integration multiple BW ODS Objects can feed other ODS Objects or InfoCubes. Business rules can be applied in the integration process.

The length of this integration chain of ODS Objects is not limited by BW.

BW Information Integration Architecture

SAPSAPR/3R/3APOAPOCRMCRMBBPBBP

LegacyLegacy

ExternalExternalProviderProvider

Ext

ract

ion

Master DataMaster Data

PSA Persistent Staging Area

SourceSystems

ETL Tools

Meta Data

PSAPSA

BW Operational Data StoreBW Operational Data Store

InfoCubesInfoCubes

Bu

sin

ess

Ru

les

BW ODSBW Operational Data Store

InfoCubes

Cle

ansi

ng

& T

ran

sfo

rmat

ion

End-UserData Access

••Ad HocAd Hoc Queries Queries••ReportingReporting••ApplicationsApplications••ModelsModels

Bu

sin

ess

Ru

les

SchedulingScheduling MonitoringMonitoring ChangeChangeManagementManagement

ServiceServiceManagementManagement

Granularity

Integration

2000 SAP AG AND SAP AMERICA, INC. 2

Page 7: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

The BW Architecture graphics illustrate that the InfoCubes should be founded on the integration layer for transactional data the BW ODS, but this is of course an option. Furthermore the InfoCubes are linked to common master reference data located in master data tables, text tables, and (external) hierarchy tables. Thus the BW infrastructure provides the structure for building InfoCubes founded on a common integrated basis. This approach allows for partial solutions based on a blueprint for an enterprise-wide data warehouse.

2000 SAP AG AND SAP AMERICA, INC. 3

Page 8: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

With the reporting capability on the members of the BW ODS Objects, also in the context of this paper additional functionality is offered.

BW ODS Objects can either be accessed directly or serve as Drill Thru target from the InfoCube point of view.

BW Information Access Architecture

LegacyLegacy

ExternalExternalProviderProvider

Master DataMaster Data

ETL Tools

Meta Data

PSAPSA

BW Operational Data StoreBW Operational Data Store

InfoCubesInfoCubes

SchedulingScheduling MonitoringMonitoring ChangeChangeManagementManagement

ServiceServiceManagementManagement

BW•Business Explorer•Web•Graphical User Interf

SAP-Models•Advanced Planning•Enterprise Mangem•CRM

Third Party Tools(ODBC/ ODBO)

SAPSAPR/3R/3APOAPOCRMCRMBBPBBP

PSA Persistent Staging Area

SourceSystems

BW ODSBW Operational Data Store

InfoCubes End-UserData Access

However when to use what BW structure (InfoCubes or ODS-Objects) as foundation for reporting and analysis is not discussed in this paper. This is done in The BW ODS White paper.

The focus of this paper is the support of Online Analytical Processing (OLAP) in BW. OLAP functionality is one of the mayor requirements in data warehousing. Roughly speaking OLAP offers even to inexperienced end-users the capability to analyze business process data (KPIs) with respect to the terms of the involved business lines. This is normally done step-by-step starting with business terms showing the KPIs on an aggregate level and further by proceeding to business terms on a more detailed level.

2000 SAP AG AND SAP AMERICA, INC. 4

Page 9: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

A simple example:

Salesorganisation Productorganisation Time KPIs

Sales Department Material Group Year Sales Amount

Sales Person Material Type Month Sales Quantity

Material Day

A multi-step multidimensional analysis could look like this:

1. Show me the Sales Amount by Sales Department by Material Group by Month

2. Show me the Sales Amount for a specific Sales Department ‘X’ by Material by Month

3. Etc., etc.,

Such kind of analytical processing is normally solved using InfoCubes.

An ODS-Object may serve to report on single record (event) level like:

Show the yesterdays Sales Orders for Sales Person ‘Y’.

What does not mean that sales order level data may not reside in an InfoCube this is always a question of information needs and navigation.

ODS Object should not be misused for multi-dimensional analysis.

The architecture of an enterprise data warehouse is quite a controversial issue and no further detail will be discussed here. Just keep in mind that this document details building only a part of a data warehouse with reusable objects, namely InfoCubes with master data and (external) hierarchies.

This document initially provides in Chapter 2 information concerning the transition from an information need to the common the multi-dimensional data model / Star Schema. As the BW Schema is based on the Star Schema we will give an introduction to the Star Schema and explain some general aspects in Chapter 3. The BW Schema is explained in detail in Chapter 4, we also explain here some modeling aspects, which directly derive from the BW Schema. In Chapter 5 deals with time aspects in the BW Schema and further demands which might have to be designed with BW.

2000 SAP AG AND SAP AMERICA, INC. 5

Page 10: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

2 From Multi-Dimensional Model to InfoCube – First Approach

This chapter deals with the fundamental steps of multi-dimensional data modeling to offer a motivation and understanding for the following more detailed modeling discussions. The experienced reader may therefore skip this chapter.

2000 SAP AG AND SAP AMERICA, INC. 6

Page 11: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

2.1 The goals of multi-dimensional data models

The overall goals of multi-dimensional models are:

Offer the information to the end-user in a way that corresponds to his normal understanding of his business i.e. show the KPIs or key figures or facts from the different points of view that influence them like sales organization, the product/ material perspective or of course time. In other words deliver structured information allowing the end-user easy navigation on it using any possible combination of business terms to illustrate the behavior of the KPIs.

Beside this the model should offer the basis for a physical implementation which is understandable for software (the so called OLAP engine) thus allows a program to access easily the required data

To cover the first point we introduce the Multi-Dimensional Model (MDM).The most popular physical implementation of multi-dimensional models on relational data base system based data warehouses is the Star Schema implementation. SAP BW uses the STAR SCHEMA approach and extends it to support integration within the data warehouse, to offer easy handling and allow high performance solutions.

2.2 Subject Area

As this paper describes the proceeding to model BW InfoCubes we assume that the subject area we want to create a solution for is well defined. During the modeling steps the awareness may come up that the best solution would mean more than one InfoCube. The criteria that influence this decision will be discussed in a special chapter.

2.3 The role of the BW Business Content

The SAP BW is not delivered as an empty box but with a wide range of Business Content i.e. with ready for load InfoCube schemas on the solution level and even queries based on these InfoCubes. Therefore the question may arise whether it is necessary to discuss data modeling with respect to BW in a general and fundamental manner. In situations with source data from R/3 applications there is something to be said for this objection. But also in this case we first have to understand the information needs of the end-user before we are able to compare these with the business content.

Nevertheless Business Content InfoCubes and even more the Business Content InfoSources (data structures offered by R/3 applications) helps at least to abbreviate the modeling process. We will not discuss the Business Content and how to get benefit during the modeling process as this is done in special papers.

If however we are in the situation to create an InfoCube based partly or even entirely on non-R/3 applications (so called legacy systems) the general proceeding offer a proofed approach.

2.4 Basic Modeling Steps

The steps should be understood as a general approach. Up to what extend they have to be carried out depends very much on the concrete situation and the experience of the involved project members.

2000 SAP AG AND SAP AMERICA, INC. 7

Page 12: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

After deciding about the subject area to be treated the basic steps that leads to a SAP BW based solution are:

1.1. Focus on the structure of informationFocus on the structure of information

Develope a complete understanding of the underlying business processes

(e.g. create an Entity Relationship Model (Diagram) of the business model) The ERM as a function of the information

2.2. Focus on analytical needs - Focus on analytical needs - Overcome model complexityOvercome model complexity

Create a valid schema Translate the ERM to the MDM / Star Schema The MDM as a function of the analytical processing

3.3. Build the solution as a part of an integrated data warehouse Build the solution as a part of an integrated data warehouse

The schema on the BW stage – the InfoCubes Translate the MDM / Star Schema to one or more InfoCube Schemas

Sales Rep ID

LastNameSalesDep

Material ID

Material NameMaterial TypeMaterial Group

Customer ID

Customer NameCityRegionOffice Name

Time Code ID

YearFiscal YearQuaterMounthDay of the Week

Material IDSales Rep IDTime Code IDCustomer ID

Sales AmountQuantityUnit Price

Time DimensionCustomer Dimension

Sales Org DimensionMaterial Dimension

FACT

Material DIM ID OrgStr DIM IDTime Code ID ....Quantity.....

SalesRep ID

Last Name...

Material DIM ID

Material IDMatType

Material ID

Mat.descriptionMatType...

OrgStr. DIM ID

SalesRep SalesDep SalesDep ID

Address...

Focus on analytical needs -Overcome model complexity

Build the solution as apart of an integrateddata warehouse

MDM/ Star Schema

SAP BW

ERM

Focus on the structure of information

2000 SAP AG AND SAP AMERICA, INC. 8

Page 13: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

2.4.1 Step 1: Develop a complete understanding of the underlying business processes

In this step we focus on the structurestructure of information :

the entities and the relations between them

There is no strict rule on how to develop a complete understanding of the underlying business process. Nevertheless using an Entity Relationship Model (ERM) is a good way of seeing the relevant business objects and their relationships. But depending on the situation and the experience sometimes it will be sufficient just to paint a diagram showing the entities and their relations.

Tools like VISIO or Erwin or any other modeling tool could be very helpful in this step.

An example may be the most efficient means to provide the understanding of how to approach to a Multi-Dimensional Model / Star Schema and finally to a valid BW implementation and to introduce the basic terms.

If the end-user describes his information needs and thus the subject area as follows:

‘Track the performance of materials with respect to customers and sales persons’ .

The following nouns tell how the end-user looks at the world: Material Customer Sales Person

The nouns are basic business terms and are usually called Strong Entities :

Customer Material Sales Person

Ask the end-user about the relationship between his basic business terms (strong entities).

Normally the relationship between strong entities are N:M Relationships i.e. a customer can purchase multiple materials and materials can be purchased by multiple customers:

2000 SAP AG AND SAP AMERICA, INC. 9

Page 14: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Customer Material Sales Person

Ask the end-user how he measures performance.

This will give you the basic Facts. Facts are normally of additive nature and describe the n:m relationships. In a business scenario with a working document this document forms an Intersection Entity which often resolves the n:m relationships to 1:n relationships. But in a first approach it is up to the end-user whether he wants to make analysis on e.g. sales transaction level i.e. whether he wants the working document to be in the model:

Customer

Sales Transaction

Material

Material group

Sales Person

Sales Department

Intersection Entity

Now the customer is asked to be more precise. The customer determines that additional details for material, customer and sales person are also required.

This gives you additional entities and attributes where attributes are the ”describing fields” of an entity In ERM diagrams attributes show the ”fields” in relational tables.The attributes demonstrate to which extent it is possible to store data concerning this entity.

2000 SAP AG AND SAP AMERICA, INC. 10

Page 15: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Customer

Material Sales Person

Material group Sales Department

Customer noCustomer nameCityRegion

Material noMaterial nameMaterial type color price

Material group noMaterial group name....

Sales TransactionDateCustomer noMaterial noSales pers noAmountQuantityCurrency

Sales pers. noSales pers. name.......

Sales dep. noSales dep. location.......

It is useful for the following steps to ask the end-user for details concerning relationships between entities and relationships between entities and their attributes.

It gives you an idea of ‘abnormal’ situations like n:m relationships between an entity and an attribute (s. material and color). This relationships have to be treated carefully:

Customer

City

Region

Material Group

Sales order

Price

Sales Person

Sales Dept.

Sales Dept. Loc.

Material

Material TypeColor

After these steps you will have an good idea about the business terms and how are the relationships between them. It gives you a good basis for a multidimensional model.

2000 SAP AG AND SAP AMERICA, INC. 11

Page 16: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

2.4.1.1 Reaping benefits of BW’s Business Content

In SAP product based scenarios the Business Content InfoSources give you a good foundation to identify entities, attributes and facts (key figures) of the underlying subject area. As BW offers the InfoSources ordered by applications it is easy to identify the InfoSource(s) which cover(s) your subject area. If the subject area is based on customer generated structures like LIS and CO-PA you have to contact these structures. The result is normally a complete set of entities and attributes. The relationships can be derived from the SAP product data model if they are not obvious.

Even if the solution is not entirely SAP product based or you plan to migrate a source legacy system e.g. to R/3 in the future the respective InfoSources should be regarded.

2000 SAP AG AND SAP AMERICA, INC. 12

Page 17: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Step 2: Create a valid Schema

This decisive step has the goal to overcome model complexity by focusing on analytical needs.

Sales Rep ID

LastNameSalesDep

Material ID

Material NameMaterial TypeMaterial Group

Customer ID

Customer NameCityRegionOffice Name

Time Code ID

YearFiscal YearQuaterMounthDay of the Week

Material IDSales Rep IDTime Code IDCustomer ID

Sales AmountQuantityUnit Price

Time DimensionCustomer Dimension

Sales Org DimensionMaterial Dimension

FACT

Focus on analytical needs -Overcome model complexity

MDM/ Star Schema

ERM

Overcome model complexity means the creation of a schema that is comprehensible for the end-user and for software.

2.4.1.2 The Multi-Dimensional Model (MDM)

(References to publications by Ralph Kimball provide the details for the multi-dimensional data model.)

Comprehensibility for end-user is reached by organizing entities and attributes from step 1 that are related in parent-child relationship (1:N) into groups. We call such groups Dimensions and the members of the dimensions Dimension Attributes or just Attributes. One could say that the strong entities define the dimensions. For the end-user the attributes of a dimension represent a specific business view on the facts (or key figures or KPIs) which are derived from the intersection entities. According to his usual understanding the attributes of a dimension are organized in a hierarchical way and the most atomic attribute that forms the leaves of the hierarchy defines the Granularity of the dimension. Granularity determines the detail of information. This model is called Multi-Dimensional Model (MDM). The Multi-Dimensional Model with the facts based in the center and the dimensions surrounding them is a simple but mighty concept and is understood by technical resources as well as by the end-user.

2.4.1.3 The Star Schema

The Star Schema offers comprehensibility for software. The Star Schema is the most popular way to implement a Multi-Dimensional Model in a relational database. Other solutions in this area are Snowflake Schemas. The BW InfoCubes are based on a Star Schema therefore we give a short introduction to the main terms and capabilities of the Star Schema.

2000 SAP AG AND SAP AMERICA, INC. 13

Page 18: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

In a Star Schema, one dimension represents one table. These Dimension Tables surround the Fact Table, which contains the facts (key figures), and are linked to that Fact Table via unique keys, one per Dimension Table. Each dimension key uniquely identifies a row in the associated Dimension Table. Together these dimension keys uniquely identify a specific row in the Fact Table.

Star Schema

Sales RepSales Rep ID ID

LastNameSalesDep

Material IDMaterial ID

Material NameMaterial TypeMaterial Group

CustomerCustomer ID ID

Customer NameCityRegionOffice Name

Time Code IDTime Code ID

YearFiscal YearQuaterMounthDay of the Week

Material IDMaterial IDSales RepSales Rep ID IDTime Code IDTime Code IDCustomerCustomer ID ID

Sales AmountQuantity

Time Dimension

(Table)

Customer Dimension

(Table)

Sales Org Dimension

(Table)

Material Dimension

(Table)

FACT (Table)

The key elements of a Star Schema are:

Central Fact Table with Dimension Tables shooting off from it Fact Tables typically store atomic and aggregate transaction information, such as

quantitative amounts of goods sold. They are called Facts Facts are numeric values of normally additive nature Fact Tables contain foreign keys to the most atomic Dimension Attribute of each

Dimension Table Foreign keys tie the fact Table rows to specific rows in each of the associated dimension

Tables Points of the star are Dimension Tables Dimension Tables store attributes about the data stored in the Fact Table, and also textual

data Dimension Tables are denormalized The most atomic dimension attributes in the dimensions define the Granularity of the

information, i.e. the number of records in the Fact Table

The Fact Table :

2000 SAP AG AND SAP AMERICA, INC. 14

Page 19: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

CustomerCustomerStreetStreet SalesPersSalesPers SalesRegionSalesRegion MaterialMaterial UnitUnit DateDateDate

Customer SalesPers Material Date Amount Quantity

Ides Gmbh Meier Monitor 981118 1000 2

Customer SalesPers Material Date Amount Quantity

Ides Gmbh Meier Monitor 981118 1000 2

Ides Gmbh Meier Monitor 981118

The basic proceeding mapping an ERM to the MDM/ Star Schema is shown on the following graphic:

Sales Rep ID

LastNameSalesDep

Material ID

Material NameMaterial TypeMaterial Group

Customer ID

Customer NameCityRegionOffice Name

Time Code ID

YearFiscal YearQuaterMounthDay of the Week

Material IDSales Rep IDTime Code IDCustomer IDSales AmountQuantityUnit Price

Time DimensionCustomer Dimension

Sales Org DimensionMaterial Dimension

FACT??

Customer

City

Region

Material Group

Sales order

Price

Sales Person

Sales Dept.

Sales Dept. Loc.

Material

Material TypeColor

General Mapping Guidelines

Fact Table:

2000 SAP AG AND SAP AMERICA, INC. 15

Page 20: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

A Central intersection entities defines a Fact Table. An intersection entity like document number is normally described by facts (Sales Amount, Quantity) which form the non-key columns of the Fact Table. One could say the M:N relationships between strong entities meet each other in the Fact Table thus defining the cut between dimensions

Dimensions (Tables):

Attributes with 1:N conditional relationships should be stored in the same dimension, such as material group and material.

The foreign -> primary key relations define the dimensions

Time :

A special case is the time dimension because there is no correspondence in the ERM therefore we have to introduce time attributes (like day, week, year,..) in the MDM process to cover the analysis needs

These considerations provide a starting point for dimension analysis, but additional considerations will impact the grouping of the attributes and will be discussed in detail later.

2000 SAP AG AND SAP AMERICA, INC. 16

Page 21: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

2.4.2 Step 3 : Create an InfoCube Description

Build the solution within BW with respect to the analytical needs and as a part of an integrated data warehouse.

2.4.3 Translating the MDM/ Star Schema i.e. the results of Step 1 and Step 2 to an InfoCube Description is of course the topic of this paper and will be investigated in the following chapters in depth.

A first impression is given by the following graphic:

Translate the MDM/ Star Schema to an InfoCube Description :

Sales Rep ID

LastNameSalesDep

Material ID

Material NameMaterial TypeMaterial Group

Customer ID

Customer NameCityRegionOffice Name

Time Code ID

YearFiscal YearQuaterMounthDay of the Week

Material IDSales Rep IDTime Code IDCustomer ID

Sales AmountQuantityUnit Price

Time DimensionCustomer Dimension

Sales Org DimensionMaterial Dimension

FACT

MDM/ Star Schema

SAP BW

Material DIM ID OrgStr DIM IDTime Code ID ....Quantity.....

SalesRep ID

Last Name...

Material DIM ID

Material IDMatType

Material ID

Mat.descriptionMatType...

OrgStr. DIM ID

SalesRep SalesDep SalesDep ID

Address...

2000 SAP AG AND SAP AMERICA, INC. 17

Page 22: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

2.5 Resume

Ralph Kimball writes in his book ‘ The Data Warehouse Toolkit’ :

The nine database design decision points for a dimensional data warehouse consist of deciding on the following:

1. The processes, and hence the identity of the Fact Tables ((one Fact Table - one InfoCube...) -> intersection entities)

2. The dimensions of each Fact Table (-> strong entities)

3. The dimension attributes with complete descriptions and proper terminology (-> attributes and entities)

4. The grain of each Fact Table

5. The facts, including pre-calculated facts

6. How to track slowly changing dimensions

7. The aggregations, heterogeneous dimensions, mini-dimensions, query modes and other physical storage decisions

8. The historical duration of the database (archiving aspects)

9. The urgency with which the data is extracted and loaded into the data warehouse (time frame for loading)

2000 SAP AG AND SAP AMERICA, INC. 18

Page 23: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

3 Star Schema Basics and Modeling Issues

In the previous chapter we introduced the Star Schema. As most of the relevant properties for modeling derive directly from the schemas we will now have a closer look to them. We start with the Star Schema as it is the force behind the BW Schema and is easier to understand as well. Coming to the BW Schema in the next chapter this basics will help you to develop a fundamental understanding of the modeling properties of the BW Schema. We emphasize that this chapter discusses the Star Schema and not the BW Schema

3.1 How the Star Schema Works

How the result of query is evaluated using a Star Schema can be best shown by an example. If we need the following information :

Show me the Sales Amount for Customers located in 'New York' with Material group 'XXX' in the Year = '1997'

Star Schema

Sales RepSales Rep ID ID

LastNameSalesDep

Material IDMaterial ID

Material NameMaterial TypeMaterial Group

CustomerCustomer ID ID

Customer NameCityRegionOffice Name

Time Code IDTime Code ID

YearFiscal YearQuaterMounthDay of the Week

Material IDMaterial IDSales RepSales Rep ID IDTime Code IDTime Code IDCustomerCustomer ID ID

Sales AmountQuantity

Time Dimension

(Table)

Customer Dimension

(Table)

Sales Org Dimension

(Table)

Material Dimension

(Table)

FACT (Table)

Then the result is determined in two steps:

Browsing the Dimension Tables

Access the Customer Dimension Table and select all records with City = 'New York' Access the Material Dimension Table and select all records with Material group =

'XXX' Access the Time Dimension Table and select all records with Year = '1997'

2000 SAP AG AND SAP AMERICA, INC. 19

Page 24: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

As a result of these three browsing activities, there are a number of key values (Customer IDs, Material IDs, Time Code ID), one from each Dimension Table affected.

Accessing the Fact Table

Using the key values evaluated during Browsing, select all records in the Fact Table which have these values in common in the Fact Table record key.

3.2 Star Schema Issues

With respect to the processing of a query and design of the Star Schema we realize :

Reflecting ‘real world’ changes in the Star Schema

How the changes in the real world are treated i.e. how the different time aspects are handled is the most important topic with data warehouses.

Star-I. The role of the Fact Table The Star Schema reflects the changes in the ‘real world’ normally by adding rows to the Fact Table. More precise changes in the world like Customer ‘4711’ purchase Material ‘BBB’ at Day ‘19980802’ for 100$ create a new record in the Fact Table which is identified by the combination of the key attributes of the Dimension Tables. In this case the Customer number, the Material Id and the Day :

Changes in the real world -> new rows in the fact table

Materialgroup Material

X AAA

X BBB

Y CCC

Y DDD

Materialgroup Material

X AAA

X BBB

Y CCC

Y DDD

Material Customer Day Revenue

AAA 4711 19980901 100

BBB 4712 19980901 100

CCC 4712 19980901 100

DDD 4712 19980901 100

BBB 4711 19980902 100

Material Customer Day Revenue

AAA 4711 19980901 100

BBB 4712 19980901 100

CCC 4712 19980901 100

DDD 4712 19980901 100

BBB 4711 19980902 100

Material Dimension Table

Fact Table

BBB 4711 19980902 100

Transaction record

Add new record to fact table

Customer Custgroup

4711...........................

4712...........................

Customer Custgroup

4711...........................

4712...........................

Day Month Year

19980901 .....................

19980902 .....................

Day Month Year

19980901 .....................

19980902 .....................

Customer Dimension Table Time Dimension Table

Accessing new record in fact table

2000 SAP AG AND SAP AMERICA, INC. 20

Page 25: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Star-II. The role of the Dimension Tables But there are also changes between attribute values of attributes within the same dimension (e.g. the material X belongs no longer to material group Y but to material group Z). Usually these changes occur more or less frequent and in the theory they are therefore called ‘slowly changing dimensions’. How to deal with these changes has a big impact on reporting possibilities and the data warehouse management. The different time scenarios that are possible and how you can solve these with BW are discussed in detail in the next sections.

Reporting

Star-III. Many reports can be created by accessing only the Dimension Tables (Master data reporting).

Star-IV. The Star Schema saves information about things that did happen and not things that did not happen (e.g. report the revenue for the customers in New York within a certain time span would show the customers that have any revenue but not the customers that have no revenue)

Aggregation

Star-V. Only the information at the granularity of the Dimension Table keys (Material ID, Customer ID, Time Code ID, SalesRep ID) need to be stored to make any desired aggregated level of information available.

Star-VI. More precise: any summarized information can be retrieved at run time i.e. from a functionality point of view there is no need to store precalculated aggregated data but

Star-VII. With large ( number of rows) Fact Tables and / or large Dimension Tables precalculated aggregates must be introduced for performance reasons.

Attribute Relationships (Hierarchies)

In the Star Schema there is one (real) attribute (most granular) as unique identifier of each Dimension Table row joining the Fact Table. The other attributes of a Dimension Table normally are parents of such an identifying attribute. This leads to the term Hierarchy. With hierarchies there exist a lot of challenges :

Star-VIII. N:M relationship within a dimension There is no simple way to handle an N:M relationship between two attributes within a Dimension Table, such as having materials with different colors. If material is the lowest level, it is not possible to put both material and material color into one normal star Dimension Table as we would have the one material value with multiple colors associated with that one material. If this were the case, material is no longer a unique key.

2000 SAP AG AND SAP AMERICA, INC. 21

Page 26: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Star-IX. (s. 6.1.6).No leaf attribute values Again there is no easy way to handle transactional input to a Star Schema where the

facts are offered at different attribute levels whereby the attributes belong to the same dimension. For example, assume there are the attributes material and material group in the same dimension. Some subsidiaries can offer transactional data at material level whereas others can only offer data at material group level. The result in the latter case is Dimension Table rows with blank or null values for the material, which destroys the unique key material.

Star-X. Unbalanced Hierarchies Very often we have attributes in a dimension where there exists a relationship between some attribute values whereas with others there is none. As the relations between attribute values of different attributes within a dimension form a tree that will result in paths from the root to the leaves of different length. This unbalanced hierarchies will produce reports with dummy hierarchy tree nodes.

Table Sizes and Performance

Star-XI. Don't destroy browsing performance. Dimension Tables should have a 'relatively' small number of rows (in comparison to the Fact Table; factor at least 1:10 until 1:20).

Schema Maintenance

Star-XII. There are no limitations to the Star Schema with respect to the number of attributes in the dimension and Fact Tables except the limitations caused by the underlying relational data base.

Star-XIII. Flexibility regarding the addition of characteristics and key figures to the schema caused by properties of relational data bases.

4 Multi-Dimensional Schemas in BW

2000 SAP AG AND SAP AMERICA, INC. 22

Page 27: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

BW ‘Developed’ Star SchemaBased on experience with the Star Schema, the SAP BW Schema uses a more sophisticated approach to guarantee consistency in the data warehouse and to offer schema based functionality to cover the end-users analysis needs.

Creating a valid a multi-dimensional Schema in BW means always that you have to bear in mind the overall enterprise data warehouse requirements and the solution specific analysis and reporting needs. Wrong decisions in this area will have a deep impact to the solution. The result can mean bad performance or even an invalid schema.

Overview

The picture shows you a multi-dimensional BW Schema using the example from the previous chapters. Only those parts are included which are important from the modeling point of view.

F A C T T a b l e

G eb iet 1 G eb iet 2 G eb iet 3

B ez irk 1

G eb iet 3 a

B ez irk 2

R eg ion 1

G eb iet 4 G eb iet 5

B ez irk 3

R eg ion 2

G eb iet 6

B ez irk 4

G eb iet 7 G eb iet 8

B ez irk 5

R eg ion 3

V ertrieb sorg an isation

M a t e r i a l G r o u p

M a t e r i a l H i e r a r c h y T a b l eM a t e r i a l _ D i m e n s i o n _ I DS a l e s O r g _ D i m e n s i o n _ I DT i m e _ D i m e n s i o n _ I DC u s t o m e r _ D i m e n s i o n _ I D

S a l e s A m o u n tQ u a n t i t y

M a t e r i a l N u m b e rL a n g u a g e C o d e

M a t e r i a l N u m b e rL a n g u a g e C o d e

M a t e r i a l N a m e

M a t e r i a l T e x t T a b l eM a t e r i a l _ D i m e n s i o n _ I D

M a t e r i a l N u m b e r

M a t e r i a l D i m e n s i o n T a b l e

M a t e r i a l M a s t e r T a b l e

M a t e r i a l N u m b e rM a t e r i a l N u m b e r

M a t e r i a l T y p e

S a l e s R e p M a s t e r T a b l e

S a l e s R e p N u m b e rS a l e s R e p N u m b e r

S a l e s D E P

S a l e s R e p N u m b e rL a n g u a g e C o d e

S a l e s R e p N u m b e rL a n g u a g e C o d e

S a l e s R e p N a m e

S a l e s R e p T e x t T a b l e

C u s t o m e r N u m b e rL a n g u a g e C o d e

C u s t o m e r N u m b e rL a n g u a g e C o d e

C u s t o m e r N a m e

C u s t o m e r T e x t T a b l e

C u s t o m e r M a s t e r T a b l e

C u s t o m e r N u m b e rC u s t o m e r N u m b e r

C i t y

R e g i o nT i m e _ D i m e n s i o n _ I D

Y e a rQ u a t e rM o u n t hD a y

T i m e D i m e n s i o n T a b l e

S a l e s O r g _ D i m e n s i o n _ I D

S a l e s R e p N u m b e r

S a l e s O r gS a l e s O r g D i m e n s i o n D i m e n s i o n T a b l eT a b l e

C u s t o m e r _ D i m e n s i o n _ I D

C u s t o m e r N u m b e r

C u s t o m e r D i m e n s i o n T a b l e

C u s t o m e r C u s t o m e r D i m e n s i o nD i m e n s i o n

I n f o C u b eI n f o C u b e

T i m eT i m e D i m e n s i o n D i m e n s i o n

M a t e r i a lM a t e r i a l D i m e n s i o n D i m e n s i o n

S a l e s O r gS a l e s O r g D i m e n s i o n D i m e n s i o n

Observations:

The center of a multidimensional Schema in BW forms the Fact TableThe facts of the Fact Table are called in BW Key Figures (e.g. Sales Amount).

The Fact Table is surrounded by Dimensions

A Dimension consist of different table types:

2000 SAP AG AND SAP AMERICA, INC. 23

Page 28: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Dimension TableThe attributes of the Dimension Tables are called in BW Characteristics (e.g. Material). The meta data object in BW to describe Characteristics and also Key Figures (facts) is called InfoObject

Master Tables :

Master Data Table

Dependent attributes of a characteristic can be stored in a separate table called the Master Data Table of the characteristic. They are called in BW terminology Attributes (e.g. Material Type).

Text TablesTextual descriptions of a characteristic are stored in a separate Text Table. The system runs consistently in different languages at a time.

External Hierarchy TablesHierarchies of characteristics or attributes may be stored in separate Hierarchy Tables. For this reason these hierarchies are named External Hierarchies (e.g. Standard Cost Center Hierarchy from R/3-CO for the characteristic Cost Center).

Important

A possible point of confusion is the use of the term hierarchy in BW. The normal understanding of hierarchy is defined as a sequence of parent-child relationships between characteristics. From this perspective, there are hierarchies in the Dimension Tables, Master Tables, and in Hierarchy Tables.

The multi-dimensional Schema in BW is separated into two parts:

The InfoCube which describes the process oriented part of the solution. An InfoCube consist of

One Fact Table and

Several Dimension Tables

The InfoCube – the solution dependent part of the schema

2000 SAP AG AND SAP AMERICA, INC. 24

Page 29: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

The solution-independent shared Master tables valid for use with any InfoCube and BW ODS Object in the data warehouse.

These Master tables are the glue of the data warehouse and are discussed in depth in the next chapter.

4.1 Connecting Master Tables to InfoCubes

To cover all the requirements Master Tables of a BW Schema are not linked directly to InfoCubes as the following simplified picture illustrates :

Multi-Dimensional Schema in BW

2000 SAP AG AND SAP AMERICA, INC. 25

Page 30: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Text

SID Tables

Master

Hierarchies

Hierarchies

Master

SID Tables

Text

Hierarchies

Master

SID Tables

Text

Hierarchies

Master

SID Tables

Text

Hierarchies

Master

SID Tables

Text

Hierarchies

Master

SID Tables

Text

Text

SID Tables

Master

Hierarchies

Text

SID Tables

Master

Hierarchies

Text

SID Tables

Master

Hierarchies

DimensionTable

Text

SID Tables

Master

Hierarchies

DimensionTable

DimensionTable

DimensionTable

DimensionTable

Hierarchies

Master

SID Tables

Text

FACT

As you can observe in the BW Schema pointer or translation tables called SID (Surrogate-ID) Tables are used to link the solution independent Master tables of the BW Schema to InfoCubes.The graphic shows a simplified version of the reality what kind of SID tables exist and their tasks is discussed in detail in the SID table section.

4.2 Dimensions in a BW Schema

Earlier we introduced some basic rules to define the dimensions on the results of the prior analysis.

Rules of thumb to:

Attributes with 1:N conditional relationships should be stored in the same Dimension, such as material group and material.

The foreign -> primary key relations define the dimensions.

If we have made the decision about the members of a dimension we have to consider that a Dimension in the BW Schema might consists of different parts :

2000 SAP AG AND SAP AMERICA, INC. 26

Page 31: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

G eb ie t 1 G eb ie t 2 G eb ie t 3

B ez irk 1

G eb ie t 3 a

B ez irk 2

R eg ion 1

G eb ie t 4 G eb ie t 5

B ez irk 3

R eg ion 2

G eb ie t 6

B ez irk 4

G eb ie t 7 G eb ie t 8

B ez irk 5

R eg ion 3

V ertrieb sorg an isa tion

M a t e r i a l G r o u p

M a t e r i a l H i e r a r c h y T a b l e

M a t e r i a l N u m b e rL a n g u a g e C o d e

M a t e r i a l N u m b e rL a n g u a g e C o d e

M a t e r i a l N a m e

M a t e r i a l T e x t T a b l eM a t e r i a l _ D i m e n s i o n _ I D

M a t e r i a l N u m b e r

M a t e r i a l D i m e n s i o n T a b l e

M a t e r i a l M a s t e r T a b l e

M a t e r i a l N u m b e rM a t e r i a l N u m b e r

M a t e r i a l T y p e

M a t e r i a lM a t e r i a l D i m e n s i o n D i m e n s i o n

We emphasize the following:

Dimensions in a BW Schema

The dependent attributes of the characteristics can reside in different locations of a BW Schema Dimension.

One of the primary goals of this paper is to show the different modeling aspects which result in a different location of an attribute in a dimension of a muti-dimensional BW schema.

2000 SAP AG AND SAP AMERICA, INC. 27

Page 32: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Material

Material Dimension

Materialgroup

MaterialDimension table

As a Characteristic As a Characteristic ?? MaterialMaster table

As a NavigationalAs a Navigational / /

DisplayDisplay Attribute Attribute ??

MaterialHierarchy table

As a HierarchyAs a Hierarchy ? ?

as the graphic shows the Material - Material group relation can be designed defining Material group

either as a Characteristic i.e. member of a Material Dimension Table

or as an attribute i.e. member of the Material Master Table

or as a node describing attribute of the Material Hierarchy Table

or as any combination of the above options.

Which choice fits best primarily depends on the desired time aspects in your queries and is discussed in chapter 5.

Important

To avoid confusion we emphasize:

In BW the terms characteristic and attribute shall only show the different locations in the Schema. As shown above the Material group can occur even in the same schema as a Characteristic in the Material Dimension table and as an Attribute of Material in the Material Master Data Table.

Without regard to a specific schema location as with the meta data definition we just talk about InfoObjects of type characteristic.

2000 SAP AG AND SAP AMERICA, INC. 28

Page 33: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

4.2.1

4.2.2 Master Data Table

Defining an InfoObject of type Characteristic you have the following modeling relevant options with respect to the defintion of the Master Data Table.

4.2.2.1 Reference Characteristic Assignment

When defining an InfoObject of type characteristic you are asked whether you want to refer to an existing other characteristic. If you do so beside others the new characteristic will have the master table of the referred characteristic.

For example: the characteristics ‘sending costcenter’ and ‘receiving costcenter’ refer to the same characteristic 0COSTCENTER and thus the same Master Tables

4.2.2.2 Master Table Existence

Does a Master Data Table exist at all ? (tab strip: Master Data -> Check box)

This allows you do add Infoobjects as attributes in the attribute tab strip section.

For example in your schema all attributes of a document number may be assigned to other characteristics like customer or material.

4.2.2.3 Assigning Attributes

A result of the modeling phase are the attributes of a characteristic which shall reside in it’s Master Data Table. The attributes are added using the ‘Attributes’ tab strip in the InfoObject maintenance.

These attributes form the communication structure for the InfoSource to load the master data.

4.2.2.4 Attributes and Querying

Whether an attribute can potentially be used for query navigation (such as drill-down, up, across, or within) on an InfoCube or ODS Object can be individually defined (Attribute tab strip-> Navigational check boxes). If you mark the navigation check box of an attribute this attribute is called a Navigational Attribute.

Note: you have to activate the Navigational Attributes in the InfoCube definition to allow navigation with respect to this InfoCube.

From navigational point of view navigational attributes behave like characteristics in an InfoCube. But the reporting behavior of the Navigational Attributes in Master Tables differ from the characteristics behavior.

Attributes not used for navigation are called Display Attributes. If an InfoObject of type characteristic is an attribute and not marked as navigational attribute then it is only possible to report this attribute in conjunction with a characteristic or with a navigational attribute.

For attributes of type key figure the following applies:

2000 SAP AG AND SAP AMERICA, INC. 29

Page 34: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

InfoObjects of type key figure are always Display Attributes. If you want to calculate in a query with an attribute it has to be an InfoObject of type key figure.

4.2.2.5 InfoObject Names and Names of Attributes

It is possible to create schemas having the same InfoObject as characteristic in a Dimension Table of an InfoCube and as Navigational Attribute of another characteristic which is in the InfoCube as well. To avoid confusion you should give a name to the Navigational Attribute that differs from its characteristic name. The name is defined in the attribute tabstrip for each navigational attribute.

For example:

The InfoObject MMATERIAL is in the InfoCube and MMATGR is a Navigational Attribute from MMATERIAL. Let’s assume MMATGR is as a result of the model also a characteristic in the InfoCube. ‘Material group’ is the name of the InfoObject MMATGR if now you would use the same name ‘Material group’ for the Navigational Attribute this name would occur twice in the InfoCube description of the query builder. This would certainly confuse the end user.

4.2.2.6 Time Dependent Attributes

Each Attribute can be defined individually as Time Dependent.

An example will make clear the different behavior of Not Time Dependent and Time Dependent Attributes .

Example Not Time Dependent Attributes:

The InfoObject Material has the attribute MatType and we are only interested to use the latest Materials - MatTypes constellations within reports.

MatType is defined as a not time dependent attribute (no check in time dependent check box). Lets assume that Material ‘BBB’ has MatType ‘300’ in 09 1998. Then a new assignment of MatType ‘200’ to Material ‘BBB’ in 10 1998 would overwrite the old constellation. The Material – MatType assignments are stored in the Not Time Dependent Attribute Master Data Table:

Material MatType

AAA 100

BBB 200

CCC 100

DDD 100

Not Time Dependent Attribute Master Data Table(table name: /BIC/PMaterial)

Example Time Dependent Attributes:

2000 SAP AG AND SAP AMERICA, INC. 30

Page 35: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

The InfoObject Material has the attribute MatGroup.We are also interested in former Materials – MatGroup constellations. MatGroup is defined as a time dependent attribute (check in time dependent check box). Lets assume that Material ‘BBB’ has MatGroup ‘X’. Then from October, 1st 1998 a new assignment of MatGroup ‘Y’ to Material ‘BBB’ is valid. The result is a new record in the Time Dependent Attribute Master Data Table with the respective validity. The old constellation gets only a new ‘Date To’ value:

Material DateFrom DateTo MatGroup

AAA 01/1000 12/9999 X

BBB 01/1000 09/1998 X

BBB 10/1998 12/9999 Y

CCC 01/1000 12/9999 Y

DDD 01/1000 12/9999 Y

Time Dependent Attribute Master Data Table(table name: /BIC/QMaterial)

There exist one important aspect from the modeling point which we want to emphasize:

Time Dependent Attributes and Querying

During a single query execution only ONE characteristc value – Time Dependent Attribute value constellation can be addressed!

Addressing a specific constellation is done via the query Key Date.

The Key Date is valid for all time dependent attributes assignments which are used in the query.

We summarize the following aspects:

In the Attribute tabstrip section exists one ‘time dependent’ check box for each attribute. Time dependency of an attribute allows you to keep track on the changes over time of the

relation of the characteristic and the time dependent attribute values. From the technical implementation point of view there exist two Master Data Tables if we have

not time dependent and time dependent attributes. One master data table to store all relations to not time dependent attributes (name of the

table: /BIC/Pinfobjectname) and one table for relations to time dependent attributes (name of the table: /BIC/Qinfobjectname).

The time dependent attributes master data table has additional DATETO and DATEFROM system attributes. In queries the different constellations are addressed using the key date (-> Query properties). The validity attributes are not available for navigation.

Note: The table names of BW business content InfoObjects start with /BI0/ ...

A closer look at the reporting possibilities of time dependent attributes is given in chapter 5.

2000 SAP AG AND SAP AMERICA, INC. 31

Page 36: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Important

There are no precalculated aggregates at time-dependent attribute level!

4.2.2.7 Compound Attributes

Characteristics may not be unique i.e. another attribute is necessary to allow addressing the data. Example: the InfoObject 0COSTCENTER (cost center) offered from R/3 applications is only unique with the InfoObject 0CO_AREA (Controlling Area)

These additional characteristics attributes can be defined in the compound tabstripsect section of the characteristic InfoObject maintenance.

4.2.3 Text Tables

The Text Table of an InfoObject of Type characteristic keeps the descriptions of the characteristic values. The existence of a text table and different description types as short, middle and long text descriptions and language dependency can be defined in the master data tabstrip section.

The Text Table or better the description attributes may be defined as time dependent.

Transfer Rules may be applied during text data load.

2000 SAP AG AND SAP AMERICA, INC. 32

Page 37: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

4.2.4 SID Tables

SID Tables play an important role linking the data warehouse information structures to the subject-oriented InfoCubes and ODS Objects.

To speed up the access to InfoCubes and to allow an InfoCube and ODS-Object independent master data layer each characteristic and attribute is assigned a SID column and their values are encoded into 4-byte integer values.

Note:

The algorithm to determine a SID value works fastest if the characteristic does not exceed the numerical size of nine as in this case the characteristic values will be the SID. No traditional SID table has to be accessed as the charactereristic or attribute values correspond 1:1 to their SIDs.

4.2.4.1 InfoObject Definition and SID Tables

To offer optimal performance with the various schemas with respect to master data access three different SID tables might be generated.

SID tables with respect to Master Data:

The ‘Traditional’ SID table which we know already from earlier versions is always generated if an InfoObject is not defined as ‘Attribute Only’ (Tabstrip general). This table is used if the access to an Infocube or ODS-Object use an navigational attribute or if the access is via a characteristic without attributes.

The Not Time Dependent Attribute SID table of a characteristic for access via not time dependent attributes.

The Time Dependent Attribute SID table of a characteristic for access via time dependent attributes.

Example:

Supposed the InfoObject Material has attributes of type ‘not time dependent’ and ‘time dependent’. The activiation of this InfoObject generates the following tables (for illustration purposes we use the example from the Master Table section) :

:

Material Master Table for not time dependent attributes : /BIC/Pmaterial

2000 SAP AG AND SAP AMERICA, INC. 33

Page 38: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Material MatType

AAA 100

BBB 200

CCC 100

DDD 100

Not Time Dependent Attribute Master Data Table(table name: /BIC/PMaterial)

2000 SAP AG AND SAP AMERICA, INC. 34

Page 39: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Material Master Table for time dependent attributes : /BIC/QMaterial

Material DateFrom DateTo MatGroup

AAA 01/1000 12/9999 X

BBB 01/1000 09/1998 X

BBB 10/1998 12/9999 Y

CCC 01/1000 12/9999 Y

DDD 01/1000 12/9999 Y

Time Dependent Attribute Master Data Table(table name: /BIC/QMaterial)

Material SID Table ( traditional SID Table) : /BIC/SMaterial

Material-SID Material

001 AAA

002 BBB

003 CCC

004 DDD

‘Traditional‘ SID Table(table name: /BIC/SMaterial)

Material not time dependent Attribute SID Table : /BIC/XMaterial

Material-SID Material MatType-SID

001 AAA 22222

002 BBB 33333

003 CCC 22222

004 DDD 22222

Not Time Dependent Attribute SID Table(table name: /BIC/XMaterial)

Material time dependent Attribute SID Table : /BIC/YMaterial

2000 SAP AG AND SAP AMERICA, INC. 35

Page 40: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Material-SID Material DateFrom DateTo MatGroup-SID

001 AAA 01/1000 12/9999 910

002 BBB 01/1000 09/1998 910

002 BBB 10/1998 12/9999 920

003 CCC 01/1000 12/9999 920

004 DDD 01/1000 12/9999 920

Time Dependent Attribute SID Table (table name: /BIC/YMaterial)

4.2.4.2 SID Tables Mainetance

All these SID tables are automatically maintained during master data load.

SID tables are maintained during InfoCube load if no referential integrity check is enforced (InfoPackage).

4.2.4.3 InfoCube Access and SID Tables

To get an understanding of the function of these SID tables a simple example is given how the result of query is evaluated. If we need the following information :

Show me the Sales Amount for Customers located in 'New York' with Material group 'X' and ‘Y’ in the Year = '1999'

Lets assume the Material group is an Navigational Attribute (not time dependent) of the characteristic Material in the Material Master Data Table and we have no predefined aggregates at Material group level.

How the different tables of the Material Dimension operate together to access the InfoCube Fact Table shows the following picture:

2000 SAP AG AND SAP AMERICA, INC. 36

Page 41: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

112233

111111222222333333

Dim ID SID Material

Fact tableDimension table

Material not time dependentAttributes SID table(Name: /BIC/XMATERIAL)

Material not time dependentAttributes SID table(Name: /BIC/XMATERIAL)

Material MatGroup

AAACCCDDD

X Y Y

Material Master table(Name: /BIC/PMATERIAL)

Material Master table(Name: /BIC/PMATERIAL)

112233

10.00012.00025.000

Dim ID Sales

SID Material Material SID MatGroup

AAA CCC DDD

111111222222333333

345345678678678678

MatGroup SID MatGroup

X Y Z

345 678 999 MatGroup SID table

(Name: /BIC/SMATGROUP)

MatGroup SID table(Name: /BIC/SMATGROUP)Not used for Infocube access !

Example: Show me the sales values for material group X and Y

Not used in this Example :•Traditional Material SID Table: /BIC/SMATERIAL•Time dependent Material Master Table: /BIC/QMATERIAL•Material Time dependent Attributes SID Table: /BIC/YMATERIAL

Not used in this Example :•Traditional Material SID Table: /BIC/SMATERIAL•Time dependent Material Master Table: /BIC/QMATERIAL•Material Time dependent Attributes SID Table: /BIC/YMATERIAL

SID Tables for Infocube Access

Then the result set for the Material groups is determined in two steps:

Browsing the tables that form the Dimensions Material Dimension

Access the ‘traditional’ Material group SID Table and select the Material group SIDs (here ‘345’ and ‘678’) for Material group = 'X' and ‘Y’

Access the Material not time dependent Attribute SID Table with these Material group SIDs and determine the Material SID values (here ‘111’, ‘222’ and ‘333’).

Access the Material Dimension Table with these Material SID values and determine the Material Dimension table Dim-Id values (here ‘1’, ‘2’ and ‘3’)

Customer Dimension: same proceeding Time Dimension: same proceeding

As a result of these three browsing activities, there are a number of key values (Material Dimension Table Dim Ids, Customer Dimension Table Dim-Ids, Time Dimension Table Dim Ids), one from each Dimension Table affected.

Accessing the Fact Table

Using the key values (Dim-Ids) determined during Browsing, select all records in the Fact Table which have these values in the Fact Table record key.

2000 SAP AG AND SAP AMERICA, INC. 37

Page 42: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

We can summarize that accessing an InfoCube no ‘real value’ Master Data Tables are used. The following graphic illustrates that:

SID Tables andInfoCube Access

(1) Fact Table(1) Fact Table

(2) Dimension Tables(2) Dimension Tables

(3) time-independent-SID(3) time-independent-SID(4)(4) time-dependent-SIDtime-dependent-SID(5) ‘traditional‘ SID (5) ‘traditional‘ SID

11

22

22

22

22 3 3

55

4 4

3 3

5555

55

55

55

55

55

55

3 3 3 3

55

55

5555

4 4

3 3

55

55

55

55

External Hierarchy Table

Hierarchies in general are essential structures for navigation and of course having characteristics and attributes in the Dimension Tables and Master Data Tables that are related in a sequence of parent-child relationships means hierarchies but internal hierarchies.

External Hierarchies of a characteristic are defined seperatly from the other master data and are as mentioned above indepent from specfic InfoCubes. They are therefore called External Hierarchies. The different model properties of ‘internal’ and ‘external’ hierarchies in the BW Schema will be discussed in chapter 5.

During the creation of an InfoObject of type characteristic you define the basic functionality of External Hierachies for this InfoObject (Tabstrip: Hierarchies) and whether they exist at all.

4.2.4.4 External Hierarchy Types

The following external hierarchy types are possible :

1. Allow Versioning and / or time dependency of the whole external hierarchy structure (DateTo, Date From)

2000 SAP AG AND SAP AMERICA, INC. 38

Page 43: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

2. Or (exclusive) allow time dependency for each external hierarchy node (time dependent structure)

With both structure types you can allow intervals for the leave nodes which make the definition of an External Hierarchy easier.

Important

From the performance perspective it is important to know, that ith external hierarchies of type 1 there are precalculated aggregates at each level even for specific node values possible.

With external hierarchies of type 2 there are no precalculated aggregates.

4.2.4.5 Tables for External Hierarchies

The activation of the InfoObject Material results in the creation of the following tables:

Material Hierarchy Table : : /BIC/HMaterial

Material Hierarchy SID Table : : /BIC/KMaterial

Material SID-Structure Hierarchy Table : : /BIC/IMaterial

4.2.4.6 Loading External Hierarchy Data

External hierarchies can be transferred into the BW directly from an SAP product environment (e.g. standard cost center hierarchy from R/3), defined manually in BW or loaded via flat file. The latest is discussed in a separate paper.

4.2.4.7 External Hierarchies and InfoCube Access

BW allows you the definition of multiple External Hierarchies for a characteristic. External Hierarchies can be used for characteristics in the Dimension Tables and for activated Navigational Attributes for query navigation.

Example:

Consider a simple external hierarchy for characteristic Country. Country is a member of the Customer Dimension Table but it could be instead or additionally a Navigational Attribute in the Customer Master Data Table. The nodes are of textual nature. If ‘Continent’ would be an InfoObject of type characteristic we could use this InfoObject to define the nodes using its characteristic values like ‘Europe’:

2000 SAP AG AND SAP AMERICA, INC. 39

Page 44: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

World

Europe

Germany Austria Switzerland

America

USA Canada

Japan

-3

-2

3 4 5

-1

1 2

6*

Country Hierarchy

* Set Ids only shown for better understanding

How the access fundamentally works illustrates the following graphic:

SID Table: Nodes

Nodes

America

Europe

World

SID

-1

-2

-3

Child

-2-1 66 33 4 4 55 11 2 2

Parent

-3-3-3-2-2-2-1-1

Inclusion Table: Country

SID

6 3 4 5 1 2

SID Table: Country

Country

JapanGermanyAustriaSwitz.USACanada

Customer Dimension Table

DIM-ID

11223344556677

Cust-SID

1711171227113711471157116711

Country-SID

11112233445566

Text & Rep. Attributes

Text & Rep. Attributes

FactTable

A node of a hierarchy can be either textual or an InfoObject with a specified value e.g. InfoObject Material group with value ‘X’. All Display Attributes of the InfoObject Material Group are associated with this node.

The use of InfoCube-independent Hierarchy Tables is an additional prerequisite for an enterprise-wide data warehouse because the Hierarchy Table for a characteristic only exists once. Multiple InfoCubes souring the same characteristic in a Dimension Table access the same Hierarchy Table. This is another architectural aspect that accommodates data integration.

2000 SAP AG AND SAP AMERICA, INC. 40

Page 45: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

4.2.5 Dimension Tables of an InfoCube

4.2.5.1 Defining Dimension Tables

In the definition of an InfoCube you select all the InfoObjects of type characteristic which shall be direct members of this InfoCube. After this you define your Dimensions and assign the selected characteristics to a Dimension.

Important

BW does not force you to assign only related characteristics to the same Dimension Table. This offers you additional schema potential. Nevertheless as a rule of thumb you should put only characteristics into the same Dimension that have a parent – child relationsship.

The activation of the InfoCube results (with one exception which we discuss later) then in the generation of InfoCube Dimension Tables one for each Dimension.

4.2.5.2 Columns of a Dimension Table

The columns of a Dimension Table are not the characteristics themself but the SIDs of the characteristics you have chosen to be member of the InfoCube Dimension (Table). The unique key of a Dimension Table is the Dimension ID (DIM-ID) that is a surrogate key ( integer 4).

Customer Dimension Table

DIM-ID

11223344556677

Cust-SID

1711171227113711471157116711

Country-SID

11112233445566

We emphasize:

In the BW Schema a surrogate key is used as a unique key with each Dimension Table, not the real most granular characteristic within the dimension. I.e. for each unique combination of SID values of the different characteristics within a Dimension Table there is a unique surrogate key value assigned. So in the BW the Dimension Tables are joined to the Fact Table using surrogate keys.

Important

2000 SAP AG AND SAP AMERICA, INC. 41

Page 46: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

The use of a surrogate key as a unique key in a Dimension Table allows modeling patterns like N:M relationships within the same dimension or like leafless hierarchies and most important it allows you to follow up changes of constellations between values of different characteristics within the same dimension over time (time rows). This will be discussed in depth in chapter 5.

2000 SAP AG AND SAP AMERICA, INC. 42

Page 47: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

4.2.5.3 Limitations

An InfoCube allows

16 Dimensions 3 Dimensions exist with each InfoCube (whether they are used and thus visible or not)

Time Dimension Unit/ Currency Dimension Packet Dimension

Thus remaining 13 Dimensions for individual schema design

Within each Dimension Table may be up to 248 characteristics

Important

It should be mentioned that in the market sometimes each attribute / characteristic is called a dimension. This a potential point of misunderstandings as just saying with the BW Schema we have 16 dimensions and three of them are used internally this may sound very limited. Using this definition of a dimension there are 13 X 248 dimensions possible with BW plus the dimensions defined by the Navigational Attributes.

4.2.5.4 Dimensions and Navigation

All characteristics which assigned to Dimension Tables can be used for navigation (drilling) and filtering within queries. Navigation with Navigational Attributes of InfoCube characteristics has to be explictly switched on for each Navigational Attribute (Tabstrip: Navigation).

The activation of a Navigational Attribute for an InfoCube can be done afterwards. Deactivation of Navigational Attributes is not possible!

4.2.5.5 Loading data into Dimension Tables

Dimension Tables are maintained during InfoCube load.

4.2.5.6 Special BW Dimensions

With BW we have special predefined Dimensions:

Time Dimension Unit/ Currency Dimension Packet Dimension

4.2.5.6.1 Packet Dimension

2000 SAP AG AND SAP AMERICA, INC. 43

Page 48: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

With each load into an InfoCube there is a unique Packet-ID assigned. This allows you to purge erroneous loads without recreating the whole InfoCube again. The Packet Dimension can cause an overhead during querying it therefore can be eliminated after proofed correctness of the loads up to a certain packet-id using the compress feature of the InfoCube.

4.2.5.6.2 Unit/ Currency Dimension

The respective Dimension Table is generated if in the InfoCube key figures are selected which are of type Amount or Quantity.

Important

If you are not interested in Unit or Currency calculations you should define the key figures as Numbers and then introduce the Unit in the Key figure header (like: Sales in HL). This will reduce overhead.

4.2.5.7 Dimensions with only one Characteristic (Line Item Dimensions)

Very often we have the situation that our model let’s us assign only one characteristic to a Dimension.

This will probably occurr if for example you have the document line item in your model or with specific reporting requirements (Chapter 5: all scenarios exept no. 3).

In this situations a Dimension Table means only overhead. BW allows you define this kind of Dimensions as a Line Item Dimension. (Check box Dimension definition)

Doing so no Dimension Table for this Dimension will be generated. As Dimension Table will serve the SID Table of this characteristic. The key in the Fact Table will be the SID of the SID Table.

Line-Item Dimension:

2000 SAP AG AND SAP AMERICA, INC. 44

Page 49: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Line-ItemDimension

(1) Fact Table(1) Fact Table

(2) Dimension Tables(2) Dimension Tables

(3) time-independent-SID(3) time-independent-SID(4)(4) time-dependent-SIDtime-dependent-SID(5) ‘traditional‘ SID (5) ‘traditional‘ SID

11

22

22

22 3 3

55

4 4

3 3

5555

55

55

55

55

55

55

3 3 3 3

55

55

5555

3 3

55

55

2000 SAP AG AND SAP AMERICA, INC. 45

Page 50: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

4.3 Fact Table

The Fact Table is created during InfoCube activation. The structure of the Fact Table in the BW Schema is the same as it is in the normal Star Schema. The keys of the Dimension Tables (i.e. the Dim-Ids) or the SIDs of Line Item Dimensions are the foreign keys in the Fact Table. The non-key columns are defined by the selected key figures during InfoCube definition.

Each row in the Fact Table is uniquely identified by a value combination of the respective DIM Ids/ SIDs of the Dimension/ SID Tables

Since the BW uses system-assigned surrogate keys, namely DIM Ids or SIDs of 4 Bytes in length per dimension, to link the Dimension / SID Tables to the Fact Table, there will normally be a decrease in space requirements for keys in comparison to the use of real characteristic values for keys.

The dimension / master (SID) tables should be relatively small with respect to the number of rows in comparison to the Fact Table (factor 1:10 / 20).

Multiple Fact Tables

Each InfoCube has two Fact Tables.

The F-Fact Table which is optimized for loading data and the E-Fact Table which is optimized for retrieving data.

2000 SAP AG AND SAP AMERICA, INC. 46

Page 51: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

multipleFact Tables

(F) F-Fact Table Requid > 0(F) F-Fact Table Requid > 0

(E) E-Fact Table Requid = 0(E) E-Fact Table Requid = 0

(2) Dimension Tables(2) Dimension Tables

(3) time-independent-SID(3) time-independent-SID(4)(4) time-dependent-SIDtime-dependent-SID(5) ‘traditional‘ SID (5) ‘traditional‘ SID

22

22

5555

22 3 3

55

4 4

3 355

55

55

55

55

55

3 3 3 3

55

55

5555

3 3

55

55

E

F

Both Fact Tables have the same columns. The F-Table uses b-tree indixes the E-Table uses bitmap indixes except for Line-Item Dimensions where a b-tree index is used.

The InfoCube compression feature moves the fact records of all selected Requests from the F- to the E-Fact Table. Doing so the Request-ID of each fact record is set to zero.

The separation into two fact tables is fully transparent.

4.3.1 Fact Table Partitioning

BW supports the Partitioning of Fact Tables.

Partitioning is a database feature and means in short words to split one table internally into several tables the so called partitions. Partitions of a table have there own index areas and thus smaller areas as the entire table would have. Togather with the possibility to split internally a normally sequentiell request on the entire table into several parallel request fired on different Partitions this can speed up a query significantly.

Partitioning is fully transparent.

2000 SAP AG AND SAP AMERICA, INC. 47

Page 52: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

To partition a table you have to define a criteria which allows the database engine to decide where a specific record has to be loaded and to find him afterwards.

In BW the Fact Table can be either partitioned by the InfoObject 0CALMONTH i.e. Calender year and month or by 0FISCPER i.e. fiscalyear and period.

PartitioningFact Tables

(F) F-Fact Table Requid > 0(F) F-Fact Table Requid > 0

(E) E-Fact Table Requid = 0(E) E-Fact Table Requid = 0

(2) Dimension Tables(2) Dimension Tables

(3) time-independent-SID(3) time-independent-SID(4)(4) time-dependent-SIDtime-dependent-SID(5) ‘traditional‘ SID (5) ‘traditional‘ SID

5555

22 3 3

55

4 4

3 355

55

55

55

55

55

3 3 3 3

3 3

55

55

PacketDimension

TimeDimension

E

F

Togather with the entire value range for your partitioning InfoObject that you expect and the optional maximal number of partitions the value range for each partition is determined.

Note: Partitioning is a database functionality. Have a look to the OSS up to which degree and how your database provider supports partitioning!

For example:

Let us assume we want to partition a Fact Table using 0CALMONTH. We want to have data in our Fact Table starting from ‘199901’. Let us further assume that we expect a life time of our InfCube until ‘201012’. Without specifying a maximum value for the Partitions we would have

2000 SAP AG AND SAP AMERICA, INC. 48

Page 53: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

11 years x 12 month + 2 = 134 Partitions

The additional 2 Partitions are reserved for data which have a 0CALMONTH value less or larger our expected values.

To bring in 1 Quarter in each Partition we proceed as follows :

134 Part. / 4 = 33,5 => maximum = 34

Important

Partitioning for a Fact Table has to be defined before you activate the InfoCube. It cannot be done afterwards!

The above described Fact Table Partitioning affects only the E-Fact Table. The F-Fact Table is automatically partitioned by the Reqeust-ID. For this and other reasons do not forget to compress your InfoCube on a regular base!

2000 SAP AG AND SAP AMERICA, INC. 49

Page 54: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

4.4 BW Terminology

The following picture shows the differences in the terminology.

MDM / Star Schema BW Schema

Fact

Fact Table

Characteristic /Navigational Attribute/Display Attribute /(external) HierarchyNodeDimension Table /Master Table /Text Table /External HierarchyTable /(SID Table)

Dimension (Table)

(Dimension) Attribute

Fact Table

Key Figure

Important

It should be mentioned that in the market sometimes each attribute/ characteristic is called a dimension. This a potential point of misunderstandings as just saying with the BW Schema we have 16 dimensions and three of them are used internally this sounds very limited. Using this definition of a dimension there are 13 X 248 dimensions possible with BW plus the dimensions defined by the Navigational Attributes.

2000 SAP AG AND SAP AMERICA, INC. 50

Page 55: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5 Modeling issues andof the BW Schema

The proceeding will be that we look at the various important modeling issues from a topic-based point of view. Explaining how to implement these issues with BW will step by step improve our understanding of the BW schema.

Trying to map real world processes the following graphic illustrates the competition of different interests which always arise during design phase. This explains the reason why some of the following modeling recommendations even contradict each other.

A good design will always be a compromise.

Therefore we will also strike out the impacts of modeling especially to performance (please have also a look to the accelerator ‘Sizing and Performance’) and vice versa.

PerformancePerformance

AspectsAspects

GlobalGlobal

Data WarehouseData Warehouse

DesignDesign Aspects Aspects

AnalysisAnalysis

AspectsAspects

Competition in Data Warehousing

2000 SAP AG AND SAP AMERICA, INC. 51

Page 56: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.1 Granularity

The decision about Granularity that means the level of detail of your data is one of the important results of data modeling phase. Granularity deeply influences

Reporting capabilities

Performance

Space needed

Load Time....

You have to decide whether you really need the data in an InfoCube or whether it is meaningful to store detailed data in an ODS object or even whether you do not store detailed data in your data warehouse at all addressing via Drill Thru the detailed data in your Source system directly.

These decisions are decisions which do not influence only your current scope but the entire data warehouse approach and architecture.

This topic is discussed in a special paper.

5.1.1 Fact Tables and Granularity

Volume is a concern for Fact Tables. How can the number of rows of data in a Fact Table be estimated? Consider the following:

How long shall the data be stored in the Fact Table? How granular shall the data be?

The first point is quite understandable. However, the grain of the information has a large impact on querying efficiencies and overall storage requirements. The grain of the Fact Table is directly impacted by Dimension Table design because the most atomic characteristic in each dimension determines the grain of the Fact Table. For example, assume the need to analyze the performance of outlets and articles. Attributes exist which describe:

Outlet Receipts Articles Customers Time

Limit analysis to articles and time, and further assume 1,000 articles are grouped by 10 article groups. To track the article group performance on a weekly basis:

Granularity: article group, week, and 300 sales days a year (45 weeks)

10 X 45 = 450 records in the Fact Table per year due to only these two attributes if all articles are sold within a week

Granularity: article, week, 300 sales days a year (45 weeks)

2000 SAP AG AND SAP AMERICA, INC. 52

Page 57: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

1,000 X 45 = 45,000 records in the Fact Table per year due to only these two attributes if all articles are sold within a week

Granularity: article, day, 300 sales days a year

1,000 X 300 = 300,000 records in the Fact Table per year due to only these two attributes if all articles are sold within a day

Granularity: article, hour, 300 sales days a year, 12 sales hours a day

500 X 300 X 12 = 1,800,000 records in the Fact Table per year due to only these two attributes if on average 500 articles are sold within an hour

Finally, assuming 500 outlets, there will be 900,000,000 records a year in the Fact Table.

5.1.2 Impacts on Storage

Quite obviously granularity directly impacts the storage space needed. The Fact Table stores the transaction data so is the largest table in the InfoCube. Therefore, reviewing the size of the Fact Table provides a rough idea of space required for the InfoCube.

For each Dimension Table a four byte integer DIM ID (Dimension ID) is used, in conjunction with the other DIM IDs, to point to the associated row of data in the Fact Table. In addition, the length of all the key figures in the Fact Table must be considered:

((Number Of DIM IDs) * 4 + (Total Length of All Key Figures)) * Number of Records

Important

Remember the three required dimensions are time, unit, and packet.

5.1.3 Impacts on Performance

Large Fact Tables impact reporting and analysis. Apart from hardware considerations, there are a few additional considerations to keep in mind

Aggregation

For large Fact Tables consider the use of precalculated aggregates. See the implications, such as the increase in the storage space required, in an earlier section of this document.

Partitioning

Partition the Fact Table. The option exists to divide a table with respect to the values of a specific attribute, into several physical tables. This process is transparent to the user. This technique is useful with large Fact Tables because it provides access via smaller indexes.

2000 SAP AG AND SAP AMERICA, INC. 53

Page 58: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

2000 SAP AG AND SAP AMERICA, INC. 54

Page 59: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.2 Location of Dependent Attributes in the BW Schema

The BW Schema offers more than one possible location for dependent (parent) attributes. Where to put dependent attributes in the BW Schema is one of the decisive results of the projects blueprint phase.

Parent Attributes in BW

Material

Material Dimension

Materialgroup

MaterialDimension table

As a Characteristic As a Characteristic ?? MaterialMaster table

As a NavigationalAs a Navigational / /

DisplayDisplay Attribute Attribute ??

MaterialHierarchy table

As a HierarchyAs a Hierarchy ? ?

The freedom to choose between different locations of dependent attributes means no real freedom as the reporting behavior and possibilities differ and depend upon the location. Thus the reporting needs investigated during the blueprint phase of the project normally define exactly the location of a dependent attribute. This is discussed in detail in the following chapters.

5.2.1 Performance and Location of Dependent Attributes

The reporting needs should guide you in the decision where put a dependent attribute. There is little or nothing to be said from the performance point of view in favor of attributes in an InfoCube Dimension Table instead in Master or Hierarchy Tables.

5.2.2 Enterprise Data Warehouse and Location of Dependent Attributes

From an enterprise data warehouse point of view and apart from analysis demands and performance issues the following hint should be observed:

2000 SAP AG AND SAP AMERICA, INC. 55

Page 60: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Parent attributes should be placed in master tables (->Navigational/ Display Attributes) or designed as an external hierarchy to minimize redundancy and to guarantee integration in the data warehouse.

Data warehousing should mean controlled redundancy to achieve a high degree of integration. From this point of view all the dependent attributes should reside in master tables which means in the extreme case that there is only one characteristic in each Dimension Table (s. Line-Item Dimension).

5.2.3 Data Load and Location of Dependent Attributes

Apart from analysis demands the following hint should be observed:

Characteristics delivered by transaction data load are normally located in Dimension Tables (rule of thumb)

There are different load processes within BW covered by different types of InfoSources :

InfoSources for transaction data load that fill the InfoCubes

InfoSources for master data load that fill Master Data Tables, Text Tables and Hierarchy Tables

Thus the Dimension Tables are maintained during transaction data load which means to put a characteristic in a Dimension Table that is not delivered from transaction data load or that cannot be simply derived from transaction data (like calendar year from date) means additional lookup of Master Data Tables and thus a certain overhead during load time.

2000 SAP AG AND SAP AMERICA, INC. 56

Page 61: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.3 Tracking History in the BW Schema

We now discuss the most important term with data warehouses : time

5.3.1 History and InfoCube

Time and Fact Table

5.3.1.1 Changes over time are normally tracked in the Fact Table by loading transaction data.

It is the task of the Fact Table to track changes (e.g. Sales) between characteristics of different dimensions.

For example:

if the material ‘EEE‘ is purchased by customer ‘123‘ on day ‘19990630‘, this sale will occur as a new row in the Fact Table and thus the existence of the new relationship between material ‘AAA‘ and customer ‘123‘ and date ‘19990630‘ become visible.

Things that did happen

The Fact Table normally reports things that did happen. There is no easy way to report on things that did not happen.

Dimension Tables and real world changes

Changes in the relationship between the values of two characteristics within a Dimension Table will be tracked automatically, i.e. if during transaction data load a new value combination for characteristics within one Dimension Table is detected a new Dim-ID will be assigned for this new combination and a row is added to the Dimension Table reporting this new constellation. Additionally a row is added to the Fact Table having beside others this Dim-Id.

2000 SAP AG AND SAP AMERICA, INC. 57

Page 62: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Fact Table

Mat-GR-SID Mat-SID Mat-DIM-ID

910 001 111

910 002 222

920 002 666

920 003 333

920 004 444

920 005 555

Mat-GR-SID Mat-SID Mat-DIM-ID

910 001 111

910 002 222

920 002 666

920 003 333

920 004 444

920 005 555920 005 555

Mat Mat-SID

AAA 001

BBB 002

CCC 003

DDD 004

EEE 005

Material SID

Mat-GR Mat-GR-SID

X 910

Y 920

Materialgroup SID

Mat-DIM-ID Time-DIM-ID Revenue

111 09/1998 100

222 09/1998 100

333 09/1998 100

444 09/1998 100

111 10/1998 100

222 10/1998 100

333 10/1998 100

444 10/1998 100

555 10/1998 100

Mat-DIM-ID Time-DIM-ID Revenue

111 09/1998 100

222 09/1998 100

333 09/1998 100

444 09/1998 100

111 10/1998 100

222 10/1998 100

333 10/1998 100

444 10/1998 100

555 555 10/ 10/19981998 100 100

Material Dimension Table

Fact Table

EEE Y 10/1998 100Transaction record

Add new record to dim table

Add new record to fact table

Changes in the relationship between the values of parent - child attributes within a Dimension are discussed in detail in the next chapter.

2000 SAP AG AND SAP AMERICA, INC. 58

Page 63: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.3.2 Slowly Changing Dimensions

To Track changes between attributes of different dimensions (like a sales transaction) is the ‘normal‘ business of an InfoCube and is covered by the Fact Table.

But there are also changes between characteristic value and dependent attribute value assignments. For example :

Tthe Material ‘BBB’ belongs no longer to Material group ‘X’ but to Material group ‘Y’

Usually these changes occur rarely and in the theory they are addressed as ‘slowly changing dimensions’. How to handle these changes has a big impact on reporting possibilities and the data warehouse management.

We emphasize again:

The reporting possibilities differ whether you define a dependent attribute as a characteristic, a Navigational Attribute or a node of an external hierarchie. Because the loactions offer different time scenarios

To explain the different time scenarios we will use the example as follows :

Constellation 09/1998:

Material Material group

AAA X

BBB X

CCC Y

DDD Y

Constellation 10/1998:

Material Material group

AAA X

BBB Y (changed)

CCC Y

DDD Y

EEE Y (new)

Material Date Revenue

AAA 09/1998 100

BBB 09/1998 100

CCC 09/1998 100

DDD 09/1998 100

AAA 10/1998 100

BBB 10/1998 100

CCC 10/1998 100

DDD 10/1998 100

EEE 10/1998 100

Fact Table

The example shows the Material – Material group value constellations in 09/1998 and in 10/1998. The Fact Table shows the transactions which occurred during the same time span.

2000 SAP AG AND SAP AMERICA, INC. 59

Page 64: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

With this simple example we are able to produce 4 reports with different results which all can claim to report the truth. But the truth depends on how you treat changes in the relationships between Materials and Material groups :

Possible reporting demands:

Material group Rev 09/98 Rev 10/98

X 100 100

Y 300 400

Report using today‘s constellation

Material group Rev 09/98 Rev 10/98

X 200 200

Y 200 200

Report using 09/98 constellation

Material group Rev 09/98 Rev 10/98

X 200 100

Y 200 400

Report showing historical truth

Material group Rev 09/98 Rev 10/98

X 100 100

Y 200 200

Report showing comparable results

The reader is invited to implement this little example (just 9 rows in the Fact Table) on BW to verify the following scenarios :

Scenario I : Report the data to today‘s constellation

-Today is Yesterday-

Scenario II : Report the data to yesterday‘s constellation as well

-Yesterday is Today-

Scenario III : Report the data to the respective constellation

-Today or Yesterday-

Scenario IV: Report only on data for constellations valid today and yesterday

-Today and Yesterday-

2000 SAP AG AND SAP AMERICA, INC. 60

Page 65: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.3.2.1 Scenario I: Report the data to today‘s constellation - Today is Yesterday

5.3.2.1.1 Scenario I : Description

‘Today is Yesterday’ or Today‘s constellation is the truth :

Report all fact data according to today‘s value constellation of a characteristic and a dependent attribute .

Example for Scenario I:

In 10 1998 the assignment of Material ‘BBB’ to Material group ‘X’ was changed to ‘Y’. A new Material ‘EEE’ assigned to Material group ‘Y’ appeared.

You are not interested in the old assignments anymore. Thus you report on the fact data as if Material ‘BBB’ belongs to Material group ‘Y’ from the very beginning.

Constellation 09/98: Material Material group

AAA X

BBB X

CCC Y

DDD Y

Constellation 10/98:

Material Material group

AAA X

BBB Y (changed)

CCC Y

DDD Y

EEE Y (new)

Reporting demands:

Material group Rev 09/98 Rev 10/98

X 100 100

Y 300 400

Report using Today‘s constellation

Fact Table

Material Date Revenue

AAA 09/1998 100

BBB 09/1998 100

CCC 09/1998 100

DDD 09/1998 100

AAA 10/1998 100

BBB 10/1998 100

CCC 10/1998 100

DDD 10/1998 100

EEE 10/1998 100

Example from reality:

This time scenario typically occurs with sales forces.

When the assignment of sales persons to customers changes to a new sales person - customer constellation, all the sales data from earlier times shall be reported as if the were made by the new sales person. This requirement means a realignment of the fact data to the new constellation.

2000 SAP AG AND SAP AMERICA, INC. 61

Page 66: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.3.2.1.2 Scenario I: Solutions with BW

1st Solution :

‘Today is Yesterday’ or Today‘s constellation is the truth – 1st solution :

Define the dependent attribute of your multi-dimensional model as Navigational Attribute of the characteristic.

Example for Scenario I – 1st Solution:

Material group as Navigational Attribute in the Material Master table

Material group Rev 09/98 Rev 10/98

X 100 100

Y 300 400

Report using Today‘s constellation

Fact Table

MatGr MatGr-SID

X 910

Y 920

MatGr ‘Traditional‘ SID Table

MatGr-SID Material Material-SID

910 AAA 001

920 BBB 002

920 CCC 003

920 DDD 004

920 EEE 005

Material-SID Mat-DIM-ID

001 111

002 222

003 333

004 444

005 555Material Dimension Table

Mat-DIM-ID Date Revenue

111 09/1998 100

222 09/1998 100

333 09/1998 100

444 09/1998 100

111 10/1998 100

222 10/1998 100

333 10/1998 100

444 10/1998 100

555 10/1998 100

Material Attribute SID Table

The parent attribute (Material group) resides in the Master Date Table of the child characteristic (Material) (BW Admin WB : InfoObject maintenance-> Attributes)

2000 SAP AG AND SAP AMERICA, INC. 62

Page 67: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

The parent attribute has to be defined as a Navigational Attribute to allow drill and filter functions (BW Admin WB : InfoObject maintenance-> Attributes and InfoCube maintenance -> Navigation)

2000 SAP AG AND SAP AMERICA, INC. 63

Page 68: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

2nd Solution :

Today is Yesterday or Today‘s constellation is the truth – 2nd solution:

Define the dependent attribute of your multi-dimensional model as Node Attribute of an External Hierarchy of your characteristic.

As with BW Vers. 1.2b for all attributes of Material there would be no precalculated aggregates possible even if there is only a time dependency desired for the Material – Material group relationship (-> section about aggregates).

Example – 2nd Solution:

Material group as node-attribute of an External Material Hierarchy.

Materialgroup Rev 9/98 Rev 10/98

X 100 100

Y 300 400

Report using Today‘s constallation

Mat-DIM-ID Date Revenue

111 9/1998 100

222 9/1998 100

333 9/1998 100

444 9/1998 100

111 10/1998 100

222 10/1998 100

333 10/1998 100

444 10/1998 100

555 10/1998 100

Fact Table

Material Material-SID

AAA 001

BBB 002

CCC 003

DDD 004

EEE 005

Material SID

Material-SID Mat-DIM-ID

001 111

002 222

003 333

004 444

005 555

Material Dimension Table

Material Hierachy Table

-1(All)

-2(X)

-3(Y)

001(AAA)

002(BBB)

003(CCC)

004(DDD)

005(EEE)

++

Parent attribute resides in the Hierarchy Table as node attribute of an External Hierarchy of the child characteristic

No time dependent hierarchy name, structure or versions are necessary for the External Hierarchy to implement this scenario.

Today is Yesterday or Today‘s constellation is the truth – conclusion :

2000 SAP AG AND SAP AMERICA, INC. 64

Page 69: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

If you want to report your fact data always with respect to latest characteristic – attributes value constellations the dependent attributes have to be either Navigational Attributes or Nodes of an External Hierarchy of the characteristic.Loading new constellations (Master or Hierarchy data) the fact data stored on characteristic level are automatically realigned to the new Navigational Attribute or Node values.

Important

If all dependent attributes of a characteristic are Navigational or Display Attributes in the characteristic’s Master Data Table or Nodes of an External Hierarchy then remember the possibility to define this characteristic as Line Item Dimension!

5.3.2.2 Report the data to yesterday‘s constellation as well -Yesterday is Today

5.3.2.2.1 Scenario II : Description

‘Yesterday is Today’ or Yesterday‘s constellation is the truth :

Allow to report the fact not only to today’s but also according to yesterday‘s constellation of characteristics and attribute value assignments.

Example for Scenario II:

As descibed above in 10 1998 the assignment of Material ‘BBB’ to Material group ‘X’ was changed to ‘Y’. A new Material ‘EEE’ assigned to Material group ‘Y’ appeared.

You are interested in the new and the old assignments. Thus you are able report on the fact data as if Material ‘BBB’ belongs to Material group ‘Y’ or to Material group ‘X’.

2000 SAP AG AND SAP AMERICA, INC. 65

Page 70: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Constellation 09/98:Material Material group

AAA X

BBB X

CCC Y

DDD Y

Constellation 10/98:Material Material group

AAA X

BBB Y (changed)

CCC Y

DDD Y

EEE Y (new) ?

Reporting demands:

Material group Rev 09/98 Rev 10/98

X 200 200

Y 200 200

Report using yesterday‘s constallation

Fact Table

Material Date Revenue

AAA 09/1998 100

BBB 09/1998 100

CCC 09/1998 100

DDD 09/1998 100

AAA 10/1998 100

BBB 10/1998 100

CCC 10/1998 100

DDD 10/1998 100

EEE 10/1998 100

This scenario may be of interest if you want to report the effects of organizational changes

Example:

When the Materials are reorganized using new Material group assignments this scenario would allow one query to report your last year sales data with the today’s Material assignment and another query with the Material assignment which was valid last year.

Thus offering a fundament for comparisons.

The question may come up how to handle revenues in the Fact Table which cannot be assigned to a Material because it does not exist in the yesterdays master data.

2000 SAP AG AND SAP AMERICA, INC. 66

Page 71: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.3.2.2.2 Scenario II: Solutions with BW

1st Solution :

‘Today is Yesterday’ or Today‘s constellation is the truth – 1st solution :

Design the dependent attribute of your multi-dimensional model as Time Dependent Navigational Attribute of your characteristic.

Example for Scenario II – 1st Solution:

Material group as Time Dependent Navigational Attribute of Material

Fact Table

MatGr MatGr-SID

X 910

Y 920

MatGr ‘Traditional‘ SID Table

Material-SID Mat-DIM-ID

001 111

002 222

003 333

004 444

005 555Material Dimension Table

Mat-DIM-ID Date Revenue

111 09/1998 100

222 09/1998 100

333 09/1998 100

444 09/1998 100

111 10/1998 100

222 10/1998 100

333 10/1998 100

444 10/1998 100

555 10/1998 100

Material Time Dependent Attribute SID Table

MatGr-SID DateFr DateTo Material Material-SID

910 01/1000 12/9999 AAA 001

910 01/1000 09/1998 BBB 002

920 10/1998 12/9999 BBB 002

920 01/1000 12/9999 CCC 003

920 01/1000 12/9999 DDD 004

920 10/1998 12/9999 EEE 005

Material group Rev 09/98 Rev 10/98

X 200 200

Y 200 200

not assigned 100

Report using yesterday‘s constellation

Query Keydate = 09/1998Query Keydate = 09/1998

The Material group is a Time Dependent Navigational Attribute of Material. (BW Admin WB : InfoObject maintenance-> Attributes)

As emphasized above there would be no precalculated aggregates possible at Material group level.

How to address different constellations

The parent attribute (Material group) resides in the master table of the child characteristic (BW Admin WB : InfoObject maintenance-> Attributes)

2000 SAP AG AND SAP AMERICA, INC. 67

Page 72: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

The DateTo and DateFrom Attributes are not for navigation and do not appear directly in the Query Builder. Different master data records of the same characteristic value are addressed using the Key Date in the Properties Window of a query.E.g. a Key Date 30.09.1998 means : select master records with DateTo >= 30.09.1998 and DateFrom =< 30.09.1998

Hint: Define a BW variable to allow flexible reports and analysis (BEX Query Builder) with different Key dates

Important

The Key Date of a Query allows you to address different master data records having the same characteristic value.

This Key Date is valid for all master records of characteristics having time dependent attributes.

Using the time dependent feature you are not able to report more than one master record (constellation) for a characteristic value at a single query execution !!

2nd Solution :

Today is Yesterday or Today‘s constellation is the truth – 2nd solution:

Define the dependent attribute of your multi-dimensional model as Node Attribute of an External Hierarchy of your characteristic where the entire Hierarchy or even the structure is time dependent.

Example for Scenario II – 2nd Solution:

Material group as node-attribute of an external hierarchy with versions, entire Hierarchy time-dependent or even time-dependent Hierarchy structures in the Material Hierarchy table. Here we use a entire Hierarchy time-dependent external hierarchy:

2000 SAP AG AND SAP AMERICA, INC. 68

Page 73: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Mat-DIM-ID Date Revenue

111 9/98 100

222 9/98 100

333 9/98 100

444 9/98 100

111 10/98 100

222 10/98 100

333 10/98 100

444 10/98 100

555 10/98 100

Mat-DIM-ID Date Revenue

111 9/98 100

222 9/98 100

333 9/98 100

444 9/98 100

111 10/98 100

222 10/98 100

333 10/98 100

444 10/98 100

555 10/98 100

Fact table

Material-SID Mat-DIM-ID

001 111

002 222

003 333

004 444

005 555

Material-SID Mat-DIM-ID

001 111

002 222

003 333

004 444

005 555Material Dimension Table

Material Hierachy Table Material group Rev 9/98 Rev 10/98

X 200 200

Y 200 200

not assigned 100

Report using yesterday‘s constellation

++

-1(All)

-2(X)

-3(Y)

001(AAA)

002(BBB)

003(CCC)

004(DDD)

005(EEE)

-1 (All)

-2 (X)

-3 (Y)

001(AAA)

002(BBB)

003(CCC)

004(DDD)

Ext Hierarchy : MathierValid From : 01/1000Valid To : 09/1998

Ext Hierarchy : MathierValid From : 10/1998Valid To : 12/9999

Keydate = 09/1998Keydate = 09/1998

Allow versions and/ or entire Hierarchy time dependent or even time-dependent structures for external hierarchies of the child characteristic (Material) (BW Admin WB : InfoObject maintenance-> Hierarchies)

The parent attribute resides as a node attribute of an external hierarchy in the Hierarchy Table of the child characteristic (BW Admin WB : InfoObject maintenance-> Hierarchies)

Conclusion - Yesterday is Today-:

Yesterday is today allows you to cover 'today is yesterday' situations too but time dependency always means overhead.

No reporting about different characteristic – attribute value constellations within a single query execution (scenario III)

2000 SAP AG AND SAP AMERICA, INC. 69

Page 74: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Important

If all dependent attributes of a characteristic are Navigational (time dependent or not) or Display Attributes in the characteristic’s Master Data Table or Nodes (time dependent or not) of an External Hierarchy (time dependent or not) then remember the possibility to define this characteristic as Line Item Dimension!

2000 SAP AG AND SAP AMERICA, INC. 70

Page 75: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.3.2.3 Scenario III: Report the data to the respective constellation-Today or Yesterday-

5.3.2.3.1 Scenario III : Description

‘Yesterday or Today’ or Report the historical truth :

Report the data according to the constellation of characteristics and attribute values which was valid when the data occurred.

Example for Scenario III:

In 10 1998 the assignment of Material ‘BBB’ to Material group ‘X’ was changed to ‘Y’. A new Material ‘EEE’ assigned to Material group ‘Y’ appeared.

You are interested to report the fact data with respect to Material group with the Material assignment which was valid at the Date value.

Constellation 09/98:

Material Materialgroup

AAA X

BBB X

CCC Y

DDD Y

Constellation 10/98:

Material Material group

AAA X

BBB Y (changed)

CCC Y

DDD Y

EEE Y (new)

Reporting demands:

Material group Rev 09/98 Rev 10/98

X 200 100

Y 200 400

Report showing historical truth

Fact Table

Material Date Revenue

AAA 09/1998 100

BBB 09/1998 100

CCC 09/1998 100

DDD 09/1998 100

AAA 10/1998 100

BBB 10/1998 100

CCC 10/1998 100

DDD 10/1998 100

EEE 10/1998 100

This scenario is of interest if you want reports that track the organizational changes (time rows):

e.g. With Human Resources

2000 SAP AG AND SAP AMERICA, INC. 71

Page 76: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.3.2.3.2 Scenario III: Solution with BW

‘Yesterday or Today’ or Report the historical truth :

Put the dependent attribute of your characteristic as a characteristic in the same Dimension.

Example for Scenario III – Solution:

Material group as characteristic in the Material Dimension table

Fact TableMatGr MatGr-SID

X 910

Y 920

MatGr ‘Traditional‘ SID Table

MatGr-SID Material-SID Mat-DIM-ID

910 001 111

910 002 222

920 002 666

920 003 333

920 004 444

920 005 555

Material Dimension Table

Mat-DIM-ID Date Revenue

111 09/1998 100

222 09/1998 100

333 09/1998 100

444 09/1998 100

111 10/1998 100

666 10/1998 100

333 10/1998 100

444 10/1998 100

555 10/1998 100

Material group Rev 09/98 Rev 10/98

X 200 100

Y 200 400

Report showing historical truth

The parent attribute (Material group) resides as a characteristic in the Dimension Table of the child characteristic (Material) (BW Admin WB : InfoCube maintenance -> Characteristics).

If the parent characteristic is not delivered via transaction data load an update rule has to be created to determine via automatic lookup to the Characteristic’s Master the parent characteristic value.

Conclusion - Today or Yesterday -:

2000 SAP AG AND SAP AMERICA, INC. 72

Page 77: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

This scenario illustrates a strength of the BW Schema. The usage of surrogate keys (DIM IDs) for the Dimension Tables makes this time scenario possible.

It allows you to track all the constellation changes and to assign the validity of such constellation implicitly via the Time in the Fact Table.

2000 SAP AG AND SAP AMERICA, INC. 73

Page 78: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.3.2.4 Scenario IV: Report only on data for constellations valid today and yesterday -Today and Yesterday-

5.3.2.4.1 Scenario IV : Description

‘Yesterday and Today’ or Report the comparable truth :

Report only on the data for constellations of characteristic and attribute values that existed yesterday and still exist today

Example for Scenario IV:

In 10 1998 the assignment of Material ‘BBB’ to Material group ‘X’ was changed to ‘Y’. A new Material ‘EEE’ assigned to Material group ‘Y’ appeared.

You are interested to report the fact data with respect to Material group only for Material – Material group assignments which exist continously during a certain time span. You don’t want to compare oranges with pears.

In our example only the white coloured constallations exist without change in our reporting time span 09 1998 until 10 1998.

Constellation 09/98:Material Material group

AAA X

BBB X

CCC Y

DDD Y

Constellation 10/98:Material Material group

AAA X

BBB Y (changed)

CCC Y

DDD Y

EEE Y (new)

Reporting demands:Fact Table

Material group Rev 9/98 Rev 10/98

X 100 100

Y 200 200

Report showing comparable results

Material Date Revenue

AAA 09/1998 100

BBB 09/1998 100

CCC 09/1998 100

DDD 09/1998 100

AAA 10/1998 100

BBB 10/1998 100

CCC 10/1998 100

DDD 10/1998 100

EEE 10/1998 100

This scenario may be of interest if you want comparable results.

2000 SAP AG AND SAP AMERICA, INC. 74

Page 79: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.3.2.4.2 Scenario IV: Solution with BW

‘Yesterday and Today’ or Report the comparable truth :

Given a attribute – characteristic relation.

Define the dependent attribute as a Time Dependent Navigational Attribute of the characteristic. Define additionally user-defined Date To and Date From Time Dependent Navigational Attributes. Togather with the Query Key date and a Filter on Date To and Date From excluding your reporting time span you get the desired result.

Example for Scenario IV – Solution:

Material group as Time Dependent Navigational Attribute in the Material Master table and additional validity attributes also defined as Time Dependent Navigational Attributes.

Fact Table

MatGr MatGr-SID

X 910

Y 920

MatGr ‘Traditional‘ SID Table

Material-SID Mat-DIM-ID

001 111

002 222

003 333

004 444

005 555

Material Dimension Table

Mat-DIM-ID Date Revenue

111 09/1998 100

222 09/1998 100

333 09/1998 100

444 09/1998 100

111 10/1998 100

222 10/1998 100

333 10/1998 100

444 10/1998 100

555 10/1998 100

Material Time Dependent Attribute SID Table

Query Keydate { 09/ v 10/1998}Query Keydate { 09/ v 10/1998}

MatGr-SID From-User To-User From-Sys To-Sys Material Material-SID

910 01/1000 12/9999 01/1000 12/9999 AAA 001

910 01/1000 09/1998 01/1000 09/1998 BBB 002

920 10/1998 12/9999 10/1998 12/9999 BBB 002

920 01/1000 12/9999 01/1000 12/9999 CCC 003

920 01/1000 12/9999 01/1000 12/9999 DDD 004

920 10/1998 12/9999 10/1998 12/9999 EEE 005

Material group Rev 09/98 Rev 10/98

X 100 100

Y 200 200

Report showing comparable resultsFiter:From-User = 011900 - 091998To-User = 101998 – 129999

Fiter:From-User = 011900 - 091998To-User = 101998 – 129999

As in the Yesterday is Today scenario we store all the different Parent-Child constellations which occurred over time.

2000 SAP AG AND SAP AMERICA, INC. 75

Page 80: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

The parent attribute (Material group) resides in the master table of the child characteristic (BW Admin WB : InfoObject maintenance-> Attributes)

The key date mechanism for addressing specific master data records does not allow time ranges

Furthermore the DateTo and DateFrom (To-Sys / From-Sys) attributes which are generated automatically to handle Time Dependent Attributes cannot be used for user defined navigation or filters.

We have to define our own DateTo and DateFrom attributes (To-User and From-User) in the master table.

During master data load the user Date To value of the old master record has to be updated.

Hint: Define time variables with intervals for Date From and Date To to allow flexible reports and analysis (BEx Query Builder)

e.g. To make a query with comparable data for the period 9/1998 to 10/1998 you have to define the Intervals as follows:

(userdefined) DateFrom : 011900 - 091998

(userdefined) DateTo : 101998 – 129999

The Query Key date must be in 9 or 10/1998

2000 SAP AG AND SAP AMERICA, INC. 76

Page 81: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.3.3 Usage of Time Scenarios

As shown in the previous chapter BW supports a wide range of time scenarios. Summarizing what we learned in the previous sections we emphasize:

It is possible to design all time scenarios within one BW Scema.

Using different time scenarios in a Schema increases the potential value of our solution

Thus during analysis it is quite understandable that the end-user may wish to have all time scenarios in the BW Schema – just in case.

If this wish comes up and there is no fundamental information need one have to warn the end-user because he will have to pay for it :

He will lose the simplicity of the Multi-Dimensional Model and beside this produce overhead during load and querying thus:

With each additional time scenario in a BW Schema the complexity increases and thus the potential of erroneous and misleading queries.

A direct consequence is:

Additional training has to be done for ad hoc users and for query authors to explain the differences of the time scenarios and how and in which case to use them.

Beside this experience shows that :

The value of historical structure diminishes with time especially with the scenario II

The scenarios I & III are the by far most frequent scenarios.

If on the other hand side the end-user has a real need to report using different time scenarios the following rules has to be observed:

Designing the same parent attribute as a characteristic in a Dimension Table (Scenario III : Historical Truth) and as an Navigational Attribute in a Master Data Table (all other Scenarios) in a BW Schema the Navigational Attribute should have a name different from the name in the InfoObject definition to avoid misunderstandings.

Otherwise you would have the same name twice in the query builder (BW Admin WB : InfoObject maintenance-> Attributes).

Furthermore we realize performance impacts with certain time scenarios:

2000 SAP AG AND SAP AMERICA, INC. 77

Page 82: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

There are no precalculated aggregates possible on Time Dependent Attribute level thus introducing time dependency for an attribute without any need might make performance improvements impossible. The same is true with external hierarchies that are structure-time-dependent.

2000 SAP AG AND SAP AMERICA, INC. 78

Page 83: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.4 M:N Relationships

M:N relationships detected during logical modeling need special observation.

5.5

5.5.1 M:N Relationships and the Fact Table

Normally N:M relationships between two attributes discovered during analysis mean that they reside as characteristics in different Dimension Tables like customer and material. And the Fact Table resolves this M:N relationship. This kind of relationship is described by facts / key figures like revenue.

5.5.2 M:N Relationships within a Dimension

N:M relationships may also occur within the same dimension like Material and Color or Customer and Communication-Possibilities.

e.g. Material and Color

Material Color

Color is an attribute of the characteristic Material. A Material can have multiple colors and vice versa. From normal understanding color should be in the Master Data Table of material like material type. But this is not possible because the material is the unique key of the master table. Thus we cannot have one material with multiple colors in the master table (This a typical challenge with Star SchemasStar-VIII).

5.5.2.1 Designing M:N Relationships using the Dimension Table

The BW Schema allows such N:M relationships locating the parent attribute Color as a characteristic in the Material Dimension Table. This is possible due to the usage of surrogate keys (Dim Ids) in the Dimension Tables allowing the same Material several times in the Dimension Table.

AAABB

Dim ID Umsatz Dim ID Material* color*

12345

10.00012.00025.00050.00040.000

Fact table Dimension table

Dim ID SALES

greenredyellowbluegreen

* remember that there are only SIDs in the dim table!

12345

2000 SAP AG AND SAP AMERICA, INC. 79

Page 84: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.5.2.2 Designing M:N Relationships using a Compound Attribute

It is possible to achieve the uniqness of a characteristic defining one or even multiple attributes as a Compound Attributes (InfoObject mainetance – Tabstrip Compound).

Compound Attributes

If you can avoid Compounding - do it !

Compound Attributes means always an overhead with respect to

Reporting as you will alwas have to qualify the Compound Attributes within a query

And from performance point of view.

Bear in mind:

Compounding means always a heritage of Source Systems. What make sense with Source Systems does not necessarilly mean that it make sense in data warehousing.

Remember that data warehousing does not mean copy management!

5.6 Frequently Changing Attributes (Status Attributes)

If you find frequently changing characteristic – attribute relations in your data model then normally the Master Data Table is not the right place to handle these relation as Defining the attribute as time dependent would result in an explosion of the master data which is

not efficient. More important: you want normally to report on the influence of these changes but a Time

Dependent Attribute allows you only to report on one constellation at a time (query execution) Furthermore very often such an attribute is not only dependent on time and one characteristic but

on a combination of characteristics.

Example: Promotion Status

The Promotion Status is an attribute of Article. The promotion values could be TV, newspaper, or handouts. As it is the nature of status attributes the status of an Article changes frequently. The Promotion Status is normally not only an attribute of Article but on the combination of Article and Outlet : e.g. an article may be on promotion in one outlet whereas it is not on promotion for others.

This leads to :

Frequently Changing Attributes (Status Attributes)

Frequently Changing Attributes like Promotion Status should be designed as a characteristic of an own Dimension Table.

With respect of our example ‘an own Dimension Table’ means not to put the status into the same Dimension Table as Article as this might result in a explosion of the Dimension Table.

An own Dimension Table will have a positive influence to query performance as the status is often used as a filter. E.g. Show me the revenue of articles which are on promotion in region X would leave the normally large article Dimension Table untouched.

2000 SAP AG AND SAP AMERICA, INC. 80

Page 85: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.7 Inflation of Dimensions

It might happen that your multi-dimensional model shows you a lot of ‘small’ dimensions. ‘Small’ in this concern means Dimensions that will have only one or two characteristics whereby these characteristics have only a few number of values.

You have to regard the following: The limitations with respect to the number of dimensions within a BW Schema. The possible produced overhead during query execution due to the fact that you have to join a lot

of Dimension Tables to a large Fact Table

A possible solution to overcome these impacts :

Combining ‘Small’ Dimensions to overcome Dimension Inflation

The BW Schema does not force you to bring only related characteristics into one Dimension Table. This allows you create one Dimension (Table) collecting more or less unrelated characteristics from ‘small’ dimensions.

You must observe that the number of expected combinations of characteristics values should of course not be the cartesian product!

Another aspect is the usibility i.e. for query authors you have to create a meaningful dimension name (like: Scenario Dimension) which allows him easy navigation on the model in the query builder.

2000 SAP AG AND SAP AMERICA, INC. 81

Page 86: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.8 Multiple Process Reporting Scenarios

A normal data warehouse issue is the reporting on information offered by different operational processes like

order process, delivery process and billing process or sales process (actual) and planning or budgeting process

Let’s have a look to the following example:

Order

ONUM: Order Number (C)

CUS: Customer (C)

PROD: Product (C)

ODAT: Order Date (C)

SALP: Sales Person (C)

OQTY: Order Quantity (K)

OPRI: Order Price (K)

Delivery

ONUM: Order Number (C)

CUS: Customer (C)

PROD: Product (C)

DDAT: Delivery Date (C)

DELP: Delivery Person (C)

DQTY: Delivered Quantity (K)

DPRI: Delivery Price (K)

Billing

ONUM: Order Number (C)

CUS: Customer (C)

PROD: Product (C)

BDAT: Billing Date (C)

BILP: Billing Person (C)

BQTY: Billing Quantity (K)

BPRI: Billing Price (K)

The three sceanrios have the marked characteristics in common.

The question to be answered is whether there are general rules how to implement in BW reporting scenarios that consist of sub-scenarios.

2000 SAP AG AND SAP AMERICA, INC. 82

Page 87: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.8.1 MultiCubes

Looking at the example introduced above one might come to the following conclusion:

As you frequently want to report data from these processes togather the first approach might be to create one common multi-dimensional model and following one Infocube.

Creating a solution using one InfoCube without any further schema improvements we would achieve :

O N U M C U S P R O D O D A T S A L P D D A T D E L P B D A T B IL P O Q T Y O P R I D Q T Y D P R I B Q T Y B P R I

1 C 1 P 1 1 9 9 8 S 1 * * * * 5 1 0 0 0 0 0 02 C 2 P 1 1 9 9 8 S 2 * * * * 1 0 2 0 0 0 0 0 03 C 1 P 2 1 9 9 7 S 3 * * * * 4 1 3 0 0 0 0 04 C 2 P 2 1 9 9 7 S 2 * * * * 8 1 5 0 0 0 0 04 C 2 P 2 1 9 9 8 S 2 * * * * -2 -4 0 0 0 0 01 C 1 P 1 * * 1 9 9 8 D 2 * * 0 0 5 1 0 0 0 02 C 2 P 1 * * 1 9 9 9 D 1 * * 0 0 7 1 2 0 0 02 C 2 P 1 * * 1 9 9 9 D 2 * * 0 0 3 8 0 0 03 C 1 P 2 * * 1 9 9 8 D 1 * * 0 0 2 6 0 0 04 C 2 P 2 * * 1 9 9 8 D 2 * * 0 0 6 1 1 0 0 01 C 1 P 1 * * * * 1 9 9 9 B 1 0 0 0 0 5 1 0 02 C 2 P 1 * * * * 1 9 9 9 B 1 0 0 0 0 1 0 2 0 03 C 1 P 2 * * * * 1 9 9 8 B 2 0 0 0 0 4 1 3 0

O rd er - D e livery - B illin g C u b e

C o m m o nC h ars

S a lesC h ars

D e liveryC h ars

B illin gC h ars

S a lesK eyfs

D e liveryK eyfs

B illin gK eyfs

The cube looks like a swiss cheese.

Of course it is possible to design a more appropiate schema for the single cube approach. This is discussed in the next chapter.

Using the BW MultiCube functionality we can use a space-saving, more performant and more transparent approach.

A MultiCube is a virtual cube which does not exist physically. (for more details consult the BW AWB Documentation):

We define three so called Basic InfoCubes. This three Basic Infocubes serve as input for the MultiCube definition. You have to observe the following Only characteristics and navigational attributes can be declared as to be the same which

reference the same InfoObject.

2000 SAP AG AND SAP AMERICA, INC. 83

Page 88: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

If the same InfoObject of type Key Figure occurrs multiple times you have to decide whether to add the values from the different cubes or you have to choose one Key Figure from one cube. In some scenarios adding makes sense (for example: MultiCube on country-specific Basic Cubes with revenue data) with other scenarios (example: actual and plan) adding is nonsense.

The best way to handle Key Figures is to use an Key figure InfoObject not in different semantic constellations like Key Figure QTY for ordered quantity in the Order cube and for invoiced quantity in the Invoiced .

As the allows you to access multiple InfoCubes within one query.

With this background we can create three Infocubes:

O N U M C U S P R O D O D A T S A L P O Q T Y O P R I1 C 1 P 1 1 9 9 8 S 1 5 1 0 02 C 2 P 1 1 9 9 8 S 2 1 0 2 0 03 C 1 P 2 1 9 9 7 S 3 4 1 3 04 C 2 P 2 1 9 9 7 S 2 8 1 5 04 C 2 P 2 1 9 9 8 S 2 - 2 - 4 0

O N U M C U S P R O D D D A T D E L P D Q T Y D P R I1 C 1 P 1 1 9 9 8 D 2 5 1 0 02 C 2 P 1 1 9 9 9 D 1 7 1 2 02 C 2 P 1 1 9 9 9 D 2 3 8 03 C 1 P 2 1 9 9 8 D 1 2 6 04 C 2 P 2 1 9 9 8 D 2 6 1 1 0

O N U M C U S P R O D B D A T B I L P B Q T Y B P R I1 C 1 P 1 1 9 9 9 B 1 5 1 0 02 C 2 P 1 1 9 9 9 B 1 1 0 2 0 03 C 1 P 2 1 9 9 8 B 2 4 1 3 0

O r d e r - C u b e

D e l i v e r y - C u b e

B i l l i n g - C u b e

and based on these Basic InfoCubes a MultiCube a query showing Sales and Delivered Quantity would look like this:

Drilling to Salesperson the result we will get:

2000 SAP AG AND SAP AMERICA, INC. 84

Page 89: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

This results a evaluated sending two queries in parallel to the Order and Delivery Cube. A subsequent union creates the result table.

SalesCube

BillingCube

SalesDeliveryBilling

Multi-Cube

Multi-Cube Queries

Basic-Cube Queries Basic-Cube Queries

Delivery Cube

Basic-Cube Queries

2000 SAP AG AND SAP AMERICA, INC. 85

Page 90: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.8.2 Partitioning Attributes

In the modeling phase the situation often appears that there are dozens of key figures (facts) like

Actual Sales / Planned Sales / Forecast Sales / Budget Sales... / Planned Units / Forecast Units ...

Furthermore Actual and Plan key figures are normally defined on different granular levels like Actual data on Product and Daily level Plan data on Product group and Monthly level

Question:

Shall I introduce all these key figures into the Fact Table of a single InfoCube ?

Answer:

Bearing in mind what we discussed with respect to MultiCube scenarios it does not make sense to create n-cubes one for each scenario.

It make sense to think of two basic reporting scenarios and to create two cubes one for actual sales and one for plannings, forecasts and budget

This takes into consideration the different granularity levels in the scenarios

Question:

What will happen if the users want to introduce a 3-month forecast, a 6-month forecast ...?

Answer: Think of plan, budget and forecast as values of a characteristic for example named ‘ValueType’

located in a separate dimension (table) for example named ‘Scenario’. ValueType replicates the remaining structure of the schema. We will then have only one key figure e.g. Sales Amount which only in conjunction with the characteristic ValueType gives a meaning. These attributes are often called Partitioning Attributes and their dimension a Partitioning Dimension.

The structure is flexible to expand, if for instance another scenario like 3-month forecast is needed this will be just a new ValType value.

Example:CUS PROD DAT ValType QTY

C1 P1 199801 P 10C2 P1 199801 P 10C1 P2 199801 P 4C2 P2 199801 P 8C1 P1 199801 F6 80C2 P1 199801 F6 70C1 P2 199801 F6 30C2 P2 199801 F6 60

2000 SAP AG AND SAP AMERICA, INC. 86

Page 91: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

It is important to remember that reporting the Sales Amount is not meaningful without specifying the ValType (as filter, in a restricted key figure...) . You would summarize for example plan data and forecast data.

2000 SAP AG AND SAP AMERICA, INC. 87

Page 92: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Enforcing the existance of a Partition Attribute

Characteristics that partition the schema like ValType have to be in every query and every precalculated aggregate !

This can be enforced defining ValType as ‘Unique for each Cell’ in the InfoObject maintenance (Tabstrip Explorer).

Further advantages of Partitioning Attributes: There can be external Hierarchies defined over the partitioning characteristic The BW Staging supports this feature as the update rules are defined for every key figure from

the communication structure of the InfoSource. Thus enabling to split one large transactional record with many key figures into many records in the Fact Table with one key figure.

Thus using both features the MultiCube and a Partitioning Attribute offer a good implementation:

Plan,Forecast..

DataCube

Actual DataCube

Plan / ActualMulti-Cube

Multi-Cube Queries

Basic-Cube Queries Basic-Cube Queries

2000 SAP AG AND SAP AMERICA, INC. 88

Page 93: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.9 Attribute or Fact (Key figure)

Usually it is quite obvious how to distinguish attributes and facts. But there will be some attributes that will be confusing. Prices are a good example. From one perspective, price describes the article as for example the manufacturer attribute does, and therefore it seems that it should be in the Master Data Table

Infoobjects of Type Key Figure as Attribute in a Master Data Table

Introducing a Formular Variable which addresses an Attribute of Type Key Figure like Price in a Master Data Table allows calculations within queries using this Formular Variable (s. Documentation)

Sometimes Key Figure Attributes must be integrated to the Fact Table

From another perspective the price is continuous over time that means it doesn’t make sense to calculate discounts on basis of sales amount and quantity in a fact record using the actual price from the Master Data Table like described above with fact records which are for example one year old.

In this case the discount has to be calculated during load time in an update rule addressing via lookup to the Master Data Table the actual price.

From reporting point of view it can also be of interest to store an Attribute Key Figures additionally as a characteristic or an attribute of type characteristic.

This would allow navigation on prices using for example External Hierarchies. Same Characteristic several times in the Model

It may occurr that you find the same characteristic several times in your BW Schema just playing a different role.

Example:

Sales Employee, Delivery Employee, Billing Employee

Create one InfoObject Employee. The other characteristics as InfoObject that refer to Employee.

It makes often sense to introduce Employee additionally to the schema to allow simple questions like show me all transactions where a specific Employee was involved it doesn’t matter in which role.

5.10 Artificial Key Figures

5.10.1 Factless Fact tables

There might be a Fact Table without a “true” fact e.g. with attendance questions (attendance intersection entity). The same applies to human resource statistics.

Those situations could be solved introducing an artificial key figure which is always ‘1’ :

2000 SAP AG AND SAP AMERICA, INC. 89

Page 94: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Month Course Student Attendance199905 TABW10 Haupt 1199905 TABW10 Brugna 1

5.10.2 Counting

Often it makes sense to introduce additionally an artificial key figure to allow easy counting. This key figure is filled by ‘1’during load for each record.

5.11 Big Dimensions

The question may arise during modeling :

How do we deal with dimension and master tables with 100 thousends or even millions of records?

Use Line Item Dimensions !

We have this situation often with large customer dimensions. Very quick the solution may be :

use aggregates for demographic characteristics in the customer dimension,

this improves query performance significantly

but causes possibly large space requirements

and aggregates have to be maintained after data load and this may take some time

so in such a extreme situation it makes sense to think about alternatives :

create a smaller demographic dimension using demographic attributes of the customer

this improves query performance significantly

data are available immediately after transaction data load

but has a certain overhead during load time

Both approaches can be combined.

As the BW Schema does not force you to put a parent attribute into the same Dimension Table as it’s child attribute it is often worth thinking about locating parent attributes in an own Dimension Table (e.g. with 100 000 article and 2000 article groups why not putting the article group in an own Dimension Table if queries often reports at article group level ?)

?)

2000 SAP AG AND SAP AMERICA, INC. 90

Page 95: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

5.12 Hierarchies in the BW Schema

Hierarchies in general are essential structures for navigation and of course having characteristics and attributes in the Dimension Tables and Master Data Tables that are related in a sequence of parent-child relationships means hierarchies. But as the real world is sometimes unbalanced or ragged so it is with hierarchies. In BW, the are essentially three possibilities to model hierarchies:

as a hierarchy of characteristics within a Dimension Table

as a hierarchy of attributes attached to a characteristic

as an external hierarchy1

Let us shortly look at the pros and cons of those different modeling techniques.

5.12.1 Hierarchies within a Dimension

A typical example for a hierarchy fitting into this context is a time hierarchy with levels such as millenium – century – decade – year – month – day – hour etc. Another typical example is a geographic hierarchy with levels such as continent – country – state – region – city etc.

Hierarchies that can be modeled within a Dimension Table have certain properties:

The number of levels should be fixed i.e. each path from the root to a leaf should have the same length; each level is represented by an InfoObject.

Example: A geographic dimension with InfoObjects 0COUNTRY (country), 0REGION (region) and 0CITY (city).

But as the BW does not know anything about parent-child relationships within Dimension Tables it can make sense to design even unbalanced hierarchies in a Dimension Table if the end-user know about these strange behavior and can choose so a meaningful child attribute. Note there are no predefined drill down paths within a Dimension Table. (As Kimball says : the true meaning of drilling is just adding or removing row headers)

Due to the fact that surrogate keys are used in the Dimension Tables it is possible to design even ‘leafless’ hierarchies. This situation often arises when different OLTP source systems offer data at different attribute (Hierarchy) levels:

ABC'_''_'

Dim ID Umsatz Dim ID Material* Materialgroup*

12345

10.00012.00025.00050.00040.000

Fact table Dimension table

Dim ID SALES

beveragesweetsbeveragebeveragesweets

* remember that there are only SIDs in the dim table !

12345

The performance aspects of this technique are:

1 Actually, this is the notion of a hierarchy that is used in documents related to BW.

2000 SAP AG AND SAP AMERICA, INC. 91

Page 96: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

Queries to InfoCubes that use such kind of hierarchies are generally faster than the same queries to InfoCubes that model the same scenario with one of the two other hierarchy modeling techniques.

The BW does not explicitly know about the hierarchical dependencies. Therefore precalculated aggregates that summarize data over regions are not used for queries that summarize over countries if the country is not included in that precalculated aggregate as well ! Therefore you should always include the hierarchical levels to such an aggregate that are above the level over which data is summarized.

Example 1: If an aggregate summarizes data over 0REGION then do include 0COUNTRY in that aggregate too.

Example 2: If an aggregate summarizes data over months then do include years, decades, ... too!

The reporting aspects of this technique are:

The BW does not explicitly know about the hierarchical dependencies. Therefore there is no predefined drill down path with this hierarchy design.

5.12.2 Hierarchies within a Master Data table of a Characteristic

This case is very similar to the one discussed in section 5.12.1. The difference is the increased flexibility (i.e. realignment facilities) that comes with Navigational Attributes. The hierarchy should still have a fixed number of levels. However, changes to that hierarchy (i.e. changes to attribute values) can be easily applied to facts that are already loaded into a cube.

A typical example is the hierarchy of sales office – sales group – sales person. This hierarchy has a fixed number of levels but is frequently reorganized.

From a performance perspective this is the least attractive hierarchy modeling technique.

5.12.3 External Hierarchies

This is the ideal type if a hierarchy

frequently changes,

has no fixed number of levels (sometimes referred to as a "ragged" or “unbalanced” hierarchy).

unbalanced hierarchy

2000 SAP AG AND SAP AMERICA, INC. 92

Page 97: BW Multi Dimensional Data Modelling

MULTI-DIMENSIONAL DATA MODELING WITH BWI

TH BWASAP FOR BW ACCELERATOR

A typical example is a cost center hierarchy in which several (sub-)cost centers belong to one cost center which itself belong to another cost center and so on. Such a hierarchy has no fixed number of levels as cost centers usually correspond to departments or groups within a company which might be reorganized into new subgroups. Thus new levels might be introduced, old ones disappear, the hierarchy might be deeper at one end (due to a deeper hierarchical organization) and shallow on the other end.

Another major advantage of external hierarchies vs. its alternatives is that an InfoObject can have several such hierarchies and all these can be used within the same cube. The same effect could only be achieved through nasty work-arounds when using the alternative approaches.

The performance issues connected to this type of hierarchy are the following:

These hierarchies usually perform worse that those modeled within dimensions.

They usually perform at least as well as the hierarchies based on Navigational Attributes.

Problems can arise for big external hierarchies with many thousands of nodes and leaves. In that case it might be better to consider one of the two alternatives.

We have the following types of external Hierarchies :

Versions and / or time dependency of the whole external hierarchy structure (DateTo, DateFrom) - there are precalculated aggregates at each level even for specific node values possible

Or (exclusive) time dependency for each external hierarchy node (time dependent structure) - there are no precalculated aggregates possible

2000 SAP AG AND SAP AMERICA, INC. 93