Sunteți pe pagina 1din 8

SAP BW Class

Star Schema: Classic and Extended


Star Schema: Classic and Extended Guidance Consulting

Copyright© 2007 by Guidance Consulting, Houston, TX

The information in this publication is the copyrighted work of Guidance Consulting and its
owner Touseefuddin Syed and is owned by Guidance Consulting.

While there is no official print of this document, this book and the information herein are
the sole property of Guidance Consulting. This is covered under the US laws of copyright.
Hence, no part of this book in part or in its entirety form can be distributed or circulated in
any form of media without the prior written consent/permission of approval from owners of
Guidance Consulting.

Any person quoting out of this booklet should properly document their work with a reference
to this document with the consent of the owner/publisher of this document. Any person,
group or organization that will breach copyright law knowingly or unknowingly will be
prosecuted to the full extent of the law of this country.

NO WARRANTY: This documentation is delivered as is, and Guidance Consulting makes no


warranty as to its accuracy or use. Any use of this documentation is at the risk of the user.
Although we make every good faith effort to ensure accuracy, this document may include
technical or other inaccuracies or typographical errors. Guidance consulting, reserves the
right to make changes without prior notice.

NO AFFILIATION: Guidance Consulting, and this publication are not affiliated with or
endorsed by SAP® AG, SAP® AG software referenced on this site is furnished under license
agreements between SAP® AG and its customers and can be used only within the terms of
such agreements. SAP® AG and mySAP® are registered trademarks of SAP AG. This
document also uses references to so many products hence all other product names used
herein are trademarks or registered trademarks of their respective owners such as
Microsoft®, Oracle®, IBM®, etc.

Copyright® Guidance Consulting 2 Touseefuddin Syed


Star Schema: Classic and Extended Guidance Consulting

Star Schema: Classic and Extended


Classis Star Schema:
This is the traditional star schema and it is very important to understand the concepts behind this schema
to successfully query, analyze and build reports in SAP BW or for that matter in any reporting tool. It
forms the basis of a multi-dimensional model in SAP BW. Figure given below FIG 01

It is designed with a Fact Table (with Fact’s) in the center with primary keys pointing to Dimensions,
which are extended around and they are connected to the Fact Table with dimension keys. Essentially it
has Fact’s in the middle with dimension attributes surrounding it.

FIG 01: Classis Star Schema

1) The dimensions and the fact table are linked to one another using abstract identification numbers
(dimension IDs) which are contained in the key part of the particular database table.
2) Characteristics that logically belong together (for example, city and region belong to the regional
dimension) are grouped together in a dimension.
3) The dimension attribute that will give the finest detail of information in the dimension form the
primary in the fact table. For Ex: “Customer ID” in the Fact table will be the primary key for the
Fact Table and is known as DIM ID in customer Dimension.
4) As a result, the key figures of the InfoCube relate to the characteristics of the dimension. The
characteristics determine the granularity (the degree of detail) at which the key figures are stored in
the InfoCube.
5) Facts table contains facts/data.
6) The fact table and dimension tables are both relational database tables. Example is given below as to
how relationship exists between tables in a relational database given on next page Fig 02.

Copyright® Guidance Consulting 3 Touseefuddin Syed


Star Schema: Classic and Extended Guidance Consulting

FIG 02: Relations between tables in relational databases

In our example we have Customer, Material and Time dimensions. So table should look like this.

Now the Star Schema will look like given below in FIG 03

FIG 03: Star Schema with dimension tables

Copyright® Guidance Consulting 4 Touseefuddin Syed


Star Schema: Classic and Extended Guidance Consulting

The Fact table should look like this

- Each classic star schema is made up of exactly one fact table while one more dimension table
- Fact table contains the facts ex. Data that shows the Sales Volume and Quantity (as shown above in
the table).
- As explained above this table is relationally linked to the dimension “Customer”, Material” and
“Time” with Dimension ID’s Customer ID, Material ID and Time ID respectively so that the data in
the fact table can be identified uniquely.
For ex: The fact data of Sales Volume (15,000) is uniquely identified by a value combination
of (12.01.2006, C200, M111) of the dimension keys.
- The Fact is highly normalized (regular and consistent).
- This form of storing data is highly desirable for reporting which allows decision makers to come up
with answers to this kind of questions:
1) Who have this material been sold to? (customer dimension)
2) What materials have been sold? (material dimension)
3) How much was sold? (material dimension)
4) When was this material sold (time dimension)

FIG 04: Star Schema diagram with Fact Table and Dimension Tables

Copyright® Guidance Consulting 5 Touseefuddin Syed


Star Schema: Classic and Extended Guidance Consulting

When the request for the above mentioned data fact is done, the system generates a 3 dimensional
results structure which looks like this. The size of the cube depends on the number of dimensions
defined.

FIG 05: Three Dimensional data cube

Decision makers wants to view the data in many ways thus creating many views. We can define
multiple views on this cube using he OLAP functions.

Extended Star Scheme/BW Star Schema

There were some problems with the classic star schema. Therefore SAP came up with multi-
dimensional model based SAP BW star schema/Extended star schema as a response to problems
experienced with the classic star schema. It is an enhanced version of the classic star schema because
the dimensional tables do not contain master data information. This master data information is stored
in separate tables, called master data tables.
- The facts in the fact table are referred to as key figures and dimension attributes as characteristics.
- Characteristics are not the components of dimension table as in classic star schema.
- Schema is extended beyond the dimension table for each characteristics and a numeric SID key is
generated for each characteristics called as SID ID (Surrogate ID)
- Each SID had reference to Master (attribute), Texts, and Hierarchies. Fig given below
- Notice the extension from the Dimensions in the figure.

Copyright® Guidance Consulting 6 Touseefuddin Syed


Star Schema: Classic and Extended Guidance Consulting

FIG 06: Extended Star Schema

- When designing a solution, it is a great challenge to decide whether an attribute should reside in a
dimension table and thus in the InfoCube or in a master table or even both. Data is loaded separately
into the master data (attributes), text and hierarchy tables
- The fact table can contain 16 dimensions and 3 are predefined Time, Unit and Package.
- The Time dimension holds the time characteristics needed for analysis. The Unit dimension contains
the unit of measure and currency characteristics needed to describe the key figures properly. The
Data Packet dimension is used to identify discrete packets of information loaded into the InfoCube.
In this way, packets can be deleted, reloaded or maintained individually.
- Dimension tables consist of a maximum of 248 characteristics.
- Master data tables are connected to an InfoCube by way of the SID tables.
- This way many InfoCubes can access the data from the same master, text and hierarchy tables, in
other words master data is cube-independent.

Advantages of SAP BW Star Schema over classic star schema

1) SID keys reference enables faster data access


2) “Slowly changing dimension” capable
3) Multi language capability
4) Master data is used by several InfoCube

Copyright® Guidance Consulting 7 Touseefuddin Syed


Star Schema: Classic and Extended Guidance Consulting

References
1) Extensive extracts taken from help.sap.com but reproduced in rephrased form.
2) Star schema definitions are referred from “Data Warehousing and SAP BW” guide by Henry Fu and Biao Fu, from
the URL: http://www.awprofessional.com/articles/index.asp?rl=1
3) Characteristics and few facts for classic and Extended Star Schema are adapted from informal website:
http://www.bridgeport.edu/sed/projects/cs597/Fall_2003/vijaykse/extended_star_schema.htm
4) Quite few notes adapted from SAP BW class book for BW 310
5) Vinay Karna’s notes referred from Enterprise Logic.
6) Relational database picture taken from UT Texas website http://www.utexas.edu/its/rc/tutorials/stat/spss/spss4, from the
topic “Data Manipulation and Advanced Topics”

Copyright® Guidance Consulting 8 Touseefuddin Syed

S-ar putea să vă placă și