171
BOID20 Advanced Use of the Information Design Tool SAP BusinessObjects - Business Intelligence Date Training Center Instructors Education Website Participant Handbook Course Version: 96 Course Duration: 2 Day(s) Material Number: 50106141 An SAP course - use it to learn, reference it for work

Boid20 en Col96 Fv Part Ltr

Embed Size (px)

DESCRIPTION

Information Design Tool

Citation preview

Page 1: Boid20 en Col96 Fv Part Ltr

BOID20Advanced Use of the Information

Design ToolSAP BusinessObjects - Business Intelligence

Date

Training Center

Instructors

Education Website

Participant HandbookCourse Version: 96Course Duration: 2 Day(s)Material Number: 50106141

An SAP course - use it to learn, reference it for work

Page 2: Boid20 en Col96 Fv Part Ltr

Copyright

Copyright © 2011 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without theexpress permission of SAP AG. The information contained herein may be changed without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary softwarecomponents of other software vendors.

Trademarks

• Microsoft®, WINDOWS®, NT®, EXCEL®, Word®, PowerPoint® and SQL Server® areregistered trademarks of Microsoft Corporation.

• IBM®, DB2®, OS/2®, DB2/6000®, Parallel Sysplex®, MVS/ESA®, RS/6000®, AIX®, S/390®,AS/400®, OS/390®, and OS/400® are registered trademarks of IBM Corporation.

• ORACLE® is a registered trademark of ORACLE Corporation.• INFORMIX®-OnLine for SAP and INFORMIX® Dynamic ServerTM are registered trademarks

of Informix Software Incorporated.• UNIX®, X/Open®, OSF/1®, and Motif® are registered trademarks of the Open Group.• Citrix®, the Citrix logo, ICA®, Program Neighborhood®, MetaFrame®, WinFrame®,

VideoFrame®, MultiWin® and other Citrix product names referenced herein are trademarks ofCitrix Systems, Inc.

• HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C®, World WideWeb Consortium, Massachusetts Institute of Technology.

• JAVA® is a registered trademark of Sun Microsystems, Inc.• JAVASCRIPT® is a registered trademark of Sun Microsystems, Inc., used under license for

technology invented and implemented by Netscape.• SAP, SAP Logo, R/2, RIVA, R/3, SAP ArchiveLink, SAP Business Workflow, WebFlow, SAP

EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP.com Logo and mySAP.com aretrademarks or registered trademarks of SAP AG in Germany and in several other countries allover the world. All other products mentioned are trademarks or registered trademarks of theirrespective companies.

Disclaimer

THESE MATERIALS ARE PROVIDED BY SAP ON AN "AS IS" BASIS, AND SAP EXPRESSLYDISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR APPLIED, INCLUDING WITHOUTLIMITATION WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULARPURPOSE, WITH RESPECT TO THESE MATERIALS AND THE SERVICE, INFORMATION, TEXT,GRAPHICS, LINKS, OR ANY OTHER MATERIALS AND PRODUCTS CONTAINED HEREIN. INNO EVENT SHALL SAP BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL,CONSEQUENTIAL, OR PUNITIVE DAMAGES OF ANY KIND WHATSOEVER, INCLUDINGWITHOUT LIMITATION LOST REVENUES OR LOST PROFITS, WHICH MAY RESULT FROMTHE USE OF THESE MATERIALS OR INCLUDED SOFTWARE COMPONENTS.

g20120232650

Page 3: Boid20 en Col96 Fv Part Ltr

About This HandbookThis handbook is intended to complement the instructor-led presentation of thiscourse, and serve as a source of reference. It is not suitable for self-study.

Typographic ConventionsAmerican English is the standard used in this handbook. The following typographicconventions are also used.

Type Style Description

Example text Words or characters that appear on the screen. Theseinclude field names, screen titles, pushbuttons as well asmenu names, paths, and options.

Also used for cross-references to other documentationboth internal and external.

Example text Emphasized words or phrases in body text, titles ofgraphics, and tables

EXAMPLE TEXT Names of elements in the system. These include reportnames, program names, transaction codes, table names,and individual key words of a programming language,when surrounded by body text, for example SELECTand INCLUDE.

Example text Screen output. This includes file and directory namesand their paths, messages, names of variables andparameters, and passages of the source text of a program.

Example text Exact user entry. These are words and characters thatyou enter in the system exactly as they appear in thedocumentation.

<Example text> Variable user entry. Pointed brackets indicate that youreplace these words and characters with appropriateentries.

2012 © 2011 SAP AG. All rights reserved. iii

Page 4: Boid20 en Col96 Fv Part Ltr

About This Handbook BOID20

Icons in Body TextThe following icons are used in this handbook.

Icon Meaning

For more information, tips, or background

Note or further explanation of previous point

Exception or caution

Procedures

Indicates that the item is displayed in the instructor'spresentation.

iv © 2011 SAP AG. All rights reserved. 2012

Page 5: Boid20 en Col96 Fv Part Ltr

ContentsCourse Overview ............................................................................. vii

Course Goals.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .viiCourse Objectives ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .vii

Unit 1: SQL Traps...............................................................................1Understanding SQL Traps and Universes... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2Detecting and Resolving Chasm Traps ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4Detecting and Resolving Fan Traps ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Unit 2: Advanced Use of the@Aggregate_Aware Function ............................................................. 43

Advanced Use of @AggregateAware ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44Using @AggregateAware to Resolve a 2-Table Fan Trap ... . . . . . . . . . . . . . . . . . . . . . . . . . 46Using @AggregateAware to Resolve an Ambiguous Outer Join.. . . . . . . . . . . . . . . . . . . . 60

Unit 3: Creating Universes from Different Data Sources............................ 75Creating Universes from Different Data Sources... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76Creating an OLAP Universe... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78Creating a Multisource Universe... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

Unit 4: Deploying Universes in different languages.................................117Using the Translation Management Tool .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

Unit 5: Managing and Optimizing Universes..........................................131Managing a Universe with Data Foundation and Business Layer Views... . . . . . . . .132Working with a Shared Project.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135Optimizing the Universe ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142

2012 © 2011 SAP AG. All rights reserved. v

Page 6: Boid20 en Col96 Fv Part Ltr

Contents BOID20

vi © 2011 SAP AG. All rights reserved. 2012

Page 7: Boid20 en Col96 Fv Part Ltr

Course OverviewThe Information Design Tool enables designers to extract, define, and manipulate metadata from relational and OLAP sources to create and deploy SAP BusinessObjectsuniverses. In this course you learn the more advanced features of working with theInformation Design Tool, including resolving SQL Traps, using the @AggregateAwarefunction for resolving data foundation issues, creating universes from differentsources, deploying universes in multiple languages, and managing and optimizinguniverses.

Target AudienceThis course is intended for the following audiences:

• Data Managers• Project managers• BI Platform / SAP NetWeaver BW System Administrators• SAP Netweaver BW / SAP BusinessObjects Consultants

Course PrerequisitesRequired Knowledge

• Working knowledge of SQL and relational, also OLAP database managementsystems concepts and structures

• Basic knowledge of in reporting with SAP BusinessObjects Web Intelligence• Completion of the BOID10 course

Recommended Knowledge

• Completion of the BOW310 course or a working knowledge of Web Intelligenceapplication

Course GoalsThis course will prepare you to:

• Work with advanced functionality of the Information Design Tool, includingresolving SQL Traps, using the @AggregateAware function, creating Universesfrom different sources, deploying a universe in multiple languages, andmanaging and optimizing the universe.

2012 © 2011 SAP AG. All rights reserved. vii

Page 8: Boid20 en Col96 Fv Part Ltr

Course Overview BOID20

Course ObjectivesAfter completing this course, you will be able to:

• Resolve SQL Traps• Learn advanced use of the @AggregateAware function• Create a universe from and OLAP source and from multiple relational sources• Deploy a universe in different languages• Manage and optimize the universe

viii © 2011 SAP AG. All rights reserved. 2012

Page 9: Boid20 en Col96 Fv Part Ltr

Unit 1SQL Traps

Unit OverviewWhen working with relational data sources at the SQL level it is common to encounterSQL traps: chasm and fan. The Information Design Tool provides ways of resolvingthese traps..

After completing this lesson, you will be able to:

• Understand SQL traps and universes• Resolve fan traps• Resolve chasm traps

Unit ObjectivesAfter completing this unit, you will be able to:

• Explain how SQL traps can cause queries to return inaccurate results• Define a chasm trap• Detect chasm traps in a universe structure• Resolve chasm traps• Define a fan trap• Detect fan traps in the universe structure• Resolve fan traps

Unit ContentsLesson: Understanding SQL Traps and Universes... . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2Lesson: Detecting and Resolving Chasm Traps ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4

Exercise 1: Resolve Chasm Traps ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9Lesson: Detecting and Resolving Fan Traps ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Exercise 2: Resolve Fan Traps ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

2012 © 2011 SAP AG. All rights reserved. 1

Page 10: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

Lesson: Understanding SQL Traps and Universes

Lesson OverviewSQL traps are caused by the way in which the parts of a select statement are combinedwhen referencing a relational database.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Explain how SQL traps can cause queries to return inaccurate results

Business Example

About SQL trapsChasm traps and fan traps are problems inherent in SQL that are caused by the orderin which the elements of the SELECT statement are processed.

In SQL, a SELECT statement processes the SELECT, FROM, and WHERE clausesfirst (with the exception of any aggregates). In doing so, it creates a product of all thetables in the FROM clause on the basis of the joins and restrictions specified in theWHERE clause. This can be thought of as a virtual table. Normally this does notcause a problem, but if an aggregate is applied then it may, in particular circumstances,result in wrong output being generated. This is particularly worrying because SQLdoes not produce an error message, it just projects the results.

Unlike loops that return fewer rows than expected, chasm traps and fan traps returntoo many rows.

Fortunately, there are ways of identifying situations in which chasm traps and fan trapscan occur, and there are methods of resolving these situations.

2 © 2011 SAP AG. All rights reserved. 2012

Page 11: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Understanding SQL Traps and Universes

Lesson Summary

You should now be able to:• Explain how SQL traps can cause queries to return inaccurate results

2012 © 2011 SAP AG. All rights reserved. 3

Page 12: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

Lesson: Detecting and Resolving Chasm Traps

Lesson OverviewThis lesson explains how to detect and resolve chasm traps in the universe structure.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Define a chasm trap• Detect chasm traps in a universe structure• Resolve chasm traps

Business ExampleYour company will be reporting against a relational database and you need to identifyand resolve any chasm traps that may be present.

Chasm trapsA chasm trap is a type of join path between three tables when two many–to–onejoins converge on a single table, and there is no context in place that separates theconverging join paths.

You only get incorrect results when the following circumstances all existsimultaneously:

1. There is a “many-to-one-to-many” relationship between three tables in theuniverse structure.

2. The query includes objects based on the two “many” tables.3. There are multiple rows returned for an object (usually a dimension) based on

the “one” table.

For example, in this diagram there is no loop, but the flow around the three tables ismany–to–one–to–many.

4 © 2011 SAP AG. All rights reserved. 2012

Page 13: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Chasm Traps

Figure 1: Many-to-one-to-many join flow

Note: A chasm trap is not dependent on the object types. The query couldbe made up of only dimensions, only details, or only measures, or anycombination of the three types with the “many” tables for a chasm to occur.

When a query that uses objects Y and Z is run, the inferred SQL includes tables B,C, and A that have a “many-to-one-to-many” relationship respectively. The chasmtrap causes a query to return every possible combination of rows for one measure withevery possible combination of rows for the other measure. This results in the valuesfor each object being multiplied by the other. The effect is similar to a Cartesianproduct but is known as a chasm trap.

The chasm trap is resolved by executing separate SELECT statements for object Yand object Z.

2012 © 2011 SAP AG. All rights reserved. 5

Page 14: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

Detecting chasm trapsUnlike loops, chasm traps are not detected automatically by the Information DesignTool. However, you can detect them in one of the following ways:

• Analyze the one-to-many (1-N) join paths in your schema to detect chasm trapsgraphically.

• Select Tools→ Detect Contexts or click the Detect Contexts button toautomatically detect and propose candidate contexts in your schema.

Detect Contexts examines the many-to-one (N–1) joins in the schema andproposes contexts to separate the queries run on the table. This is the mosteffective way to ensure that your schema does not have a chasm trap.

• Add additional dimension or detail objects to display more information in thereport. If there is a chasm trap, aggregated values are multiplied, alerting you tothe problem.

You can use Detect Contexts to detect and propose candidate contexts, and thenexamine the table where any two contexts diverge. The point where two contextsintersect is the source of a chasm trap.

Any two tables that have multiple rows converging to a single row in the tablewith the “one” relationship may potentially cause a chasm trap.

The chasm trap scenarioIn the classroom demonstration, the query returns every possible combination of salerows with every possible combination of rental rows. As a result the aggregates havebeen multiplied by the number of related rows on the alternative "many" table.

The query returns every possible combination of sale rows with every possiblecombination of rental rows. Hence, the sale transactions each appear twice as do therental transactions, and as a result of this the aggregates have been multiplied by thenumber of related rows on the alternative "many" table.

Where you have a many-one-many relationship for tables in the FROM clause, theresulting logical table produces something akin to a Cartesian product. Only then isaggregation applied. This is the reason for the chasm effect.

The problem with chasm traps is that, unless you look at the detail rows, there isnothing to alert you to the situation.

6 © 2011 SAP AG. All rights reserved. 2012

Page 15: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Chasm Traps

Resolving chasm trapsTo resolve a chasm trap, you need to make two separate queries and then combine theresults. Depending on the type of objects defined for the fact tables and the type ofend-user environment, you can use the following methods to resolve a chasm trap:

• Ensure that the Query Options in the Business Layer generate separate SQLstatements for each measure.

This method is not recommended as it only works with measures and results incertain inefficiencies in processing. It does not generate separate queries fordimension or detail objects.

• Create a context for each fact table.

This solution works in all cases and does not result in inefficiencies.

Using multiple SQL statements for each measure toresolve chasm trapsIf you have only measure objects defined for both fact tables, then you can use theQuery Option setting of the Business LayerMultiple SQL statements for eachmeasure. This forces the generation of separate SQL queries for each measure that isused in the query.

With the optionMultiple SQL statements for each measure selected, UniverseDesigner now makes separate SQL SELECT statements for each measure object inthe query.

The results in the report are now correct, as the query has automatically generatedtwo SQL statements.

Using this option resolves the chasm trap problem. However, there are drawbacks tousing this method to resolve chasm traps.

Drawbacks to the multiple SQL statements for eachmeasure methodThe results can be confusing

The Query Option specifies: “Multiple SQL statements for each measure” . One ofthe drawbacks is that it does not run separate SELECT statements if the query containsonly dimension objects.

The resulting report contains a single block with the results displayed as a Cartesianproduct.

2012 © 2011 SAP AG. All rights reserved. 7

Page 16: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

Figure 2: Cartesian Product-like results

It is not that there is anything inaccurate about the dates, but the multiple occurrencesare confusing to users.

The query is inefficient

Another drawback is that any query including multiple measures infers a separateSELECT statement for each measure, whether it is required or not.

To find a complete solution to chasm traps, you must use contexts.

Using contexts to resolve chasm trapsYou can define a context for each table at the many end of the joins. In our classroomexample you could define a context from Client to Sale and from Client to Rental.

When you run a query that includes objects from both contexts, this creates twoSELECT statements that are synchronized at run–time in SAP BusinessObjectsend–user query tools to prevent the creation of a Cartesian product.

Creating contexts always solves a chasm trap in a universe. When you have a“many–to–one–to–many” situation, always use a context.

8 © 2011 SAP AG. All rights reserved. 2012

Page 17: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Chasm Traps

Exercise 1: Resolve Chasm Traps

Exercise ObjectivesAfter completing this exercise, you will be able to:• Detect contexts to resolve a chasm trap in the universe structure.

Business ExampleYou need to report on client sales and rentals. Due to the structure of the database thiswill create a chasm trap, which will need to be resolved in order to return accurateresults.

Task:1. Create a new Project and Data Foundation called Chasm_xx, where “xx”” stands

for your user number. Use the Motors connection.

Field Value

User Name Train-xx

Password Assigned password

Authentication Enterprise

2. Add the following tables to the Data Foundation:CLIENTSALERENTAL (as an alias of the SALE table)

3. Create the following joins and set the cardinalities:

Join Cardinality

CLIENT.CLIENT_ID=SALE.CLIENT_ID 1,n

CLIENT.CLIENT_ID=RENTAL.CLIENT_ID 1,n

SALE.SALE_TYPE=’S’ 1,1

RENTAL.SALE_TYPE=’R’ 1,1

4. Create a Business Layer called Chasm_xx

5. Deselect the “Multiple SQL statements for each measure” option.

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 9

Page 18: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

6. Create two classes:- Chasm Objects- Measures

7. Add the following objects with the following syntax:

Chasm Objects class

Object Name Syntax

Client Name CLIENT.CLIENT_LASTNAME +’,‘+

CLIENT.CLIENT_FIRSTNAME

Sale Date SALE.SALE_DATE

Rental Date RENTAL.SALE_DATE

Measures class

Object Name Syntax

Sales Revenue SUM(SALE.SALE_TOTAL)

Rental Revenue SUM(RENTAL.SALE_TOTAL)

Hint: Use the SQL Assistant button to build the syntax.

8. Perform an Integrity Check on:

- Tables

- Joins

- Business Layer

9. Save all changes.

10. Create a Query in the Business Layer to test the universe. Restrict the queryresults to Paul Brent only.

11. In the same query on the Business Layer, add Sales Revenue, so that bothRental Revenue and Sales Revenue are part of the query, along with ClientName. Refresh the query and note the results.

12. In the Information Design Tool on the Data Foundation add the two contexts toresolve the Chasm Trap:- Sales

Continued on next page

10 © 2011 SAP AG. All rights reserved. 2012

Page 19: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Chasm Traps

- Rental

13. Save the changes to the Data Foundation.

14. Recreate the last query from Step 11.

15. What is the Sales Revenue?What is the Rental Revenue?

2012 © 2011 SAP AG. All rights reserved. 11

Page 20: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

Solution 1: Resolve Chasm TrapsTask:1. Create a new Project and Data Foundation called Chasm_xx, where “xx”” stands

for your user number. Use the Motors connection.

Field Value

User Name Train-xx

Password Assigned password

Authentication Enterprise

a) Click Start → Programs → SAP BusinessObjects → SAP BusinessObjectsBI platform 4.0 → SAP BusinessObjects BI platform Client Tools →Information Design Tool.

b) Click File → New→ Project

Project Name: Chasm_xx

c) Click Finish

d) Add a Repository session. Under the Repository Resources pane, click +and select Insert Session.

e) Log into the system using the information provided.

f) Browse to the connection folder

g) Find the existing connection “Motors”.

h) Right-click the Motors connection and select Create RelationalConnection Shortcut

i) Select Chasm_xx from the pop-up box

j) Click OK.

k) Click Close to proceed

l) “Motors.cns” will appear under the local project

m) Click New → Data Foundation.

n) Resource Name: Chasm_xx

o) Select Next→ Single Source→ Next→ Select Motors shortcut→Finish

Continued on next page

12 © 2011 SAP AG. All rights reserved. 2012

Page 21: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Chasm Traps

2. Add the following tables to the Data Foundation:CLIENTSALERENTAL (as an alias of the SALE table)

a) Select the Data Foundation tab.

b) Click on the “+” and click on Insert Tables.

Hint: Follow the instructor’s guide if you encounter any problemsduring this step.

c) Browse the tables under dbo.

d) Double-click the CLIENT and SALE tables under connections

e) Right-click the Sales table that is in the Data Foundation

f) Insert → Alias Table…

g) Double-click “Alias_of_Sales” and change the proposed name to RENTAL

h) Click OK

3. Create the following joins and set the cardinalities:

Join Cardinality

CLIENT.CLIENT_ID=SALE.CLIENT_ID 1,n

CLIENT.CLIENT_ID=RENTAL.CLIENT_ID 1,n

SALE.SALE_TYPE=’S’ 1,1

RENTAL.SALE_TYPE=’R’ 1,1

a) Drag the join between the columns of the tables

b) Double-click the join to display the properties

c) Click the cardinality drop-down to set the cardinality

For the self-joins:

d) Insert → Insert Join

e) Set the Expression and cardinality

f) Click Validate

g) Click Save to save the Data FoundationContinued on next page

2012 © 2011 SAP AG. All rights reserved. 13

Page 22: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

4. Create a Business Layer called Chasm_xx

a) Right-click the project

b) Select New→ Business Layer

c) Select Relational Data Source→ Next

d) Name the Business Layer Chasm_xx→ Next

e) Select “…”to select the Data Foundation

f) Select Chasm_xx.dfx and click OK

g) Deselect “Automatically create classes and objects” option

h) Click Finish

5. Deselect the “Multiple SQL statements for each measure” option.

a) Select the top level of the Business Layer

b) Select the Query Options tab

c) Deselect the “Multiple SQL statements for each measure” option

6. Create two classes:- Chasm Objects- Measures

a) Select the top level of the Business Layer

b) Click the Insert Object drop down

c) Select Folder

d) Change name to Chasm Objects

e) Select the top level of the Business Layer

f) Click the Insert Object drop down

g) Select Folder

h) Change name to Measures

7. Add the following objects with the following syntax:

Continued on next page

14 © 2011 SAP AG. All rights reserved. 2012

Page 23: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Chasm Traps

Chasm Objects class

Object Name Syntax

Client Name CLIENT.CLIENT_LASTNAME +’,‘+

CLIENT.CLIENT_FIRSTNAME

Sale Date SALE.SALE_DATE

Rental Date RENTAL.SALE_DATE

Measures class

Object Name Syntax

Sales Revenue SUM(SALE.SALE_TOTAL)

Rental Revenue SUM(RENTAL.SALE_TOTAL)

Hint: Use the SQL Assistant button to build the syntax.

a) Select the class/folder: Chasm Objects

b) Select the Insert Object drop down

c) Select Dimension orMeasure

d) Change the Name:

Dimension

Client Name

Sale Date

Rental Date

Note: For Sale Date and Rental Date you have to set Data Typeto Date Time

and

Measure

Sales Revenue

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 15

Page 24: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

Rental Revenue

e) Click SQL Assistant

f) Enter the select:

Dimension CLIENT.CLIENT_LASTNAME + ‘, ‘ +CLIENT.CLIENT_FIRSTNAME

SALE.SALE_DATE

RENTAL.SALE_DATE

Measure SUM(SALE.SALE_TOTAL)

SUM(RENTAL.SALE_TOTAL)

g) Click Validate

h) Click OK

8. Perform an Integrity Check on:

- Tables

- Joins

- Business Layer

a) Right-click top level of Business Layer

b) Select Check Integrity

c) Select:

• Tables• Joins• Business Layer

d) Click Check Integrity

e) Click OK

9. Save all changes.

a) Select File → Save All

Continued on next page

16 © 2011 SAP AG. All rights reserved. 2012

Page 25: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Chasm Traps

10. Create a Query in the Business Layer to test the universe. Restrict the queryresults to Paul Brent only.

a) From the Business Layer select “Queries”

b) Click Insert Query

c) Create a query with the Client Name and Sales Revenue objects.

d) Apply a query filter on Client Name for Brent, Paul by dragging ClientName to the Query Filter area and completing the query filter:Client Name In list Brent, Paul

e) Click Refresh and note the results: Sales Revenue = 315,964.50

f) Remove Sales Revenue from the Result Objects area

g) Add Rental Revenue and refresh the query. Note the results: RentalRevenue = 1,100

11. In the same query on the Business Layer, add Sales Revenue, so that bothRental Revenue and Sales Revenue are part of the query, along with ClientName. Refresh the query and note the results.

a) Add the Sales Revenue object back to the Result Objects area

b) Click Refresh

c) Note that both revenue amounts have doubled.

12. In the Information Design Tool on the Data Foundation add the two contexts toresolve the Chasm Trap:- Sales- Rental

a) Under Aliases and Contexts click Detect Contexts…

b) Select both contexts

c) Click OK

13. Save the changes to the Data Foundation.

a) Click Save.

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 17

Page 26: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

14. Recreate the last query from Step 11.

a) From the Business Layer select Query

b) Select the Client Name, Sales Revenue and Rental Revenue objects.

c) Drag the Client Name object down into the Query Filter area

d) Complete the Query Filter:Client Name In list Brent, Paul

e) Click Refresh

15. What is the Sales Revenue?What is the Rental Revenue?

a) Sales Revenue = 315,964.50

b) Rental Revenue = 1,100.00

18 © 2011 SAP AG. All rights reserved. 2012

Page 27: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Chasm Traps

Lesson Summary

You should now be able to:• Define a chasm trap• Detect chasm traps in a universe structure• Resolve chasm traps

2012 © 2011 SAP AG. All rights reserved. 19

Page 28: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

Lesson: Detecting and Resolving Fan Traps

Lesson OverviewThis lesson explains how fan traps can occur in the universe structure and how toresolve them.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Define a fan trap• Detect fan traps in the universe structure• Resolve fan traps

Business ExampleYou need to report on Sales order summary data and Sales order line details in thesame report. To make the query more efficient, the order summary data is stored in aseparate table from the order line data. As a result you will create a fan trap whichwill need to be resolved.

Fan trapsFan traps occur when there is a “one–to–many” join to a table that “fans out” intoanother “one–to–many” join to another table.

20 © 2011 SAP AG. All rights reserved. 2012

Page 29: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Fan Traps

Figure 3: One-to-many fanning to another one-to-many join flow

This is a common structure and does not normally result in a fan trap. You only getincorrect results from the fan trap when the query includes a measure object on themiddle table ('B') of the table path and an object (of any kind) from the subsequenttable ('C'). The trap only occurs where (due to the database design) a column in tableB holds data values which are already a sum of those values held at table C. Theresults are normally noticeably wrong.

When a query is run using objects Y and Z, the inferred SQL includes tables B and Cwhich have a ‘one-to-many’ relationship. This results in a value for the Y object beingmultiplied by the number of values of the Z object related to that Y object value. Likethe chasm trap, the effect is similar to a Cartesian product.

Like the chasm trap, the fan trap can be resolved by executing a separate SELECTstatement for object Y and object Z. The alternate solution is to avoid it in the firstplace.

You cannot automatically detect fan traps. You need to visually examine the directionof the cardinalities displayed in the table schema.

If you have two tables that are referenced by measure objects and are joined in a seriesof “many-to-one” joins, then you may have a potential fan trap.

The fan trap scenarioIn the Data Foundation for the Motors universe, the Client and Sale tables are joinedby a “one-to-many-to-many” relationship, as are the Sale and Sale_Model tables.

2012 © 2011 SAP AG. All rights reserved. 21

Page 30: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

The fan trap problem becomes apparent in a query that aggregates both an objectbased on the Sale_Total column in the Sale table, and an object based on the Sale_Qtycolumn in the Sale_Model table.

Resolving fan trapsThe recommended ways to solve a fan trap problem are:

• Alter the SQL parameters for the universe.• Use a combination of aliases and contexts.• Avoid the fan trap scenario.

Alter the SQL parameters for the universe

This method is not recommended as it only works for measure objects and may resultin inefficiencies in processing the query. This resolution works the same for chasmand fan traps.

Use a combination of aliases and contexts

There are two possible situations which may require different solutions.

If you have... Then...

• Three tables in a path containing theinitial aggregation, joining it backto the one-to-many relationship.

• A dimension coming from the firsttable and measures coming fromthe two subsequent tables.

Create an alias for the table (on the manyend of the join) Use the Detect Contextstool to detect and propose a contextfor the alias table and a context for theoriginal table.

This is the most effective way to solvethe fan trap problem because it workswith measure and dimension objects anddoes not cause inefficiencies.

• Two tables in a one-to-manyrelationship.

• A dimension and a measure comingfrom the first table and a measurecoming from the subsequenttable(s).

Create an alias for the table containingthe initial aggregation, joining it back tothe original table and then use the DetectContexts tool to detect and propose acontext for the alias table and a contextfor the original table.

Both of these methods solve the fan trapproblem because they work with bothmeasure and dimension objects and donot cause inefficiencies.

22 © 2011 SAP AG. All rights reserved. 2012

Page 31: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Fan Traps

Note: However, to be more efficient still,using the two–table scenario, you couldalso use the @aggregate_aware function.See Unit 2 for more information.

Avoid the fan trap scenario

You can avoid the scenario in the first place by relating all measure objects in theuniverse to the same table in the universe structure. Avoid placing a measure onanything other than the last table in a table path, which is the table with the “many”cardinality attached to it.

Using aliases and contexts to resolve fan trapsYou create an alias table for the table producing the aggregation and then detect andimplement contexts to separate the query. This procedure is demonstrated in thediagram below:

Figure 4: Fan trap solution

As with resolving a chasm trap problem, two contexts need to be created. In thisexample, a context for Sale, and a context for Sale_Model need to be defined. Thisallows for the results to be merged into a single microcube to produce the correctresults.

The SELECT clause of the Sales Revenue object also needs to be edited, so that itrefers to the alias table rather than the original Sale table.

2012 © 2011 SAP AG. All rights reserved. 23

Page 32: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

Moreover, if you make a query which includes a dimension object on the lower tablein the “one-many-many” path, you do not get the fan trap, even when that dimensionobject contains the same value for all rows related to the measure value. The factthat the measure and dimension objects are in separate contexts forces two separateSELECT statements, thus avoiding the problem.

To use aliases and contexts to resolve a fan trap

1. Identify the potential fan trap by analyzing the “one-to-many-to-one-to-many”join path relations in the schema.

2. Create an alias for the table that is producing the multiplied aggregation.3. Create a join between the new alias table, and the table that holds the dimension

information.4. Set cardinality.5. Set contexts.6. Change the SELECT clause of the measure object so that it refers to the alias

table rather than the original table.7. Create a query using a measure object from the alias table and another measure

from the subsequent table in the table path of the universe structure.

This results in two SELECT statements and the data is merged into a singlemicrocube to produce the correct results.

Avoiding fan traps altogetherIn certain situations, it is possible to avoid the fan trap completely, as shown in thediagram below.

To avoid the trap, the database column in table B to which the Y measure objectrelates must represent a pre-aggregation of more detailed data in table C. If this is thecase, you can change the code of the Y measure object so that it refers to table C.Therefore, there is no longer a “one-to-many” relationship incurred.

24 © 2011 SAP AG. All rights reserved. 2012

Page 33: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Fan Traps

Figure 5: Avoiding a fan trap

This is the method used to avoid the fan trap in the Motors universe, when the SalesRevenue and Number of Cars Sold measure objects are included in the same query.

In the Motors universe, the Sales Revenue measure is not based on the total figurein the Sale table but on a number of columns from the Sale, Sale_Model and Modeltables which are held in the database at the same level of granularity as the number ofcars sold. Therefore, no fan trap exists and the correct result is obtained.

2012 © 2011 SAP AG. All rights reserved. 25

Page 34: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

26 © 2011 SAP AG. All rights reserved. 2012

Page 35: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Fan Traps

Exercise 2: Resolve Fan Traps

Exercise ObjectivesAfter completing this exercise, you will be able to:• Detect contexts to resolve a fan trap in the universe structure.

Business ExampleYou need to report on car sales revenue and the number of cars sold at the client andorder level. Due to the database structure, this will result in a fan trap, which will needto be resolved in order to return accurate results.

Task:1. Create a new Project and Data Foundation called Fan_xx, where “xx” stands

for your user number. User the Motors connection.

2. Add the following tables to the Data Foundation:CLIENTSALESALE_MODEL

3. Create the following joins and set the cardinalities:

Join Cardinality

CLIENT.CLIENT_ID=SALE.CLIENT_ID 1,n

SALE.SALE_ID=SALE_MODEL.SALE_ID 1,n

SALE.SALE_TYPE=’S’ 1,1

4. Create a Business Layer called Fan_xx

5. Deselect the “Multiple SQL statements for each measure” option.

6. Create two classes:- Fan Objects- Measures

7. Add the following objects with the following syntax:

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 27

Page 36: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

Fan Objects class

Object Name Syntax

Client Name CLIENT.CLIENT_LASTNAME +’,‘+

CLIENT.CLIENT_FIRSTNAME

Model ID SALE_MODEL.MODEL_ID

Measures class

Object Name Syntax

Sales Revenue SUM(SALE.SALE_TOTAL)

Number of Cars Sold SUM(SALE_MODE.SALE_QTY)

8. Perform an Integrity Check on:- Tables- Joins- Business Layer

9. Save all changes.

10. Create a Query in the Business Layer to test the universe. Restrict the queryresults to Randall, Sean.

11. In the same query on the Business Layer, add the Model ID object to the ResultObjects area. Refresh the query and note the results.

12. What is the measure value?

13. In the Information Design Tool on the Data Foundation tab create an Aliasof the Sales table.

14. Join the new table to the Client table and add the appropriate self join to the alias.

Join Cardinality

CLIENT.CLIENT_ID=Alias_of_SALE.CLIENT_ID 1,n

Alias_of_SALE.SALE_TYPE =’S’ 1,1

15. In the Information Design Tool on the Data Foundation tab add the two contexts:- Sale Model- Alias_of_SALE

Continued on next page

28 © 2011 SAP AG. All rights reserved. 2012

Page 37: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Fan Traps

16. Save the changes to the Data Foundation.

17. Modify the definition of the Sales Revenue object so that it is defined on thenew alias table.

18. Save the changes to the Business Layer.

19. Recreate the last query from Step 11.

20. What is the Sales Revenue?

2012 © 2011 SAP AG. All rights reserved. 29

Page 38: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

Solution 2: Resolve Fan TrapsTask:1. Create a new Project and Data Foundation called Fan_xx, where “xx” stands

for your user number. User the Motors connection.

a) Click New → Project.

Project Name: Fan_xx

b) Click Finish

c) Add a Repository session

d) Browse the connection folder

e) Find the existing connection “Motors”

f) Right-click Motors connection → Create Relational ConnectionShortcut

g) Select Fan_xx from the pop-up box

h) Click Finish

i) Click Close to proceed

j) “Motors.cns” will appear under the local project

k) Click New→ Data Foundation

l) Resource Name: Fan_xx

m) Click Next→ Single Source→ Next→ Select Motors shortcut→ Finish

2. Add the following tables to the Data Foundation:CLIENTSALESALE_MODEL

a) Select the Data Foundation tab.

b) Click on the “+” and click on Insert Tables.

c) Browse the tables under dbo.

d) Double-click the CLIENT, SALE and SALE_MODEL tables underconnections

e) Click Finish.

Continued on next page

30 © 2011 SAP AG. All rights reserved. 2012

Page 39: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Fan Traps

3. Create the following joins and set the cardinalities:

Join Cardinality

CLIENT.CLIENT_ID=SALE.CLIENT_ID 1,n

SALE.SALE_ID=SALE_MODEL.SALE_ID 1,n

SALE.SALE_TYPE=’S’ 1,1

a) Drag the join between the columns of the tables

b) Double-click the join to display the properties

c) Click the cardinality drop-down to set the cardinality

For the self-join:

d) Insert → Insert Join

e) Set the Expression and cardinality

f) Click Validate

g) Save your changes.

4. Create a Business Layer called Fan_xx

a) Select the project

b) Click New→ Business Layer

c) Select Relational Data Source→ Next

d) Name the Business Layer Fan_xx→ Next

e) Select “…” to select the Data Foundation

f) Select Fan_xx.dfx→ Click OK

g) Deselect “Automatically create classes and objects” option

h) Click Finish

5. Deselect the “Multiple SQL statements for each measure” option.

a) Select the top level of the Business Layer

b) Select the Query Options tab

c) Deselect the “Multiple SQL statements for each measure” option

6. Create two classes:- Fan Objects

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 31

Page 40: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

- Measures

a) Select the top level of the Business Layer

b) Click the Insert Object drop down

c) Select Folder

d) Change name to Fan Objects

e) Select the top level of the Business Layer

f) Click the Insert Object drop down

g) Select Folder

h) Change name to Measures

7. Add the following objects with the following syntax:

Fan Objects class

Object Name Syntax

Client Name CLIENT.CLIENT_LASTNAME +’,‘+

CLIENT.CLIENT_FIRSTNAME

Model ID SALE_MODEL.MODEL_ID

Measures class

Object Name Syntax

Sales Revenue SUM(SALE.SALE_TOTAL)

Number of Cars Sold SUM(SALE_MODE.SALE_QTY)

a) Select the class/folder:

1. Fan Objects

2. Measures

b) Select the Insert Object drop down

c) Select

1. Dimension

Continued on next page

32 © 2011 SAP AG. All rights reserved. 2012

Page 41: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Fan Traps

2. Measure

d) Change the Name:

Dimension Measure

- Client Name - Sales Revenue

- Model ID - Number of Cars Sold

Note: In Model ID you have to set Data Type to Number

e) Click SQL Assistant

f) Enter the select:

Dimension Client Name CLIENT.CLIENT_LASTNAME + ‘, ‘+ CLIENT.CLIENT_FIRSTNAME

Model ID SALE_MODEL.MODEL_ID

Measure SalesRevenue

SUM(SALE.SALE_TOTAL)

Number ofCars Sold

SUM(SALE_MODEL.SALE_QTY)

g) Click Validate

h) Click OK

8. Perform an Integrity Check on:- Tables- Joins

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 33

Page 42: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

- Business Layer

a) Right-click top level of Business Layer

b) Select Check Integrity

c) Select

• Tables• Joins• Business Layer

d) Click Check Integrity

e) Click OK

9. Save all changes.

a) Select File → Save All

10. Create a Query in the Business Layer to test the universe. Restrict the queryresults to Randall, Sean.

a) From the Business Layer select “Query”

b) Click New

c) Create a query with the Client Name and Sales Revenue objects.

d) Apply a query filter on Client Name for Randall, Sean by dragging ClientName to the Query Filter area and completing the query filter:Client Name In list Randall, Sean

e) Click Refresh and note the results: Sales Revenue = 57,091.50

11. In the same query on the Business Layer, add the Model ID object to the ResultObjects area. Refresh the query and note the results.

a) Double-clickModel ID object

b) Click Refresh

12. What is the measure value?

a) Sales Revenue = 114,183.00

Continued on next page

34 © 2011 SAP AG. All rights reserved. 2012

Page 43: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Fan Traps

13. In the Information Design Tool on the Data Foundation tab create an Aliasof the Sales table.

a) Right-click the Sales table

b) Click Insert→ Alias Table…

c) Click OK

14. Join the new table to the Client table and add the appropriate self join to the alias.

Join Cardinality

CLIENT.CLIENT_ID=Alias_of_SALE.CLIENT_ID 1,n

Alias_of_SALE.SALE_TYPE =’S’ 1,1

a) Use drag and drop to create the following join:CLIENT.CLIENT_ID=Alias_of_SALE.CLIENT_ID

b) Double-click the join

c) Set the cardinality to 1,n

d) Click OK

e) Click Insert

f) Select Join

g) Add the expression: Alias_of_SALE.SALE_TYPE =’S’

h) Click Validate

i) Click Close

j) Set cardinality to 1,1

k) Click OK

15. In the Information Design Tool on the Data Foundation tab add the two contexts:- Sale Model- Alias_of_SALE

a) Under Aliases and Contexts click Detect Contexts…

b) Select both contexts

c) Click OK

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 35

Page 44: Boid20 en Col96 Fv Part Ltr

Unit 1: SQL Traps BOID20

16. Save the changes to the Data Foundation.

a) Click Save.

17. Modify the definition of the Sales Revenue object so that it is defined on thenew alias table.

a) Select the Business Layer

b) Select the Sales Revenue object

c) Edit the select to:SUM(Alias_of_SALE.SALE_TOTAL)

d) Click OK

18. Save the changes to the Business Layer.

a) Click Save

19. Recreate the last query from Step 11.

a) From the Business Layer select Query

b) Select the Client Name, Sales Revenue andModel ID objects.

c) Drag the Client Name object down into the Query Filter area

d) Complete the Query Filter:Client Name In list Randall, Sean

e) Click Refresh

20. What is the Sales Revenue?

a) Sales Revenue = 57,091.50

36 © 2011 SAP AG. All rights reserved. 2012

Page 45: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Detecting and Resolving Fan Traps

Lesson Summary

You should now be able to:• Define a fan trap• Detect fan traps in the universe structure• Resolve fan traps

2012 © 2011 SAP AG. All rights reserved. 37

Page 46: Boid20 en Col96 Fv Part Ltr

Unit Summary BOID20

Unit SummaryYou should now be able to:• Explain how SQL traps can cause queries to return inaccurate results• Define a chasm trap• Detect chasm traps in a universe structure• Resolve chasm traps• Define a fan trap• Detect fan traps in the universe structure• Resolve fan traps

38 © 2011 SAP AG. All rights reserved. 2012

Page 47: Boid20 en Col96 Fv Part Ltr

BOID20 Test Your Knowledge

Test Your Knowledge

1. A chasm trap can occur when:

2. Describe two ways to resolve chasm traps.

3. Describe three ways to resolve fan traps.

2012 © 2011 SAP AG. All rights reserved. 39

Page 48: Boid20 en Col96 Fv Part Ltr

Test Your Knowledge BOID20

Answers

1. A chasm trap can occur when:

Answer:

1. Two joins form many-to-one-to-many converge on a single table.2. The query includes objects based on the two “many” tables.3. There are multiple rows returned for a single dimension value.

2. Describe two ways to resolve chasm traps.

Answer:

1. Create a context for each fact table. This solution works in all cases.2. Modify the SQL parameters for the universe so you can generate separate

SQL queries for each measure. This solution only works for measureobjects. It does not generate separate queries for dimension or detailobjects.

3. Describe three ways to resolve fan traps.

Answer:

1. Alter the SQL parameters for the universe. This only works for measureobjects. This resolution works the same for chasm and fan traps.

2. Create an alias for the table containing the initial aggregation, and then useDetect Contexts (Tools Detect Contexts) to detect and propose a contextfor the alias table and a context for the original table. This is the mosteffective way to solve the fan trap problem as it works with measure anddimension objects.

3. Avoid the fan trap in the first place by using the same level of granularity.

40 © 2011 SAP AG. All rights reserved. 2012

Page 49: Boid20 en Col96 Fv Part Ltr
Page 50: Boid20 en Col96 Fv Part Ltr
Page 51: Boid20 en Col96 Fv Part Ltr

Unit Summary BOID20

41 © 2011 SAP AG. All rights reserved. 2012

Page 52: Boid20 en Col96 Fv Part Ltr

Unit Summary BOID20

42 © 2011 SAP AG. All rights reserved. 2012

Page 53: Boid20 en Col96 Fv Part Ltr

Unit 2Advanced Use of the

@Aggregate_Aware Function

Unit OverviewThe @Aggregate_Aware function was originally intended to be used to take advantageof aggregate tables in a data source. As the functionality of the Information DesignTool grows, the use of the @Aggregate_Aware function has expanded to other areas.

After completing this unit, you will be able to:

• Use @Aggregate_Aware to resolve a 2-table fan trap• Use @Aggregate_Aware to resolve an ambiguous outer join

Unit ObjectivesAfter completing this unit, you will be able to:

• Learn how you can use @AggregateAware to resolve 2-table fan traps• Learn how you can use @AggregateAware to resolve ambiguous outer join issues• Use @AggregateAware to overcome the inefficiencies created when resolving

a 2-table fan trap• Use @AggregateAware to resolve issues surrounding outer joins when used

in the Data Foundation of a universe

Unit ContentsLesson: Advanced Use of @AggregateAware... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44Lesson: Using @AggregateAware to Resolve a 2-Table Fan Trap ... . . . . . . . . 46

Exercise 3: Resolve a 2-Table Fan Trap ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49Lesson: Using @AggregateAware to Resolve an Ambiguous Outer Join.. . . 60

Exercise 4: Resolve an Ambiguous Outer Join.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

2012 © 2011 SAP AG. All rights reserved. 43

Page 54: Boid20 en Col96 Fv Part Ltr

Unit 2: Advanced Use of the@Aggregate_Aware Function BOID20

Lesson: Advanced Use of @AggregateAware

Lesson Overview@AggregateAware is a function typically used for optimizing a universe by takingadvantage of pre-aggregated data in the data source. But it can have other uses as well.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Learn how you can use @AggregateAware to resolve 2-table fan traps• Learn how you can use @AggregateAware to resolve ambiguous outer join issues

Business Example

About @AggregateAwareThe aggregate awareness functionality within the Information Design Tool wasintended to allow the universe designer to take advantage of pre-aggregated data thatexists within a data structure. It can, however, be viewed simply as a method forspecifying preferential coding based on the other objects contained in a query. Whenviewed from this perspective, it becomes apparent that aggregate awareness can beused to resolve issues other than those for which it was originally intended.

For instance, aggregate awareness can be used to resolve a particular fan trap that,when resolved using the classic fan trap solution outlined in the previous Unit, resultsin efficient SQL being generated.

It can also be used to resolve issues surrounding outer joins when used in the DataFoundation of a universe.

44 © 2011 SAP AG. All rights reserved. 2012

Page 55: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Advanced Use of @AggregateAware

Lesson Summary

You should now be able to:• Learn how you can use @AggregateAware to resolve 2-table fan traps• Learn how you can use @AggregateAware to resolve ambiguous outer join issues

2012 © 2011 SAP AG. All rights reserved. 45

Page 56: Boid20 en Col96 Fv Part Ltr

Unit 2: Advanced Use of the@Aggregate_Aware Function BOID20

Lesson: Using @AggregateAware to Resolve a 2-TableFan Trap

Lesson OverviewThis lesson explains how to use @AggregateAware to overcome the inefficienciescreated when resolving a 2-table fan trap.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Use @AggregateAware to overcome the inefficiencies created when resolvinga 2-table fan trap

Business Example

The 2-Table Fan TrapAs we have seen, fan traps occur when there is a “one–to–many” join to a table that“fans out” into another “one–to–many” join to another table.

Figure 6: Typical fan trap data foundation

A fan trap, however, can involve only two tables:

46 © 2011 SAP AG. All rights reserved. 2012

Page 57: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using @AggregateAware to Resolve a 2-Table Fan Trap

Figure 7: 2-table fan trap data foundation

Using the standard method for resolving a fan trap, you would:

• Create an alias of table A.• Create a join from the alias table An to table A and set cardinalities.• Set contexts B and An.• Edit object Y so that it refers to columns in the alias table An rather than table A.

Figure 8: Standard fan trap resolution with aliases and contexts

This standard fan trap solution resolves the fan trap if objects Y and Z are used in thesame query. However, if a query involves only objects X and Y, then no fan trapexists, and yet table A is still referenced twice: once for object X and once again forobject Y from the alias table.

2012 © 2011 SAP AG. All rights reserved. 47

Page 58: Boid20 en Col96 Fv Part Ltr

Unit 2: Advanced Use of the@Aggregate_Aware Function BOID20

You can overcome this inefficiency by applying aggregate awareness to the Y object.

To use aliases, contexts, and @AggregateAware to resolve a 2-table fan trap

1. Create an alias of table A.2. Create a join between table A and the alias table An.3. Set the cardinality to 1,n, with the n on the alias table.4. Set contexts An and B.5. Change the SELECT clause of the Y object using @AggerateAware, the first

choice referring to table A and then the alias table An.6. Make the Z object incompatible with table A.

This method results in two SELECT statements when the query includes objectsfrom Tables A and B, but when the query includes objects only from Table A,only one SELECT statement is created, and the Y object refers to Table A.

Figure 9: Fan trap resolutions with @Aggregate_Aware

48 © 2011 SAP AG. All rights reserved. 2012

Page 59: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using @AggregateAware to Resolve a 2-Table Fan Trap

Exercise 3: Resolve a 2-Table Fan Trap

Exercise ObjectivesAfter completing this exercise, you will be able to:• Resolve a 2-table fan trap in the universe structure.• Use @AggregateAware to improve the efficiency of the SQL statement

generated for queries.

Business ExampleYou need to report on car sales revenue and the models sold at the order level.Due to the database structure, this will result in a fan trap, which will need to beresolved in order to return accurate results. You also need to ensure that the SQLstatement generated by the end-user queries is as efficient as possible. You will use@AggregateAware to improve the SQL efficiency.

Task:1. Create a new Project and Data Foundation called 2-Table Fan_xx, where “xx”

stands for your user number. User the Motors connection.

2. Add the following tables to the Data Foundation:SALESALE_MODEL

3. Create the following joins and set the cardinalities:

Join Cardinality

SALE.SALE_ID=SALE_MODEL.SALE_ID 1,n

SALE.SALE_TYPE=’S’ 1,1

4. Create a Business Layer called 2-Table Fan_xx

5. Deselect the “Multiple SQL statements for each measure” option.

6. Create a class:- 2-Table Fan Objects

7. Add the following objects with the following syntax:

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 49

Page 60: Boid20 en Col96 Fv Part Ltr

Unit 2: Advanced Use of the@Aggregate_Aware Function BOID20

2-Table Fan Objects class

Object Name Syntax

Sale ID SALE.SALE_ID

Model ID SALE_MODEL.MODEL_ID

Sales Revenue sum(SALE.SALE_TOTAL)

8. Perform an Integrity Check on:- Tables- Joins- Business Layer

9. Save all changes.

10. Create a Query in the Business Layer to test the universe. Restrict the queryresults to Sale ID 1010.

11. In the same query on the Business Layer, add the Model ID object to the ResultObjects area after the Sale ID in the Query Results area. Refresh the query andnote the results.

12. What is the measure value?

13. In the Information Design Tool on the Data Foundation tab create an Aliasof the Sales table.

14. Join the new table to the Sale table and add the appropriate self join to the alias.

Join Cardinality

SALE.SALE_ID=Alias_of_SALE.SALE_ID 1,n

Alias_of_SALE.SALE_TYPE =’S’ 1,1

15. In the Information Design Tool on the Data Foundation tab add the two contexts:- Sale Model- Alias_of_SALE

16. Save the changes to the Data Foundation.

17. Modify the definition of the Sales Revenue object so that it is defined on thenew alias table.

18. Make the Model ID incompatible with the SALE table.

19. Save the changes to the Business Layer.

Continued on next page

50 © 2011 SAP AG. All rights reserved. 2012

Page 61: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using @AggregateAware to Resolve a 2-Table Fan Trap

20. Recreate the last query from Step 11.

21. What is the Sales Revenue?

2012 © 2011 SAP AG. All rights reserved. 51

Page 62: Boid20 en Col96 Fv Part Ltr

Unit 2: Advanced Use of the@Aggregate_Aware Function BOID20

Solution 3: Resolve a 2-Table Fan TrapTask:1. Create a new Project and Data Foundation called 2-Table Fan_xx, where “xx”

stands for your user number. User the Motors connection.

a) Click New → Project.

Project Name: 2-Table Fan_xx

b) Click Finish

c) Add a Repository session with the logon credentials:

System: BI 4.0 system provided by theinstructor

User name: train-##

Password train-##

Authentication Mode Enterprise

d) Browse the connection folder

e) Find the existing connection “Motors”

f) Right-click Motors connection → Create Relational ConnectionShortcut

g) Select 2-Table Fan_xx from the pop-up box

h) Click Finish

i) Click Close to proceed

j) “Motors.cns” will appear under the local project

k) Select the project and click New→ Data Foundation

l) Resource Name: 2-Table Fan_xx

m) Click Next→ Single Source→ Next→ Select Motors.cns→ Finish

2. Add the following tables to the Data Foundation:SALE

Continued on next page

52 © 2011 SAP AG. All rights reserved. 2012

Page 63: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using @AggregateAware to Resolve a 2-Table Fan Trap

SALE_MODEL

a) Select the Data Foundation tab.

b) Click on the “+” and click on Insert Tables.

c) Browse the tables under dbo.

d) Double-click the SALE and SALE_MODEL tables under connections

e) Click Finish.

3. Create the following joins and set the cardinalities:

Join Cardinality

SALE.SALE_ID=SALE_MODEL.SALE_ID 1,n

SALE.SALE_TYPE=’S’ 1,1

a) Drag the join between the columns of the tables

b) Double-click the join to display the properties

c) Click the cardinality drop-down to set the cardinality

For the self-join:

d) Insert → Insert Join

e) Set the Expression and cardinality

f) Click Validate

g) Click Save

4. Create a Business Layer called 2-Table Fan_xx

a) Select the project

b) Click New→ Business Layer

c) Select Relational Data Source→ Next

d) Name the Business Layer 2-Table Fan_xx→ Next

e) Select “…” to select the Data Foundation

f) Select 2-Table Fan_xx.dfx→ Click OK

g) Deselect “Automatically create classes and objects” option

h) Click Finish

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 53

Page 64: Boid20 en Col96 Fv Part Ltr

Unit 2: Advanced Use of the@Aggregate_Aware Function BOID20

5. Deselect the “Multiple SQL statements for each measure” option.

a) Select the top level of the Business Layer

b) Select the Query Options tab

c) Deselect the “Multiple SQL statements for each measure” option

6. Create a class:- 2-Table Fan Objects

a) Select the top level of the Business Layer

b) Click the Insert Object drop down

c) Select Folder

d) Change name to 2-Table Fan Objects

7. Add the following objects with the following syntax:

2-Table Fan Objects class

Object Name Syntax

Sale ID SALE.SALE_ID

Model ID SALE_MODEL.MODEL_ID

Sales Revenue sum(SALE.SALE_TOTAL)

a) Select the class/folder:

1. Fan Objects

b) Select the Insert Object drop down

c) Select

1. Dimension

2. Measure

d) Change the Name:

Dimension Measure

Sale ID Sales Revenue

Continued on next page

54 © 2011 SAP AG. All rights reserved. 2012

Page 65: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using @AggregateAware to Resolve a 2-Table Fan Trap

Model ID

Note: In Model ID you have to set Data Type to Numeric

e) Click SQL Assistant

f) Enter the select:

Dimension Sale ID SALE.SALE_ID

Model ID SALE_MODEL.MODEL_ID

Measure SalesRevenue

SUM(SALE.SALE_TOTAL)

g) Click Validate

h) Click OK

8. Perform an Integrity Check on:- Tables- Joins- Business Layer

a) Right-click top level of Business Layer

b) Select Check Integrity

c) Select

• Tables• Joins• Business Layer

d) Click Check Integrity

e) Click OK

9. Save all changes.

a) Select File → Save All

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 55

Page 66: Boid20 en Col96 Fv Part Ltr

Unit 2: Advanced Use of the@Aggregate_Aware Function BOID20

10. Create a Query in the Business Layer to test the universe. Restrict the queryresults to Sale ID 1010.

a) From the Business Layer select “Query”

b) Click New

c) Create a query with the Sale ID and Sales Revenue objects.

d) Apply a query filter on Sale ID for 1010 by dragging Sale ID to the QueryFilter area and completing the query filter:Sale ID In list 1010

e) Click Refresh and note the results: Sales Revenue = 57,091.50

11. In the same query on the Business Layer, add the Model ID object to the ResultObjects area after the Sale ID in the Query Results area. Refresh the query andnote the results.

a) Drag theModel ID object to the left of the Sale ID object in the ResultObjects area

b) Click Refresh

12. What is the measure value?

a) Sales Revenue displays the 57,091.50 for each model, which is incorrect.

13. In the Information Design Tool on the Data Foundation tab create an Aliasof the Sales table.

a) Right-click the Sales table

b) Click Insert→ Alias Table…

c) Click OK

14. Join the new table to the Sale table and add the appropriate self join to the alias.

Continued on next page

56 © 2011 SAP AG. All rights reserved. 2012

Page 67: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using @AggregateAware to Resolve a 2-Table Fan Trap

Join Cardinality

SALE.SALE_ID=Alias_of_SALE.SALE_ID 1,n

Alias_of_SALE.SALE_TYPE =’S’ 1,1

a) Use drag and drop to create the following join:SALE.SALE_ID=Alias_of_SALE.SALE_ID

b) Double-click the join

c) Set the cardinality to 1,n

d) Click OK

e) Click Insert

f) Select Join

g) Add the expression: Alias_of_SALE.SALE_TYPE =’S’

h) Click Validate

i) Click Close

j) Set cardinality to 1,1

k) Click OK

15. In the Information Design Tool on the Data Foundation tab add the two contexts:- Sale Model- Alias_of_SALE

a) Under Aliases and Contexts click Detect Contexts…

b) Select both contexts

c) Click OK

16. Save the changes to the Data Foundation.

a) Click Save.

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 57

Page 68: Boid20 en Col96 Fv Part Ltr

Unit 2: Advanced Use of the@Aggregate_Aware Function BOID20

17. Modify the definition of the Sales Revenue object so that it is defined on thenew alias table.

a) Select the Business Layer

b) Select the Sales Revenue object

c) Edit the select to:@Aggregate_Aware(sum(SALE.SALE_TO-TAL),sum(Alias_of_SALE.SALE_TOTAL))

d) Click OK

Hint: Click Validate to check the syntax.

18. Make the Model ID incompatible with the SALE table.

a) Select Actions→ Set Aggregate Navigation . . .

b) Highlight the SALE table on the left of the pop-up

c) Open the class on the right of the pop-up and place a check mark next tothe Model ID object

d) Click OK

19. Save the changes to the Business Layer.

a) Click Save

20. Recreate the last query from Step 11.

a) From the Business Layer select Query

b) Select the Sale ID,Model ID, and Sales Revenue objects.

c) Drag the Sale ID object down into the Query Filter area

d) Complete the Query Filter:Sale ID In list 1010

e) Click Refresh

21. What is the Sales Revenue?

a) Sales Revenue = 57,091.50 as the total for the Sale ID

58 © 2011 SAP AG. All rights reserved. 2012

Page 69: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using @AggregateAware to Resolve a 2-Table Fan Trap

Lesson Summary

You should now be able to:• Use @AggregateAware to overcome the inefficiencies created when resolving

a 2-table fan trap

2012 © 2011 SAP AG. All rights reserved. 59

Page 70: Boid20 en Col96 Fv Part Ltr

Unit 2: Advanced Use of the@Aggregate_Aware Function BOID20

Lesson: Using @AggregateAware to Resolve anAmbiguous Outer Join

Lesson OverviewThis lesson explains how to use @AggregateAware to resolve issues surroundingouter joins when used in the Data Foundation of a universe.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Use @AggregateAware to resolve issues surrounding outer joins when usedin the Data Foundation of a universe

Business Example

Ambiguous Outer JoinsAs we have seen, the Information Design Tool supports outer joins on the datafoundation. Depending on the relational database management system (RDBMS),however, outer joins can create issues with WebIntelligence queries.

For example, consider the Motors universe we have been working with. The REGIONtable is joined to the CLIENT table which is joined to the SALES table. The problemthat can occur with some RDBMSs is that with the CLIENT table joined to the SALEtable, when a query uses data from all three tables, the query either may not run or mayreturn incorrect results if a Region does not have a Client because there can be no Sale.

Note: In SQL Server, which we are using in this class, there are no issues. InOracle, however, no null values are retrieved, and in some other databases, anambiguous outer join message appears.

60 © 2011 SAP AG. All rights reserved. 2012

Page 71: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using @AggregateAware to Resolve an Ambiguous Outer Join

If there are issues with the RDBMS used, there are two ways to resolve them:

1. Do not use outer joins in your data foundation. Obviously, this solution is notpractical if the end-users' reporting needs require blank rows to be returned.

2. Create an alias of the table where the outer join is required, and use@Aggregate_Aware in the relevant object(s) to identify which join path to takedepending on the objects used in the query.

Note: Depending on the RDBMS, the outer join placement may bedifferent.

To resolve an ambiguous outer join

1. Create an alias of the table where the data could be “missing” (the CLIENTtable in our Motors Business Layer).

2. Create a the same join between the alias table and the dimension table it is joinedto (REGION in our Motors Business Layer).

3. Set the cardinality and specify an outer join accordingly.4. Make the join between the dimension table and the original table that was

aliased an inner join.

Hint:

Figure 10: Sample data foundation with outer join between the REGION andCLIENT2 tables only

2012 © 2011 SAP AG. All rights reserved. 61

Page 72: Boid20 en Col96 Fv Part Ltr

Unit 2: Advanced Use of the@Aggregate_Aware Function BOID20

5. Change the SELECT clause of the objects from the original table that was aliasedusing @AggerateAware, the first choice referring to the alias table and thenthe original table.

6. Make any objects from the fact table joined to the original table that was aliasedincompatible with the alias table.

Note: Setting this incompatibility ensures that if a query includes objectsfrom all three tables, the alias table with the outer join will be used.As an example from the Motors Business Layer, if the query includesobjects from only the REGION and CLIENT tables, the Client2 tablewill be used instead of the Client table.

But if the query includes objects from all the tables, the original tablewith the inner join will be used. In our Motors Business Layer, theREGION, CLIENT, and SALE tables, the CLIENT table will be used.

62 © 2011 SAP AG. All rights reserved. 2012

Page 73: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using @AggregateAware to Resolve an Ambiguous Outer Join

Exercise 4: Resolve an Ambiguous OuterJoin

Exercise ObjectivesAfter completing this exercise, you will be able to:• Use @AggregateAware to resolve an ambiguous outer join.

Business ExampleYou need to provide outer join information to your end users, but because of therelational database you are using, an outer join in the middle of a path of joins onyour data foundation will produce an error in the end users' queries. You will use@AggregateAware to resolve this issue.

Task:1. Create a new Project and Data Foundation called AOJ_xx, where “xx” stands

for your user number. User the Motors connection.

2. Add the following tables to the Data Foundation:REGIONCLIENTSALE

3. Create the following joins and set the cardinalities:

Join Cardinality

REGION.REGION_ID=CLIENT.REGION_ID 1,n

CLIENT.CLIENT_ID=SALE.CLIENT_ID 1,n

SALE.SALE_TYPE=’S’ 1,1

4. Create an alias of the CLIENT table.

5. Join the new table to the REGION table and specify the join as an outer joinon the REGION table.

Join Cardinality

REGION.REGION_ID=Alias_of_CLIENT.RE-GION_ID

1,n

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 63

Page 74: Boid20 en Col96 Fv Part Ltr

Unit 2: Advanced Use of the@Aggregate_Aware Function BOID20

6. Create a Business Layer called AOJ_xx

7. Create a class:AOJ Objects

8. Add the following objects with the following syntax:

AOJ Objects class

Object Name Syntax

Region Name REGION.REGION_NAME

Client Last Name @Aggre-gate_Aware(Alias_of_CLIENT.CLIENT-LASTNAME, CLIENT.CLIENTLAST-NAME)

Sales Revenue sum(SALE.SALE_TOTAL)

9. Make the Sales Revenue object incompatible with the Alias_of_CLIENT table.

10. Perform an Integrity Check on:- Tables- Joins- Business Layer

11. Save all changes.

12. Create a Query in the Business Layer to test the universe.

13. In the same query on the Business Layer, add the Sales Revenue object to theResult Objects area.

64 © 2011 SAP AG. All rights reserved. 2012

Page 75: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using @AggregateAware to Resolve an Ambiguous Outer Join

Solution 4: Resolve an Ambiguous OuterJoinTask:1. Create a new Project and Data Foundation called AOJ_xx, where “xx” stands

for your user number. User the Motors connection.

a) Click New → Project.

Project Name: AOJ_xx

b) Click Finish

c) Add a Repository session

d) Browse the connection folder

e) Find the existing connection “Motors”

f) Right-click Motors connection → Create Relational ConnectionShortcut

g) Select AOJ_xx from the pop-up box

h) Click OK

i) Click Close to proceed

j) “Motors.cns” will appear under the local project

k) Click New→ Data Foundation

l) Resource Name: AOJ_xx

m) Next→ Single Source→ Next→ Select Motors.cns→ Finish

2. Add the following tables to the Data Foundation:REGIONCLIENTSALE

a) Select the Data Foundation tab.

b) Click on the “+” and click on Insert Tables.

c) Browse the tables under dbo.

d) Double-click the REGION, CLIENT and SALE tables under connections

e) Click Finish.

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 65

Page 76: Boid20 en Col96 Fv Part Ltr

Unit 2: Advanced Use of the@Aggregate_Aware Function BOID20

3. Create the following joins and set the cardinalities:

Join Cardinality

REGION.REGION_ID=CLIENT.REGION_ID 1,n

CLIENT.CLIENT_ID=SALE.CLIENT_ID 1,n

SALE.SALE_TYPE=’S’ 1,1

a) Drag the join between the columns of the tables

b) Double-click the join to display the properties

c) Click the cardinality drop-down to set the cardinality

For the self-join:

d) Insert → Insert Join

e) Set the Expression and cardinality

f) Click Validate

Note: Because we are using a SQL Server database for this course,there will be no ambiguous outer join, but we will proceed as ifthere would be a problem.

4. Create an alias of the CLIENT table.

a) Right-click the CLIENT table

b) Click Insert→ Alias Table…

c) Click OK

5. Join the new table to the REGION table and specify the join as an outer joinon the REGION table.

Join Cardinality

REGION.REGION_ID=Alias_of_CLIENT.RE-GION_ID

1,n

a) Use drag and drop to create the following join: REGION.RE-GION_ID=Alias_of_CLIENT.REGION_ID

b) Double-click the join

c) Set the cardinality to 1,n

Continued on next page

66 © 2011 SAP AG. All rights reserved. 2012

Page 77: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using @AggregateAware to Resolve an Ambiguous Outer Join

d) Check the Outer Join box under the REGION table

e) Click OK.

f) Click Save.

6. Create a Business Layer called AOJ_xx

a) Select the project

b) Click New→ Business Layer

c) Select Relational Data Source→ Next

d) Name the Business Layer AOJ_xx→ Next

e) Select “…” to select the Data Foundation

f) Select AOJ_xx→ Click OK

g) Deselect “Automatically create classes and objects” option

h) Click Finish

7. Create a class:AOJ Objects

a) Select the top level of the Business Layer

b) Click the Insert Object drop down

c) Select Folder

d) Change name to AOJ Objects

8. Add the following objects with the following syntax:

AOJ Objects class

Object Name Syntax

Region Name REGION.REGION_NAME

Client Last Name @Aggre-gate_Aware(Alias_of_CLIENT.CLIENT-LASTNAME, CLIENT.CLIENTLAST-NAME)

Sales Revenue sum(SALE.SALE_TOTAL)

a) Select the class/folder:

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 67

Page 78: Boid20 en Col96 Fv Part Ltr

Unit 2: Advanced Use of the@Aggregate_Aware Function BOID20

1. Fan Objects

b) Select the Insert Object drop down

c) Select

1. Dimension

2. Measure

d) Change the Name:

Dimension Measure

Region Name Sales Revenue

Client Last Name

e) Click SQL Assistant

f) Enter the select:

Dimension RegionName

REGION.REGION_NAME

Client LastName

@Aggre-gate_Aware(Alias_of_CLIENT.CLIENT-LASTNAME, CLIENT.CLIENTLAST-NAME)

Measure SalesRevenue

SUM(SALE.SALE_TOTAL)

Note: The @Aggregate_Aware makes the Business Layer awarethat there is an alternative for obtaining the data, depending on theobjects used in the query.

g) Click Validate

h) Click OK

Continued on next page

68 © 2011 SAP AG. All rights reserved. 2012

Page 79: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using @AggregateAware to Resolve an Ambiguous Outer Join

9. Make the Sales Revenue object incompatible with the Alias_of_CLIENT table.

a) Select Actions→ Set Aggregate Navigation . . .

b) Highlight the Alias_of_CLIENT table on the left of the pop-up

c) Open the class on the right of the pop-up and place a check mark next tothe Sales Revenue object

d) Click OK

10. Perform an Integrity Check on:- Tables- Joins- Business Layer

a) Right-click top level of Business Layer

b) Select Check Integrity

c) Select

• Tables• Joins• Business Layer

d) Click Check Integrity

e) Click OK

11. Save all changes.

a) Select File → Save All

12. Create a Query in the Business Layer to test the universe.

a) From the Business Layer select “Query”

b) Click New

c) Create a query with the Region Name and Client Last Name objects.

d) View the SQL script and notice which table is used to pull the Client LastName data: Alias_of_CLIENT

13. In the same query on the Business Layer, add the Sales Revenue object to theResult Objects area.

a) Double-click the Sales Revenue object

b) View the SQL script and notice which table is used to pull the Client LastName data: CLIENT

2012 © 2011 SAP AG. All rights reserved. 69

Page 80: Boid20 en Col96 Fv Part Ltr

Unit 2: Advanced Use of the@Aggregate_Aware Function BOID20

Lesson Summary

You should now be able to:• Use @AggregateAware to resolve issues surrounding outer joins when used

in the Data Foundation of a universe

70 © 2011 SAP AG. All rights reserved. 2012

Page 81: Boid20 en Col96 Fv Part Ltr

BOID20 Unit Summary

Unit SummaryYou should now be able to:• Learn how you can use @AggregateAware to resolve 2-table fan traps• Learn how you can use @AggregateAware to resolve ambiguous outer join issues• Use @AggregateAware to overcome the inefficiencies created when resolving

a 2-table fan trap• Use @AggregateAware to resolve issues surrounding outer joins when used

in the Data Foundation of a universe

2012 © 2011 SAP AG. All rights reserved. 71

Page 82: Boid20 en Col96 Fv Part Ltr

Unit Summary BOID20

72 © 2011 SAP AG. All rights reserved. 2012

Page 83: Boid20 en Col96 Fv Part Ltr
Page 84: Boid20 en Col96 Fv Part Ltr
Page 85: Boid20 en Col96 Fv Part Ltr

Unit Summary BOID20

73 © 2011 SAP AG. All rights reserved. 2012

Page 86: Boid20 en Col96 Fv Part Ltr

Unit Summary BOID20

74 © 2011 SAP AG. All rights reserved. 2012

Page 87: Boid20 en Col96 Fv Part Ltr

Unit 3Creating Universes from Different Data

Sources

Unit OverviewThe universe access list continues to grow as the variety of data sources evolve incustomer environments.

Using the Information Design Tool, you can create a universe from multiple datasources.

After completing this unit, you will be able to:

• Work with OLAP universes• Create a multisource universe

Unit ObjectivesAfter completing this unit, you will be able to:

• Identify the two primary sources for creating a universe• Describe what an OLAP cube is• Create and maintain an OLAP universe• Describe a multi-source universe• Create and maintain a multi-source universe

Unit ContentsLesson: Creating Universes from Different Data Sources... . . . . . . . . . . . . . . . . . . . 76Lesson: Creating an OLAP Universe... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

Exercise 5: Create an OLAP Universe ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85Lesson: Creating a Multisource Universe ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

Exercise 6: Create a Relational Multi-source Universe between a SQLServer Database and an Excel Spreadsheet .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95Exercise 7: Create a Relational Multi-source Universe between a SQLServer Database and an Access Database ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103

2012 © 2011 SAP AG. All rights reserved. 75

Page 88: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

Lesson: Creating Universes from Different Data Sources

Lesson OverviewThe universe access list continues to grow as the variety of data sources evolvein customer environments. This accessibility creates even more robust reportingcapabilities as universes can be created for many data sources.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Identify the two primary sources for creating a universe

Business Example

Data Sources for UniversesMost organizations have a variety of data sources serving a variety of differentpurposes. Many of those data sources, however, can be used for end-user reporting. Inaddition to a relational data source, the Information Design Tool allows you to create auniverse from a number of different data sources:

• OLAP Cubes• XML metadata files• Stored Procedures• A combination of these data sources

In this unit, we will see how to create a universe on the most common data sourcesat this time: an OLAP cube and multiple data sources.

76 © 2011 SAP AG. All rights reserved. 2012

Page 89: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating Universes from Different Data Sources

Lesson Summary

You should now be able to:• Identify the two primary sources for creating a universe

2012 © 2011 SAP AG. All rights reserved. 77

Page 90: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

Lesson: Creating an OLAP Universe

Lesson OverviewAn OLAP universe is a SAP BusinessObjects universe that has been generated froman OLAP cube or query. The Business Layer is created automatically from a selectedOLAP Connection.

Once the universe has been created it can be exported to the Central ManagementSystem (CMS) as any other universe, and is then available to Web Intelligence usersto run queries and create reports.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Describe what an OLAP cube is• Create and maintain an OLAP universe

Business Example

Understanding OLAP UniversesOn Line Analytical Processing, or OLAP allows end users to get concise answers tobusiness questions such as:“Show me the sales generated during a specified period,for a specified product in a specified location less than a specified amount”.

78 © 2011 SAP AG. All rights reserved. 2012

Page 91: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating an OLAP Universe

Figure 11: Sample OLAP cube

Using OLAP, a user can quickly narrow or expand the scope of a business question.For example, in the scenario illustrated above, the sales for a single product, a groupof products, or many products can be displayed. In a traditional relational reportingsystem, each of these questions would require a separate relational query to summarizehistorical data which, when the volume of transactions is high, can take a long time toproduce the desired results. By comparison, comparable queries in an OLAP sourcecan deliver answers with a better response time.

The power of an OLAP source is its ability to quickly and dynamically summarizedata by a variety of dimensions. In addition, an OLAP source provides a powerfulcalculation engine which supports ad hoc analysis to extend the value of theinformation beyond the data physically stored in the OLAP database.

Dimensions

An OLAP source is constructed from multiple components.

2012 © 2011 SAP AG. All rights reserved. 79

Page 92: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

Figure 12: OLAP dimensions

In the example shown above, Location, Product, and Time are the “Dimensions”.Dimensions define the numerical data under analysis. For example, knowing thatthere are $1 million in sales is not meaningful until you put this amount in contextwith one or more dimensions. Is this sales amount for one month or for one product,or is it the annual sales for all products in a single city?

A dimension is comprised of representative values, or “Members”. Atlanta is amember of the Location dimension in the example above. When you query anOLAP source, you select one or more members of a dimension or you can choose tosummarize all members of a dimension. For example, you can select a particularlocation or you can summarize all locations. When the design of a dimension allowsthis type of summarization, a special type of member known as the “All Member” isavailable to provide a summarized value for the members of that dimension.

Members can be organized into multiple “levels”. Time is a dimension whichcommonly contains many levels, often Year, Quarter, and Month. Depending onanalytical requirements, this dimension can also include Week, Day, and even Hourand Minutes. Levels organize a dimension into a hierarchy with the most summarizedvalues at the top and the most detailed values at the bottom. In the example above,Q1, Q2, Q3, and Q4 are all members of the Quarter level of the Time dimension,while Jan and Feb are members of the Month level of the same dimension. When youquery an OLAP source, levels allow you to drill up or down a dimension to viewsummary or detailed data.

Measures

80 © 2011 SAP AG. All rights reserved. 2012

Page 93: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating an OLAP Universe

Dimensions form the sides, or axes, of a cube. The cube cells represent the intersectionof each dimension member with members of all other dimensions. Containedwithin each cell is the “Measure”, which is the numerical data being analyzed andsummarized. A cube can contain one or more measures.

Generating universes from OLAP cube sourcesThe Business Layer of an OLAP universe is created automatically from an OLAPConnection.

Note: OLAP universes support a single cube in the universe.

OLAP structures are mapped directly to classes, measures, dimensions, details, andfilters in the Business Layer. A very unique aspect of an OLAP universe is that hereis no Data Foundation. The universe consists of only the OLAP Connection andthe Business Layer.

You can use the Information Design Tool to create OLAP universes from the followingOLAP data sources:

• Microsoft Analysis Services 2005• Microsoft Analysis Services 2008

Once the Business Layer has been created, it can be exported to the centralmanagement server (CMS) as any other universe. The universe is then available toWeb Intelligence and Web Intelligence Rich Client users to run queries and createreports as well as to other applications that can access universes such as Dashboards4.x and Crystal Reports.

2012 © 2011 SAP AG. All rights reserved. 81

Page 94: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

To create a universe from an OLAP cube

1. Open the Information Design Tool.2. Create a new OLAP connection in a Project by right-clicking on the Project and

selecting New > OLAP Connection.3. The Resource Name Wizard opens.

Name the Connection.

4. Click Next.5. Expand the appropriate database node that supports the data access driver to the

relevant OLAP data source.6. Expand the appropriate middleware node that supports the data access driver to

the relevant OLAP data source.7. Select the appropriate data access driver to the relevant OLAP data source, and

click Next.8. In the Login Parameters window, fill in the appropriate authentication mode

and login details to connect to your OLAP data source, and click Next.9. The Catalog/Database parameters window displays the available OLAP

cubes. Expand the OLAP Cubes node and select the appropriate OLAP cubeto connect to.

10. Click Next and click Finish to complete defining the OLAP connection.11. Create a new Business Layer in the Project by right-clicking on the Project and

selecting New > Business Layer.12. The New Business Layer Wizard opens.13. Select OLAP Data Source as the connection type and click Next.14. Type a name and description for the Business Layer.15. Click the ellipses button and choose the appropriate OLAP connection. Check

the appropriate automatic generation options as applicable.

The Business Layer is generated. This may take a few minutes depending on the cubesize. OLAP structures are mapped directly to classes, measures, dimensions, details,and filters in the universe. There is no Data Foundation.

The Business Layer automatically creates dimensions and attributes, but that they arenot organized into folders. Only the measures are in folders, but each measure is inits own folder. As the universe designer, you should “clean up” the Business Layerto make it user-friendly for your end-users. This process entails creating classes forthe dimensions, attributes, and measures, just as you would in a Business Layer thatuses a Data Foundation based on a Relational Connection. The dimensions, attributes,and measures that are automatically generated should be moved, deleted, rearranged,and/or hidden according to the end-user requirements.

82 © 2011 SAP AG. All rights reserved. 2012

Page 95: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating an OLAP Universe

Modifying and updating an OLAP universeOnce the Business Layer has been automatically generated, designers are able tomake the following types of modifications:

• Hide, duplicate, and rename classes and objects (dimension, detail, and measure)• Insert new classes and objects (dimension, detail, and measure).• Edit an object's format.• Edit an object's data type (character and number only).• Use universe functions (@variable, @select, @prompt) .• Create a cascading list of values.• Define a delegate search for a list of values, allowing users to limit loading

of the list of values at query run time.• Define measures with database delegated projection function (delegated

measures).• Create calculated measures.• Run the Check Integrity or Parse tools at any time.• Parse dimension, detail, and measure object MDX syntaxes.• Create predefined conditions/filters.• Define optional prompts.

The following features are not supported for OLAP universes:

• You cannot set row-level security authorizations in an OLAP universe.• You cannot edit a list of values in an OLAP universe.

Delegated measures

OLAP cube aggregation is supported in the Information Design Tool with delegatedsmart measures. A delegated measure is a measure that delegates its aggregationcalculation to the database. For OLAP universes, this allows the universe designer touse the cube aggregation calculated in the OLAP source.

Web Intelligence reporting and layout workflows now work seamlessly on OLAPsources regardless of the nature of the measure. This greatly eases the user experienceby simplifying workflows and reducing inconsistent results.

Note: All measures generated in OLAP universes are defined as delegatedmeasures.

Calculated measures in OLAP universes

2012 © 2011 SAP AG. All rights reserved. 83

Page 96: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

Calculated measures allow universe designers to create their own measures manually.In order to create calculated measures, designers create an MDX expression using theMDX assistant. Information Design Tool functions are allowed in calculated measureexpressions, for example:

• @select• @prompt• @variable

The check integrity validates the XML syntax and any of the @Functions.

The Information Design Tool also supports constants in the expression such as:“10” and “ABC”.

The Refresh Business Layer Wizard

The Refresh Business Layer Wizard allows you to manage the life cycle of theOLAP universe. The wizard automatically refreshes the universe structure withchanges made in the OLAP data source. The wizard compares the universe withthe updated data source, and can differentiate generated objects from objects addedor modified manually, allowing you to preserve the manual changes made with theInformation Design Tool.

To refresh the structure of an OLAP universe

1. Select the OLAP Business Layer you want to update.2. Select Actions→ Refresh Structure.

The Refresh Business Layer Wizard appears.

3. Select the desired options.4. Select the update actions you want to apply to the Business Layer.5. Click Finish

84 © 2011 SAP AG. All rights reserved. 2012

Page 97: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating an OLAP Universe

Exercise 5: Create an OLAP Universe

Exercise ObjectivesAfter completing this exercise, you will be able to:• Create an OLAP Connection• Create an OLAP Universe

Business Example

Task:The end users want to be able to report against data held in an OLAP data source.

1. Create a project and a connection to the required OLAP data source using thefollowing details:

Authentication modeUsed

Secified name and password

Server http://wdflbmt2268:1080/olap/msmdpump.dll

User name train-olap

Password Welcome

Language English (United States)

2. Create a Business Layer called My OLAP Business Layer_xx, where “xx””stands for your user number.

3. Save all changes.

4. Create a Query in the Business Layer to test the universe.

2012 © 2011 SAP AG. All rights reserved. 85

Page 98: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

Solution 5: Create an OLAP UniverseTask:The end users want to be able to report against data held in an OLAP data source.

1. Create a project and a connection to the required OLAP data source using thefollowing details:

Authentication modeUsed

Secified name and password

Server http://wdflbmt2268:1080/olap/msmdpump.dll

User name train-olap

Password Welcome

Language English (United States)

a) Click File→ New→ Project. Name the ProjectMy OLAP Resources_xxwhere “xx”” stands for your user number.

b) Click Finish.

c) Right-click on your project and select New→ OLAP Connection to createan OLAP connection

d) In the Resource Name text box, typeMy OLAP Connection_xx→ Next,where “xx”” stands for your user number.

e) In the hierarchical list expand the Microsoft Analysis Services 2005branch and select Xmla→ Next

f) Enter the following parameters:

Authentication modeUsed

Specified name and password

Server http://wdflbmt2268:1080/olap/msmd-pump.dll

User name train-olap

Password Welcome

Language English (United States)

Continued on next page

86 © 2011 SAP AG. All rights reserved. 2012

Page 99: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating an OLAP Universe

Click Next

Note: Allow a few seconds for the IDT to display all the foldersand cubes.

g) Expand the Adventure Works DW folder and select the AdventureWorks cube . Click Finish

h) In the Local Project view expandMy OLAP Resources . Right-click onthe connection and choose Publish Connection to a Repository. Enterthe credentials for the repository and click Next

i) Select the folder to which the connection to be published (Select the rootfolder in this case)

j) Click on Finish to publish the connection

k) Click on Yes to create a shortcut in the project

l) Click on Close

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 87

Page 100: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

2. Create a Business Layer called My OLAP Business Layer_xx, where “xx””stands for your user number.

a) Right-click the project

b) Select New→ Business Layer

c) Select OLAP Data Source→ Next

d) Name the Business LayerMy OLAP Business Layer_xx→ Next

e) Select ... to select the OLAP connection

f) SelectMy OLAP Connection_xx→ Click OK

g) Check the boxes Detect measure aggregation function and Createattribute from technical name.

h) Click Next. Note that you can choose which dimensions and measures fromthe cube you wish to be part of your Business Layer. For this Exercise, donot change any default check marks.

i) Click Finish

Note: At this point, as a best practice, you should “clean up”the Business Layer by creating classes for the dimensions,attributes, and measures, just as you would in a Business Layerthat uses a Data Foundation based on a Relational Connection.The dimensions, attributes, and measures that are automaticallygenerated should be moved, deleted, rearranged, and/or hiddenaccording to the end-user requirements. We will not take the timeto perform this task in this exercise, but do remember that it is aBest Practice.

3. Save all changes.

a) Select File → Save All

4. Create a Query in the Business Layer to test the universe.

a) From the Business Layer select “Query”

b) Click New

c) Create a query with the Sales Order Number object from the SalesSummary Order Details dimension and the Sales Amount objects fromthe Sales Summary class.

d) Click Refresh and note the results

88 © 2011 SAP AG. All rights reserved. 2012

Page 101: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating an OLAP Universe

Lesson Summary

You should now be able to:• Describe what an OLAP cube is• Create and maintain an OLAP universe

2012 © 2011 SAP AG. All rights reserved. 89

Page 102: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

Lesson: Creating a Multisource Universe

Lesson OverviewA Multi-source universe is one that utilizes more than one data foundation for thebusiness layer. This lesson explains how to create a multi-source universe.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Describe a multi-source universe• Create and maintain a multi-source universe

Business ExampleYour organization has many different data sources, all of which provide valid reportinginformation. You wish to create one universe that utilizes two of these sources so thatthe end-users do not need to create separate queries for each data source.

Understanding a Multi-Source UniverseA multi-source universe is simply one single data foundation and business layer of auniverse that utilizes more than one data connection. This capability allows universedesigners to create a single universe that accesses data in multiple data sources,including relational data sources, SAS, and SAP BW.

Creating and Maintaining a Multi-Source UniverseCreating and maintaining a multi-source universe is no different than creating asingle-source dimensional universe. You simply use more than one connection foryour data foundation. You can add connections when you create the data foundationand anytime later. However, multisource-enabled data foundations support onlysecured connections, and universes based on this type of data foundation can only bepublished to a repository.

About multisource-enabled data foundations

90 © 2011 SAP AG. All rights reserved. 2012

Page 103: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating a Multisource Universe

Multisource-enabled data foundations support most relational connections that asingle-source data foundation uses. In addition, multisource-enabled data foundationssupport the following relational connections that are not supported in single-sourcedata foundations:

• SAP NetWeaver BW connections• SAS connections

SQL-92 standard syntax is the default for any calculated columns, derived tables, andjoin expressions used in the data foundation. In addition, the SAP BusinessObjectsSQL functions are available.

You can use database-specific SQL syntax in a multisource-enabled data foundationby defining a database-specific derived table or calculated column. Database-specificSQL syntax allows functions or operators that are offered by a specific database andnot by standard SQL-92 (for example, Oracle analytical functions).

Multisource-enabled data foundations are required in the following situations:

• You want to insert tables and joins from more than one relational data source.• You want to use SAP NetWeaver BW or SAS connections.• You want to use SQL-92 standard syntax and SAP BusinessObjects SQL

functions.

Data foundations with multiple connections

To be able to add multiple connections to a data foundation, you must select theMultisource-Enabled connection type when you create the data foundation. Youcan then select multiple for the data foundation. You can also add connections to anexisting multisource-enabled data foundation.

2012 © 2011 SAP AG. All rights reserved. 91

Page 104: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

Connections must be secured, and therefore available in a repository. The connectionsare represented by a connection shortcut in the local project. The connections in amultisource-enabled data foundation have the following additional properties:

• A short name used to identify the connection in the data foundation and tomodify the table name in SQL expressions. You specify the short name whenadding the connection. This name must be unique within the data foundation andis limited to forty characters. If you change the short name for the connection,the SQL expressions are automatically updated with the new name.

• A color for the connection. This color is used in the table header in datafoundation views. You select the color when adding the connection. You canchange the color for a connection at any time. This color-coding assists inkeeping track of what tables are from which data source.

• A catalog used to identify the connection to the query server. A defaultcatalog name is registered automatically with the query server the first time theconnection is added to any multisource-enabled data foundation.

• For SAP NetWeaver BW connections, properties related to the automaticinsertion of tables and joins.

In a multisource-enabled data foundation, the table name as it appearsin SQL expressions has the format: <@catalog(short name)."database_qualifier.database_owner".table_name>. A multi-source join can be created betweentables from different connections. You can use the Detect Joins command to detectjoins between tables referenced in different connections, or explicitly define themwith the Insert Join command.

Multi-source enabled data foundations with a SAP NetWeaver BW connection

92 © 2011 SAP AG. All rights reserved. 2012

Page 105: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating a Multisource Universe

When you add a SAP NetWeaver BW connection to a multisource-enabled datafoundation, tables and joins are automatically inserted. The automatic insertion doesthe following:

• Based on the InfoProvider specified in the SAP NetWeaver BW connectionparameters, inserts the fact table and its related master data and text tables.

• Creates families for each type of table:

- Prefixes the fact table name by the letter I (InfoCube) and assigns it to family"InfoProvider Fact Table".

- Prefixes master data tables by the letter D (Dimension) and assigns themto family "Dimension Table".

- Prefixes text tables by the letter T (Text) and assigns them to family "TextTable".

• Creates alias tables for all dimension and text tables.• Detects and inserts table keys.• Detects and inserts joins.• Creates input columns in tables when needed, to handle time-dependent data.

Creates a parameter in the data foundation called key date. By default, at querytime, the key date parameter is not prompted. It is automatically assigned thecurrent date.

SQL expressions in multisource-enabled data foundations

SQL expressions that define joins, calculated columns, and derived tables in amultisource-enabled data foundation use SQL-92 AINSI standard syntax. In SQL-92expressions, you can include SAP BusinessObjects SQL functions and @functions.Which @functions you can include depends on the type of expression.

In order to use functions or operators that are offered by the database and not bySQL-92 (for example, Oracle analytical functions), you define database-specificcalculated columns and derived tables. A check box in the SQL Expression Editorallows you to use database-specific SQL. Database-specific calculated columns andderived tables support the SQL syntax of the associated connection.

The following rules apply to database-specific SQL expressions:

• You can reference only standard tables and database-specific derived tablesin a single connection.

• You cannot reference tables in SAS or SAP NetWeaver BW connections.• You can include @functions with certain restrictions. See the “Information

Design Tool User's Guide” for more details.

2012 © 2011 SAP AG. All rights reserved. 93

Page 106: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

To create a multi-source universe

1. Open the Information Design Tool.2. Create secured relational connections in a Project or create shortcuts to secured

relational connections.3. Create a new Data Foundation containing the necessary tables from each

connection as well as joining the tables appropriately, resolving any loops orSQL traps that may occur.

4. Create a new Business Layer in the Project, choosing the multi-source DataFoundation.

5. Create the appropriate classes and objects the meet the end users' reportingrequirements.

94 © 2011 SAP AG. All rights reserved. 2012

Page 107: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating a Multisource Universe

Exercise 6: Create a Relational Multi-sourceUniverse between a SQL Server Databaseand an Excel Spreadsheet

Exercise ObjectivesAfter completing this exercise, you will be able to:• Create a relational multi-source connection• Create a relational multi-source Data Foundation• Create a relational multi-source Business Layer

Business ExampleYour end users need to report on information about phone calls that customers havemade at a customer support organization. They want to know who called, how manytimes, and the customer satisfaction. The information on the calls is stored in a SQLserver database, but the customer satisfaction is stored in an Excel spreadsheet. Youneed to create a single universe that allows the end users to access the information inboth data sources.

Task:In the following exercise you will use connections which are created on a SQL ServerDatabase and an Excel Workbook. In the next step you will create a data foundationbased on those two connections, and finally you will create a business layer on topof this data foundation.

1. Create a project called Multisource Universes_xx, where xx stands for your usernumber and add two connections: Warehouse Excel and SQL Warehouse_xx.

2. Disable automatic detections

3. Create a new Data Foundation based on the two connections created above andadd the appropriate tables.

4. Join the inserted tables

5. Create the multi-source Business Layer

6. Create the folders:- Customer- Product- Customer Calls

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 95

Page 108: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

7. Add the objects which will describe the Customers.

8. Add the objects which will describe the Products.

9. Add the object for the Customer Calls

10. Save the Business Layer.

11. Test the results.

96 © 2011 SAP AG. All rights reserved. 2012

Page 109: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating a Multisource Universe

Solution 6: Create a Relational Multi-sourceUniverse between a SQL Server Databaseand an Excel SpreadsheetTask:In the following exercise you will use connections which are created on a SQL ServerDatabase and an Excel Workbook. In the next step you will create a data foundationbased on those two connections, and finally you will create a business layer on topof this data foundation.

1. Create a project called Multisource Universes_xx, where xx stands for your usernumber and add two connections: Warehouse Excel and SQL Warehouse_xx.

a) Click New → Project.

Project Name: Multisource Universes_xx

b) Click Finish

c) Add a Repository session with the logon credentials:

System: wdflbmt2268

User name: train-##

Password train-##

Authentication Mode Enterprise

d) Browse the connections folder and find the connection nameWarehouseExcel

e) Right-click on the connection → Select Create Relational ConnectionShortcut

f) From the pop-up select the ProjectMultisource Universes_xx and clickOK.

g) Click Close when asked to create a shortcut

h) Right-click on your project and select New → Relational Connection.Name it SQL Warehouse_xx and click Next

i) Select Microsoft → MS SQL Server 2005 → OLE DB Providers .Click Next.

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 97

Page 110: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

j) Enter the following credentials:

User name guest

Password bobobo

Server wdflbmt2268

Database Warehouse

k) Click Test Connection . Click Finish

l) In your local project, right-click the created connection. Select PublishConnection to a Repository. Choose the Connections folder on therepository. Click Next and then Finish

m) Click Yes to Create a shortcut connection

n) Click on Close

o) In your local project, right-click the SQL Warehouse_xx.cnx and Delete.

Note: Make sure that in your local project two cns connectionsexist: Warehouse Excel.cns and SQL Warehouse_xx.cns

2. Disable automatic detections

a) On the main menu bar chooseWindow→ Preferences

b) In the next window select Information Design Tool→ Data FoundationEditor → Detections

Note: Make sure that both Detect Keys and Detect Joins areunchecked

c) Press OK and close the Preferences dialog

Continued on next page

98 © 2011 SAP AG. All rights reserved. 2012

Page 111: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating a Multisource Universe

3. Create a new Data Foundation based on the two connections created above andadd the appropriate tables.

a) Right-click on your project and select Insert Data Foundation. Name it:MSU DF_xx. Click Next. ChooseMulti-source Enabled. Click Next

b) You will be prompted select a BI 4.0 server session. Since we are alreadyconnected, click Next

c) Check the boxes next to each connection in your project. Click Next.

d) Click Next for the color option for each connection.

e) Click Finish

f) If not already open, double-click on your Data Foundation in the LocalProjects view to open the editor

Note: In the data sources, we are searching for information aboutphone calls that customers have made at a customer supportorganization. We want to know who called, how many times andthe customer satisfaction. The information on the calls is storedon the SQL server database (CUSTOMERCALLS fact table).Some information on the customer is available on the SQL server(CustomerDim table) but the customer satisfaction is stored onEXCEL (CUST_SATISFY_TB$ table). All the period informationis stored on EXCEL (PRODUCT_TB$table). We will link thefacts coming from SQL server with the dimensional data storedin EXCEL.

g) Click “+” on the Master area and select Insert Tables

h) Expand the connection SQL_WAREHOUSE

i) Expand theWarehouse.dbo node.

j) Check mark dimCustomer and CUSTOMERCALLS tables

k) Expand the connectionWAREHOUSE_EXCEL

l) Check mark CUST_SATISFY_TB$ and PRODUCT_TB$ tables

m) Click Finish

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 99

Page 112: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

4. Join the inserted tables

a) Click on the “+” on the Master area and select Insert Join

b) Select the tables and add the following joins:@catalog('SQL_WAREHOUSE')."Warehouse.dbo"."CUSTOMERCALLS"."CUSTOMERID"=@catalog

('SQL_WAREHOUSE')."Warehouse.dbo".dimCustomer."CustomerID" (n,1)

@catalog('WAREHOUSE_EXCEL')."PUBLIC"."CUST_SATISFY_TB$"."PERIODID" =

@catalog('SQL_WAREHOUSE')."Warehouse.dbo"."CUSTOMERCALLS"."PERIODID"

AND

@catalog('WAREHOUSE_EXCEL')."PUBLIC"."CUST_SATISFY_TB$"."CUSTOMERID"

= @catalog('SQL_WAREHOUSE')."Warehouse.dbo"."CUSTOMERCALLS"."CUSTOMERID" (1,1)

@catalog('WAREHOUSE_EXCEL')."PUBLIC"."PRODUCT_TB$"."ProductID"=@catalog

('SQL_WAREHOUSE')."Warehouse.dbo"."CUSTOMERCALLS"."PRODUCTID" (1,n)

c) Save your changes.

5. Create the multi-source Business Layer

a) Right-click your project and select folder Insert→ Business Layer→Relational Data Source→ Next

b) Name it MSU BL_xx

c) Click Next

d) Select the Data Foundation you created previously (MSU DF_xx.dfx)

Note: Make sure you UNCHECK the box:Automatically create classes and objects for all connections

e) Click Finish

6. Create the folders:- Customer- Product

Continued on next page

100 © 2011 SAP AG. All rights reserved. 2012

Page 113: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating a Multisource Universe

- Customer Calls

a) Select the top level of the Business Layer

b) Click the Insert Object drop down

c) Select Folder

d) Change name to Customer

e) Repeat for the other two folders

7. Add the objects which will describe the Customers.

a) Drag the following columns into the Customer folder you just created:dimCustomer.CompanynamedimCustomer.Countryname

b) Double-click on each of them and rename them as follows:CompanyName > CompanyCountryName > Country

8. Add the objects which will describe the Products.

a) Drag the following columns into the Product folder you just created:Product_TB$.ProductnameProduct_TB$.Categoryname

b) Rename the objects which have been created as:Productname > ProductCategoryname > Category

9. Add the object for the Customer Calls

a) Drag the following column to the Customer Calls folder:CUSTOMERCALLS.nbcalls

b) Change the Select statement to sum(CUSTOMERCALLS.nbcalls). Be sureto validate the SQL.

c) Rename the object Number of Calls and qualify it as a measure byright-clicking the object and selecting Turn into measure(s)

10. Save the Business Layer.

a) Save the Business Layer

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 101

Page 114: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

11. Test the results.

a) On the bottom left of the Business Layer editor select the Queries panel.Click the Insert Query button

b) In the query panel drag the objects Customer Name, Product Name andNumber of calls

c) Refresh the query

Note: Note the results

102 © 2011 SAP AG. All rights reserved. 2012

Page 115: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating a Multisource Universe

Exercise 7: Create a Relational Multi-sourceUniverse between a SQL Server Databaseand an Access Database

Exercise ObjectivesAfter completing this exercise, you will be able to:• Create a relational multi-source connection• Create a relational multi-source Data Foundation• Create a relational multi-source Business Layer

Business ExampleYour end users need to report on information about the number of customers and thenumber of employees in various regions. The information on the customers is storedin a SQL server database, but the information on the employees is stored in an Accessdatabase. You need to create a single universe that allows the end users to access theinformation in both data sources.

Task:In the following exercise you will use connections which are created on a SQL Serverdatabase and an Access database. In the next step you will create a data foundationbased on those two connections, and finally you will create a business layer on topof this data foundation.

1. Create a project called CrossOver_xx, where xx stands for your user number andadd shortcuts to two connections: Motors and estaff.

2. Disable automatic detections

3. Create a new Data Foundation based on the two connections created above andadd the appropriate tables.

4. Join the inserted tables

5. Create the multi-source Business Layer

6. Create the folders:- Customer- Staff

7. Add the objects which will describe the Customers.

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 103

Page 116: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

8. Change the Client ID to a measure that counts the client ids and rename theobject Number of Clients.

9. Add the objects which will describe the Staff.

10. Change the Personnel Number to a measure that counts the personnel numbersand rename the object Number of Employees.

11. Save the Business Layer.

12. Test the results.

104 © 2011 SAP AG. All rights reserved. 2012

Page 117: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating a Multisource Universe

Solution 7: Create a Relational Multi-sourceUniverse between a SQL Server Databaseand an Access DatabaseTask:In the following exercise you will use connections which are created on a SQL Serverdatabase and an Access database. In the next step you will create a data foundationbased on those two connections, and finally you will create a business layer on topof this data foundation.

1. Create a project called CrossOver_xx, where xx stands for your user number andadd shortcuts to two connections: Motors and estaff.

a) Click New → Project.

Project Name: CrossOver_xx

b) Click Finish

c) Add a Repository session with the logon credentials:

System: wdflbmt2268

User name: train-##

Password train-##

Authentication Mode Enterprise

d) Browse the connections folder and find the connection nameMotors

e) Right-click on the connection → Select Create Relational ConnectionShortcut

f) From the pop-up select the CrossOver_xx project.

g) Click OK and Close when asked to create a shortcut

h) Browse the connections folder and find the connection name estaff

i) Right-click on the connection→ Select Create Relational ConnectionShortcut

j) From the pop-up select the CrossOver_xx Project

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 105

Page 118: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

k) Click OK and Close when asked to create a shortcut

2. Disable automatic detections

a) On the main menu bar chooseWindow→ Preferences

b) In the next window select Information Design Tool→ Data FoundationEditor → Detections

Note: Make sure that both Detect Keys and Detect Joins areunchecked

c) Press OK and close the Preferences dialog

3. Create a new Data Foundation based on the two connections created above andadd the appropriate tables.

a) Right-click the CrossOver_xx project and select New→ Data Foundation.Name it: CrossOver_xx. Click Next. ChooseMulti-source Enabled.Click Next

b) You will be prompted select a BI 4.0 server session. Since you are alreadyconnected, click Next

c) Check the boxes next to each connection in your project. Click Next.

d) Click Next for the color option for each connection.

e) Click Finish

f) If not already open, double-click on your Data Foundation in the LocalProjects view to open the editor

g) Right-click anywhere in the Master area and select Insert → Tables.

h) Expand the connectionMotors

i) Expand theMotors.dbo owner

j) Select REGION and CLIENT tables

k) Expand the connection estaff

l) Expand the PUBLIC owner

m) Check mark Stores and Employee tables

n) Click Finish

Continued on next page

106 © 2011 SAP AG. All rights reserved. 2012

Page 119: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating a Multisource Universe

4. Join the inserted tables

a) Click on the “+” on the Master area and select Insert Join

b) Add the following joins:CLIENT.REGION_ID=REGION.REGION_ID (n,1)

REGION.REGION_NAME=Stores.Region (1,1)

Stores.Store Code=Employee.Store Code (1,n)

Note: The join between the REGION and the Stores table is notlogically correct as there are different values for the regions ineach table. But there are a few values that are the same across bothdatabases, and you will look at those values.

5. Create the multi-source Business Layer

a) Right-click your project and select New→Insert→ Business Layer→Relational Data Source→ Next

b) Name it CrossOver_xx

c) Click Next

d) Select the Data Foundation you created previously (CrossOver_xx.dfx)

Note: Make sure you UNCHECK the box:Automatically create classes and objects for all connections

e) Click Finish

6. Create the folders:- Customer- Staff

a) Select the top level of the Business Layer

b) Click the Insert Object drop down

c) Select Folder

d) Change name to Customer

e) Repeat for the other folder

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 107

Page 120: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

7. Add the objects which will describe the Customers.

a) Drag the following columns into the Customer folder you just created:REGION.REGION_NAMECLIENT.CLIENT_ID

8. Change the Client ID to a measure that counts the client ids and rename theobject Number of Clients.

a) Double-click the Client Id object.

b) Change the Select statement to count(CLIENT.CLIENT_ID). Be sure tovalidate the SQL.

Hint: Use the SQL Assistant button to perform this task.

c) Rename the object Number of Customers and qualify it as a measure byright-clicking the object and selecting Turn into measure(s)

9. Add the objects which will describe the Staff.

a) Drag the following columns into the Staff folder you just created:Employee.Personnel Number

10. Change the Personnel Number to a measure that counts the personnel numbersand rename the object Number of Employees.

a) Double-click the Personnel Number object.

b) Change the Select statement to count(Employee.Personnel Number). Besure to validate the SQL.

Hint: Use the SQL Assistant button to perform this task.

c) Rename the object Number of Employees and qualify it as a measure byright-clicking the object and selecting Turn into measure(s)

11. Save the Business Layer.

a) Save the Business Layer

Continued on next page

108 © 2011 SAP AG. All rights reserved. 2012

Page 121: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Creating a Multisource Universe

12. Test the results.

a) On the bottom left of the Business Layer editor select the Queries panel.Click the Insert Query button

b) In the query panel drag the objects Region Name, Number of Clientsand Number of Employees

c) Refresh the query

Note: Note the results for the East, South, and West regions.

2012 © 2011 SAP AG. All rights reserved. 109

Page 122: Boid20 en Col96 Fv Part Ltr

Unit 3: Creating Universes from Different Data Sources BOID20

Lesson Summary

You should now be able to:• Describe a multi-source universe• Create and maintain a multi-source universe

110 © 2011 SAP AG. All rights reserved. 2012

Page 123: Boid20 en Col96 Fv Part Ltr

BOID20 Unit Summary

Unit SummaryYou should now be able to:• Identify the two primary sources for creating a universe• Describe what an OLAP cube is• Create and maintain an OLAP universe• Describe a multi-source universe• Create and maintain a multi-source universe

2012 © 2011 SAP AG. All rights reserved. 111

Page 124: Boid20 en Col96 Fv Part Ltr

Unit Summary BOID20

112 © 2011 SAP AG. All rights reserved. 2012

Page 125: Boid20 en Col96 Fv Part Ltr

BOID20 Test Your Knowledge

Test Your Knowledge

1. When creating an OLAP universe, no Data Foundation is needed.Determine whether this statement is true or false.□ True□ False

2012 © 2011 SAP AG. All rights reserved. 113

Page 126: Boid20 en Col96 Fv Part Ltr

Test Your Knowledge BOID20

Answers

1. When creating an OLAP universe, no Data Foundation is needed.

Answer: True

114 © 2011 SAP AG. All rights reserved. 2012

Page 127: Boid20 en Col96 Fv Part Ltr
Page 128: Boid20 en Col96 Fv Part Ltr
Page 129: Boid20 en Col96 Fv Part Ltr

Unit Summary BOID20

115 © 2011 SAP AG. All rights reserved. 2012

Page 130: Boid20 en Col96 Fv Part Ltr

Unit Summary BOID20

116 © 2011 SAP AG. All rights reserved. 2012

Page 131: Boid20 en Col96 Fv Part Ltr

Unit 4Deploying Universes in different

languages

Unit OverviewOne of the key features of SAP BusinessObjects BI 4.0 is the ability to producemultilingual metadata and reports from the same universe. This feature enables theend user to have a one-step multilingual reporting solution that is locale sensitive,supported by a single metadata universe model and provides full Unicode support.Reports then can be built once from the same universe and run and generated inseveral languages based on user preferences.

The Information Design Tool user interface can also be displayed in differentlanguages. This unit describes the multilingual universe features.

After completing this unit, you will be able to:

• Translate the components of a universe into different languages

Unit ObjectivesAfter completing this unit, you will be able to:

• Use the Translation Management Tool to translate the Data Foundation and theBusiness Layer of your universe into different languages.

Unit ContentsLesson: Using the Translation Management Tool .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

Exercise 8: Translate a universe with Translation Manager .. . . . . . . . . . . . .121

2012 © 2011 SAP AG. All rights reserved. 117

Page 132: Boid20 en Col96 Fv Part Ltr

Unit 4: Deploying Universes in different languages BOID20

Lesson: Using the Translation Management Tool

Lesson OverviewIn this lesson, you will use the Translation Management Tool to translate universecomponents into different languages.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Use the Translation Management Tool to translate the Data Foundation and theBusiness Layer of your universe into different languages.

Business ExampleYou work for an international organization and need to deploy your universesworldwide. You wish to avoid creating individual universes for each language anddecide to use the Translation Management Tool to translate your universes.

The Translation Management Tool is a SAP BusinessObjects application that allowsuniverse designers to translate the Data Foundation and the Business Layer of theiruniverses into different languages. This translation ensures that end-users are ableto read the Business Layer in their preferred language.

The Translation Management Tool is used for translating not only data foundationsand business layers of universes but also end-user reports.

This product is most useful in the context of worldwide BusinessObjects deployments.Instead of having to duplicate universes and documents for each required language,you can use the Translation Management Tool to translate the metadata only once.

When a report designer creates a Web Intelligence document and retrieves data usingthe universe that is translated, all translatable content is stored in several differentlanguages in the single Web Intelligence document.

The language chosen to display the document in the end user's application isdependent on the language defined in the user's preferred viewing locale setting in theBI Launchpad or in the Internationalization settings in Web Intelligence Desktop.

118 © 2011 SAP AG. All rights reserved. 2012

Page 133: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using the Translation Management Tool

If the user's Preferred Viewing Locale or Internationalization settings are set to alanguage that does not exist in the Web Intelligence document, then the data isdisplayed using the default language instead. This default language value is definedwhen the universe data is translated.

Note: The Translation Management Tool does not allow you to translate thedata retrieved by the query. A multilingual database is required to displaythe report data in multiple languages.

Translation Manager allows you to translate the following text strings:

• Class and object names and descriptions.• Business Layer name and descriptions.• Data Foundation names and descriptions.• Prompted query filter text.• Context names.

To translate a universe with the Translation Management Tool

1. Launch the Translation Management Tool from the SAP BusinessObjects BI 4.0product list located on the Start menu.

2. Log onto Translation Manager using the same user name and password that you usefor other SAP BusinessObjects BI 4.0 applications, then click OK.

2012 © 2011 SAP AG. All rights reserved. 119

Page 134: Boid20 en Col96 Fv Part Ltr

Unit 4: Deploying Universes in different languages BOID20

3. To translate the universe metadata, you import strings to translate from either aLocal folder or System Repository.

• To translate the Data Foundation and/or Business Layer of a local universeproject:

1. Click File→ Import strings to translate from and choose Local folder .. . .

2. Select the Data Foundation or Business Layer that requires translationand click Open.

The local Data Foundation of Business Layer opens in the TranslationManager window.

• To translate a universe located in the System Repository:

1. Click File → Import string to translate from and choose Systemrepository . . . .

2. Browse to the appropriate project folder and select the Data Foundation orBusiness Layer that requires translation and click Open.

3. Click Add to add the component to the list of selected components to betranslated.

4. Click Finish.

The component is imported from the System Repository and opens in theTranslation Manager window.

To proceed with the translation:

1. Select the appropriate language from the Available Languages list and click >,or simply double-click the language.

The chosen language now appears in the Selected Languages pane. Also, anew column appears in the Category View pane, where you can translate thestrings into the chosen language.

2. In the Category View pane, expand the Outline to view the available universefolders. Expand a folder to see the objects organized in the expanded folder.

3. In the Name field for the translation language click the current text for thelanguage you wish to translate to and in the Text Editor window, type thetranslated text in the Translation field and then click Apply. You can also simplydouble-click the text in the Name field and type the translation.

4. Save the translations and then export the translated strings from File→ Exporttranslated strings.

120 © 2011 SAP AG. All rights reserved. 2012

Page 135: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using the Translation Management Tool

Exercise 8: Translate a universe withTranslation Manager

Exercise ObjectivesAfter completing this exercise, you will be able to:• Translate the Business Layer of a universe

Business ExampleYou work for an international organization and need to deploy your universesworldwide. You wish to avoid creating individual universes for each language anddecide to use the Translation Management Tool to translate your universes.

Task:1. Create a project called Translate_xx, where xx stands for your user number.

2. Retrieve the Motors universe from the repository.

3. Launch the Translation Management Tool using the same logon credentials usedto open a repository session in the Information Design Tool.

4. Import the strings to translate from a local folder.

5. Select German (Germany) as the language to translate to

6. Make the translations visible when used by other tools.

7. Translate the Client Name, Client Country, and Client Town objects.

8. Export the translated strings.

9. Test the translations by creating a query in the Business Layer of the universe.

2012 © 2011 SAP AG. All rights reserved. 121

Page 136: Boid20 en Col96 Fv Part Ltr

Unit 4: Deploying Universes in different languages BOID20

Solution 8: Translate a universe withTranslation ManagerTask:1. Create a project called Translate_xx, where xx stands for your user number.

a) Click New → Project.

Project Name: Translate_xx

b) Click Finish

2. Retrieve the Motors universe from the repository.

a) Right-click the project name and select Retrieve a Published Universe→From a Repository.

b) If necessary, log on to the repository:

System: wdflbmt2268

User name: train-##

Password train-##

Authentication Mode Enterprise

c) Navigate to Universes→ Solutions→ BOID20→ Unit 4 and select themotors.unx

d) Click Finish.

3. Launch the Translation Management Tool using the same logon credentials usedto open a repository session in the Information Design Tool.

a) Launch the Translation Management Tool using the same logon credentialsused to open a repository session in the Information Design Tool.

b) Click Start → Programs → SAP BusinessObjects BI platform 4.0 → SAPBusinessObjects BI platform Client Tools → Translation Management Tool.

Continued on next page

122 © 2011 SAP AG. All rights reserved. 2012

Page 137: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using the Translation Management Tool

4. Import the strings to translate from a local folder.

a) Click File→ Import strings to translate from and choose Local folder.. . .

b) Browse toBrowse to .businessobjects → bimodeler_14 → workspace →Translate_xx → Retrieval (with today’s date) and choose the business layermotors.blx.

c) Click Open.

5. Select German (Germany) as the language to translate to

a) From the Language Management window in the lower left portion of theapplication, double-click German (Germany).

6. Make the translations visible when used by other tools.

a) Check the box under the Visible column for German.

Note: BE SURE TO PERFORM THIS STEP. Otherwise, yourtranslation will not be visible when you test it later.

7. Translate the Client Name, Client Country, and Client Town objects.

a) In the upper left portion of the application, expand the Outline node andthen the Client folder.

b) Continue expanding the Client Name, Client Country, and Client townobjects.

c) Click on the italicized blue text in the German column for the Name field.

d) In the Text Editor window in the upper right portion of the tool, type thetranslated text in the Translation field and then click Apply. Translationsare:

Folder/Object German

Client (folder) Kunde

Client Name Name des Kunden

Client Country Land

Client Town Stadt

e) Save the translations.

Continued on next page

2012 © 2011 SAP AG. All rights reserved. 123

Page 138: Boid20 en Col96 Fv Part Ltr

Unit 4: Deploying Universes in different languages BOID20

8. Export the translated strings.

a) Click File→ Export translated strings.

b) Click OK from the Success message.

9. Test the translations by creating a query in the Business Layer of the universe.

a) Go back to the Information Design Tool and change the Languagespreferences to German (Germany) for the Preferred Viewing Locale fromthe menu pathWindow→ Preferences.

b) Click Languages and In the Preferred Viewing Locale selection list,choose Germany (Germany).

c) Click OK.

d) Refresh the Translate_xx project by right-clicking the project name andchoosing Refresh.

e) If it is not already open, open the Business Layer as if to create a query.

f) Open the Client folder and observe the translated objects.

124 © 2011 SAP AG. All rights reserved. 2012

Page 139: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Using the Translation Management Tool

Lesson Summary

You should now be able to:• Use the Translation Management Tool to translate the Data Foundation and the

Business Layer of your universe into different languages.

2012 © 2011 SAP AG. All rights reserved. 125

Page 140: Boid20 en Col96 Fv Part Ltr

Unit Summary BOID20

Unit SummaryYou should now be able to:• Use the Translation Management Tool to translate the Data Foundation and the

Business Layer of your universe into different languages.

126 © 2011 SAP AG. All rights reserved. 2012

Page 141: Boid20 en Col96 Fv Part Ltr

BOID20 Test Your Knowledge

Test Your Knowledge

1. Translation Manager translates the data returned by a query.Determine whether this statement is true or false.□ True□ False

2. If the local language setting specifies a language not defined by TranslationManager, English (US) is used.Determine whether this statement is true or false.□ True□ False

2012 © 2011 SAP AG. All rights reserved. 127

Page 142: Boid20 en Col96 Fv Part Ltr

Test Your Knowledge BOID20

Answers

1. Translation Manager translates the data returned by a query.

Answer: False

Translation Manager does not translate the data returned by a query.

2. If the local language setting specifies a language not defined by TranslationManager, English (US) is used.

Answer: False

The default language for the universe is used.

128 © 2011 SAP AG. All rights reserved. 2012

Page 143: Boid20 en Col96 Fv Part Ltr
Page 144: Boid20 en Col96 Fv Part Ltr
Page 145: Boid20 en Col96 Fv Part Ltr

Unit Summary BOID20

129 © 2011 SAP AG. All rights reserved. 2012

Page 146: Boid20 en Col96 Fv Part Ltr

Unit Summary BOID20

130 © 2011 SAP AG. All rights reserved. 2012

Page 147: Boid20 en Col96 Fv Part Ltr

Unit 5Managing and Optimizing Universes

Unit OverviewOne of the primary responsibilities of the universe designer is to ensure that theuniverse is constructed to produce accurate data results as efficiently as possible. Inaddition, you may choose to share the universe design responsibilities among a teamof universe designers.

After completing this lesson, you will have discussed:

• Data Foundation and Business Layer Views• Sharing Projects• Universe Optimization Options

Unit ObjectivesAfter completing this unit, you will be able to:

• Use Data Foundation Views to help manage your universe• Use Business Layer Views to help manage your universe• Create a shared project• Work with a shared project• Describe the purpose of the various connection parameters• Describe the purpose of the various data foundation parameters• Identify best practices when designing universes

Unit ContentsLesson: Managing a Universe with Data Foundation and Business LayerViews ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132Lesson: Working with a Shared Project.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135Lesson: Optimizing the Universe ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142

2012 © 2011 SAP AG. All rights reserved. 131

Page 148: Boid20 en Col96 Fv Part Ltr

Unit 5: Managing and Optimizing Universes BOID20

Lesson: Managing a Universe with Data Foundation andBusiness Layer Views

Lesson OverviewThis lesson discusses how you can use Data Foundation Views and Business LayersViews to help manage your universe more effectively.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Use Data Foundation Views to help manage your universe• Use Business Layer Views to help manage your universe

Business Example

Data Foundation ViewsA custom data foundation view is simply a subset of the data foundation Masterview. Use views when you are editing a data foundation that contains many tables,and you are interested in working with a subset of tables. You can define multiplecustom views for the data foundation.

To Insert a Custom View

1. From the Data Foundation, select Insert > View from the Insert menu and entera name for the view.

A new tab appears at the bottom of the view pane. Initially, the view is empty.

2. Add a table to a view by right-clicking the table header and select Add to View.To select and add multiple tables, click the table headers while holding down theCTRL key.

Another way to insert a view is to select one or several tables. Then right-clickand select Insert > View from Selection. The view is inserted and containsthe selected tables.

3. Insert any joins, set cardinalities, and resolve loops and SQL traps as needed.

Table operations (inserting joins, setting cardinalities, resolving loops and SQL traps)are allowed from all views. Any changes to one view are propagated to all views inthe data foundation and to the Master view.

132 © 2011 SAP AG. All rights reserved. 2012

Page 149: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Managing a Universe with Data Foundation and Business Layer Views

Business Layer ViewsYou can modify the display of business layer objects by using business layer views torestrict the number of objects displayed in the business layer pane. Use business layerviews to group objects that share a business relationship. Business layer views can beselected in the Query Panel and can be used to define security to grant or deny theuse of business layer objects to certain users or groups.

To Create and Edit a Business Layer View

1. From the Business Layer, click theManage Business Layer Views icon atthe top of the Business Layer pane.

The Edit Business Layer View dialog box opens.

2. Click New.3. Type a name for the view in the Name text box and a description in the

Description text box.4. In the Objects in View box, select the check boxes next to folders and/or objects

in the business layer to include them in the view.

To work with only the objects already included in the view, select Show selectedobjects only.

5. To edit an existing view, click theManage Business Layer Views icon at thetop of the Business Layer pane, select the view you wish to change, and makeany changes.

Note: You cannot change the Master view in the Edit Business LayerViews dialog box.

If you created Business Layer views, you can filter on those views by selecting aBusiness Layer view in the drop-down list at the top of the Business Layer pane. Todisplay all folders and objects in the business layer, select Master from the list.

2012 © 2011 SAP AG. All rights reserved. 133

Page 150: Boid20 en Col96 Fv Part Ltr

Unit 5: Managing and Optimizing Universes BOID20

Lesson Summary

You should now be able to:• Use Data Foundation Views to help manage your universe• Use Business Layer Views to help manage your universe

134 © 2011 SAP AG. All rights reserved. 2012

Page 151: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Working with a Shared Project

Lesson: Working with a Shared Project

Lesson OverviewThis lesson discusses how you can create a use a shared project to make a localproject's resources available to other designers in your organization.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Create a shared project• Work with a shared project

Business Example

Working with a Shared ProjectA shared project is a project in the SAP BusinessObjects Enterprise repository whoseresources are available to other designers. You create a shared project in a repositoryfrom an existing local project in the Local Projects View.

To Create a Shared Project

1. In the Local Projects View, right-click the project you want to share and selectNew Shared Project.

A new tab appears at the bottom of the view pane. Initially, the view is empty.

2. In the Open Session dialog box, select the repository system session you want toopen and enter your system authentication.

The Project Synchronization View pane opens showing a shared project withthe same name as the local project. At this point, the shared project is empty.

3. In the Project Synchronization View, upload the resources you want to save inthe shared project by selecting the connection, data foundation, and/or businesslayer and choosing Save Changes on Server . . . .

Note: The shared project will automatically be given the same name as thelocal project. A project with this name cannot already exist in the repository.To rename an existing shared project, use the rename command in the ProjectSynchronization View.

2012 © 2011 SAP AG. All rights reserved. 135

Page 152: Boid20 en Col96 Fv Part Ltr

Unit 5: Managing and Optimizing Universes BOID20

To work on shared resources, you use Project Synchronization View. With the ProjectSynchronization View, you can:

• Synchronize the project to copy resources between the local and shared projects.• Lock and unlock resources in the shared project to inform other designers when

you are working on them.• Synchronize a shared project created by another designer. This creates a local

project associated with the shared project so you can start working on the sharedresources.

About Project Synchronization

Synchronizing a project starts with comparing the resources in a project in theLocal Projects View with an associated shared project on the repository server.Synchronization detects added resources, deleted resources, and differences betweenthe resources. Based on the differences detected, you can update the local and sharedresources. Use the Project Synchronization View to synchronize a project. The viewdisplays synchronization information in two panes:

• The Shared Project pane lists the resources in the shared project on the server.A lock icon appears next to the resource if it is locked. Additional informationabout the resources on the server is displayed, including the user who lastmodified the resource and on what date, and the user who locked the resourceand on what date.

• The Synchronization Status pane lists the status of each resource. The status isdetermined by comparing the resources in the local and shared projects.

The different synchronization statuses and what they mean are listed in the followingtable.

Status Description

Added Locally The resource was added in the localproject, but not in the shared project.

Changed Locally The resource was changed in the localproject, but not in the shared projectsince the last synchronization.

Deleted Locally The resource was deleted in the localproject but still exists in the sharedproject.

Added on Server The resource is not in the local projectbut exists in the shared project.

136 © 2011 SAP AG. All rights reserved. 2012

Page 153: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Working with a Shared Project

Changed on Server The resource was changed in the sharedproject, but not in the local project sincethe last synchronization.

Deleted on Server The resource exists in the local project,but was deleted in the shared project.

Conflicting Any of the following situations createsa conflicting status:

• The resource was changed in boththe local and shared projects withdifferent changes since the lastsynchronization.

• A resource with the same namewas added both in the local andshared projects since the lastsynchronization.

• The resource was changed in thelocal project, but deleted from theshared project.

• The resource was changed in theshared project, but deleted from thelocal project.

Synchronized The resources are identical.

Three commands allow you to synchronize resources. When you select the resourcesto be synchronized, you can select individual resources or folders. The following tablesummarizes the possible synchronization actions.

Command Synchronization Action

Get Changes from Server For the selected resources:

• If the status is Added on Server,the resource is added to the localproject.

• If the status is Changed on Server,the resource is updated in the localproject.

• If the status is Deleted on Server,the resource is deleted from thelocal project.

2012 © 2011 SAP AG. All rights reserved. 137

Page 154: Boid20 en Col96 Fv Part Ltr

Unit 5: Managing and Optimizing Universes BOID20

• If the status is Conflicting, theresource on the server (whetherit is changed, added, or deleted)is copied to the local project,regardless of the change made inthe local project.

For all other statuses, no action is taken.

Note: You may want to review thechanges made on the server beforeupdating them in the local project. Formore information, see the related topicon merging changes in shared resources.

Save Changes on Server For the selected resources:

• If the status is Added Locally, theresource is added to the sharedproject on the server.

• If the status is Changed Locally, theresource is updated in the sharedproject on the server.

• If the status is Deleted Locally, theresource is deleted from the sharedproject on the server.

• If the status is Conflicting, theresource in the local project(whether it is changed, added, ordeleted) is copied to the sharedproject, regardless of the changemade in the shared project.

Note: If a resource is locked by anotheruser, an error message displays and thechanges and deletions are not made onthe server. For all other statuses, noaction is taken.

Revert Changes For the selected resources, the localproject is updated with the shared projecton the server, regardless of the status.

Note: Revert Changes updates the localproject in the same way as Get Changesfrom Server with the exception that if a

138 © 2011 SAP AG. All rights reserved. 2012

Page 155: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Working with a Shared Project

resource has been created in the localproject and has not yet been saved on theserver, Revert Changes deletes the newlocal resource, whereas Get Changesfrom Server preserves the new localresource.

To Synchronize a Shared Project

1. Open the Project Synchronization View with a session on the repository systemwhere the shared project is saved.

2. Select the shared project from the Shared Project list.3. In the selected shared project, lock the resource(s) you want to work on by

highlighting the resource(s) on the Shared Project pane and clicking the lockbutton or by right-clicking the resource and choosing Lock.

Note: Locks are available as a communication tool between designers.When other designers open the Project Synchronization View, yourlock informs them that you are making changes. It also prevents otherdesigners from updating these resources in the shared project while youhave them locked. However, any designer can unlock the resourceif necessary.

4. Synchronize the project to update the resources in the local project with the latestchanges saved on the server by highlighting the connection, data foundation,and/or business layer on the Synchronization Status pane and choosing GetChanges from Server . . . .

Note: Resources that are out of sync will display “Changed on Server”in the Synchronization Status pane.

Note: If you do not already have a local version of the project, one iscreated in the Local Projects View.

5. Double-click the resource you wish to change and make the necessary changesin the appropriate editing pane. Be sure to save these changes.

6. Once you have made your changes locally, in the Project SynchronizationView select the resources you changed and choose Save Changes on Server . .. to save your changes on the server.

7. Unlock the resources you locked in Step 3.

2012 © 2011 SAP AG. All rights reserved. 139

Page 156: Boid20 en Col96 Fv Part Ltr

Unit 5: Managing and Optimizing Universes BOID20

Shared projects can be renamed and deleted from the repository. Be aware, however,that when you rename a shared project, local projects with the original name are nolonger associated with the shared project with the new name. The resources in thoselocal projects can no longer be synchronized with the newly named shared project.

Also note that deleting a shared project cannot be undone. The shared project is deletedfrom the repository. Resources in the local projects associated with the deleted sharedproject are not affected; however, synchronization statuses of the local project are lost.

To Rename a Shared Project

1. Open the Project Synchronization View with a session on the repository systemwhere the shared project is saved.

2. Select the shared project from the Shared Project list.3. Click the Rename Shared Project icon.4. Enter a new name that is unique in the repository.

Note: Multiple Shared Projects cannot have the same names in therepository. Shared projects must have unique names.

5. To create a local project with the new name in the Local Projects View,synchronize the project by selecting Get Changes from Server . . ..

To Delete a Shared Project

1. Open the Project Synchronization View with a session on the repository systemwhere the shared project is saved.

2. Select the shared project from the Shared Project list.3. Click the Delete Shared Project icon.

140 © 2011 SAP AG. All rights reserved. 2012

Page 157: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Working with a Shared Project

Lesson Summary

You should now be able to:• Create a shared project• Work with a shared project

2012 © 2011 SAP AG. All rights reserved. 141

Page 158: Boid20 en Col96 Fv Part Ltr

Unit 5: Managing and Optimizing Universes BOID20

Lesson: Optimizing the Universe

Lesson OverviewOne of the primary responsibilities of the universe designer is to ensure that theuniverse is constructed to produce accurate data results as efficiently as possible.

Lesson ObjectivesAfter completing this lesson, you will be able to:

• Describe the purpose of the various connection parameters• Describe the purpose of the various data foundation parameters• Identify best practices when designing universes

Business Example

Connection Configuration ParametersWhen creating or editing a connection, you can set certain parameters to optimizethe connection against the database in use. Query time can often be shortenedby optimizing the connection. The connection configuration page for relationalconnections contains parameters used to optimize a universe:

• Defining the duration of a connection into a pool.• Defining how BusinessObjects products respond when database resources are

not available.• Defining the size of the array fetch.

You can set the following configuration parameters for most relational connections:

• Connection pool mode.• Array fetch size.• Login time-out.

Connection pool mode

There are three connection pool mode options:

142 © 2011 SAP AG. All rights reserved. 2012

Page 159: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Optimizing the Universe

Pool mode option Description

Disconnect after each Transaction Use this option if you want yourconnection to disconnect immediatelyafter the transaction is completed. Usershave to reconnect each time they wantto access data.

Keep the connection active for Use this option if you want yourconnection to stay active for a definedperiod of time. You must also enter avalue for the number of minutes. This isthe default Pool timeout value.

Keep the connection active during thewhole session (local modeonly)

Use this option if you want yourconnection to stay active during theentire session of the product. Theconnection ends when the user exits theapplication.

Pool timeout If you select Keep the pool active, thisparameter specifies the length of time tokeep the connection open.

Array fetch size

Specifies the maximum number of rows authorized with each fetch from the database.For example, if you enter 20, and your query returns 100 rows, the connectionretrieves the data in 5 fetches of 20 rows each.

To deactivate array fetch, enter an Array Fetch Size of 1. The Data is retrieved row byrow.

Note: Deactivating array fetch size can increase the efficiency of retrievingyour data, but slows server performance. The greater the value in the ArrayFetch Size, the faster your rows are retrieved. You must, however, ensure youhave adequate client system memory.

Array bind size

This parameter is not used for universes created using the Information Design Tool.

Login time–out

Specifies the number of minutes that must be spent to establish a connection beforean error message is displayed.

JDBC Driver Properties (key=value,key=value)

2012 © 2011 SAP AG. All rights reserved. 143

Page 160: Boid20 en Col96 Fv Part Ltr

Unit 5: Managing and Optimizing Universes BOID20

Specifies values for JDBC driver properties when that driver is selectedfor the connection. You can define the value of more than one property,separated by commas. For example, the following value for JDBC DriverProperties sets the oracle.jdbc.defaultNChar and defaultNChar driver properties:oracle.jdbc.defaultNChar=true,defaultNChar=true

Note: If a property is defined in the <driver>.sbo file, the value defined inthis parameter is used. For more information about SBO files, see the “DataAccess Guide.”

Owner Name

For DB2 connections, this parameter adds the name of the owner of the table as aprefix on the table name, to match the DB2 convention for naming tables.

Table Suffix

For DB2 connections, this parameter adds a suffix on the table name, to match theDB2 convention for naming tables.

Depending on the middleware driver selected when creating the connection, certainCustom Parameters may be available. These parameters should be modified only byan advanced user, DBA, or SAP BusinessObjects BI administrator.

Query Script ParametersThe purpose of a universe is to allow reporting tools such as WebIntelligence togenerate a complete SQL statement to pass to a data source in order to return accuratereporting results. Each data foundation has Query Script Parameters that can bechanged to ensure the SQL generated by a reporting tool is as efficient as possible.

Each data source has different Query Script Parameter options. To see a description ofall the predefined SQL generation parameters and their values, click the help button.

These Query Script Parameters can be changed and new parameters added in the datafoundation. In addition, parameters concerning lists of values can be changed in thebusiness layer properties. These changes should be made, however, only after youdiscuss their implications with your DBA, network team, and SAP BusinessObjectsadministrative team.

At query time, the query server will use the values it finds in the following order:

1. The value in the business layer, if it is set.2. The value in the data foundation, if it is set.3. The default value.

144 © 2011 SAP AG. All rights reserved. 2012

Page 161: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Optimizing the Universe

To edit a query script parameter

1. Select the connection you wish to edit.2. Display the Properties for the connection.3. Click Parameters in the SQL Options area.4. Select the appropriate parameter to edit and change the value as required.5. Click OK to close the Query Script Parameters dialog box.

Best Practices of Universe DesignAs with any project, you should always base your universe design and implementationon best practices. The following information outlines a general workflow of bestpractices to design an effective universe that meets end users’ needs.

General best practices

• Identify reporting requirements.

Involve users at every step of the universe design and production process,especially in naming objects (this ensures the terminology is correct).

• Identify the data source relevant to the universe you are creating and ensurethere is representative data available.

Ensure that the data source is stable and not likely to change dramatically duringuniverse development.

• Insert tables into the data foundation one at a time, not in bulk, understandinghow each table relates to the overall universe.

• Insert joins and define cardinalities.

Specify cardinalities manually as opposed to using the Detect Cardinalitiesoption in the Information Design Tool. Always define cardinality, even forself-referencing and self-restricting joins, to avoid cardinality warning messages.

• Lay out your data foundation with cardinalities facing the same direction andalways arrange tables logically in the structure window. Doing so helps youidentify and visualize contexts and resolve loops and SQL Traps.

• Add relevant comments to your data foundation to document universedevelopment changes. Remember that you may not be the only person buildingand designing this universe.

Consider using shared projects when working with multiple universe designers.

• Build relevant objects. Keep the business layer business-focused when namingobjects and folders.

2012 © 2011 SAP AG. All rights reserved. 145

Page 162: Boid20 en Col96 Fv Part Ltr

Unit 5: Managing and Optimizing Universes BOID20

• Do not normalize. Use Multi-Dimensional Modeling instead.• Always check integrity.• Use aggregate awareness, which speeds up query time by using special tables

containing pre-calculated data. Do all aggregation in the data source rather thanin the reporting document. In general, doing so speeds the query process.

• Define aggregate SQL functions on business layer measures. Fewer rows getreturned from the database thus making reports smaller and the calculation ofvariables, ranks, and formatting rules quicker.

• Set the connection parameters to disconnect after each transaction to ensure thatthe SQL statement is terminated cleanly and that the are no treads left open tothe database which are inactive.

Note: A number of databases are licensed on the number of concurrentconnections, and if a connection is left open for a period of time, thenend users could experience difficulties in accessing the database.

• Remove unnecessary lists of values, such as on dates and measure objects. Baselists of values on lookup tables.

• Add any other elements to the business layer such as filters and navigation paths.• Test the universe by building queries in SAP BusinessObjects end-user querying

tools such as WebIntelligence or Dashboards.

146 © 2011 SAP AG. All rights reserved. 2012

Page 163: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Optimizing the Universe

Best practices for folders and objects

• Use the minimum possible objects in the Business Layer.

500 objects is the recommended maximum. Too many objects may slow downthe time required for a user to find objects.

• Create filters when possible.• Always type a description for objects.

Start the description with the object’s full name. This is particularly helpfulto users if the object’s name is very long and cannot be fully displayed in thereport/query panel.

• Consider putting the full folder path and object name in the object’s description.

This may be a laborious process but one which is useful if end-users are workingwith a large universe. The description is shown in the report/query panel when auser points to an object.

• Dimension, measure, and attribute objects should be within their logical foldersunless the measure objects are generic to the whole universe, in which case youmay choose to create a general Measure folder.

• Format objects and measures within the Business Layer.

Doing so prevents users having to spend valuable time formatting data fromwithin the reporting tool every time they create a report.

2012 © 2011 SAP AG. All rights reserved. 147

Page 164: Boid20 en Col96 Fv Part Ltr

Unit 5: Managing and Optimizing Universes BOID20

Best practices for joins

• Avoid building a data foundation with no joins between the tables. There areexceptions, such as using summary tables in the data foundation; however,in those instances ensure that incompatibilities are set using the AggregateNavigation tool to avoid SQL errors.

• Optimize database performance by using shortcut joins.

Shortcut joins provide an alternative path between two tables. Shortcut joins canimprove query performance by using shorter paths and bypassing intermediatetables.

Note: Placing shortcut joins in an existing Data Foundation may changethe results returned by existing queries.

• Avoid outer joins where possible.

Outer joins may have a negative effect on performance since more rows arereturned. Additionally, some databases do not use indexes when outer joinsare involved.

Note: It is recommended that outer joins be placed at the end of the flowof data, otherwise outer join errors may occur. Potentially, this couldcause the SQL to try to match on the equality of a NULL value, whichit cannot do in some RDBMSs. Using aggregate aware and aliasesmay help if outer joins are necessary but cannot be placed at the endof the path. If you do place outer joins in the middle of a table path,the subsequent joins in the path may also have to be made outer joinsin order to avoid errors, which an have a significant negative impacton performance.

148 © 2011 SAP AG. All rights reserved. 2012

Page 165: Boid20 en Col96 Fv Part Ltr

BOID20 Lesson: Optimizing the Universe

Lesson Summary

You should now be able to:• Describe the purpose of the various connection parameters• Describe the purpose of the various data foundation parameters• Identify best practices when designing universes

2012 © 2011 SAP AG. All rights reserved. 149

Page 166: Boid20 en Col96 Fv Part Ltr

Unit Summary BOID20

Unit SummaryYou should now be able to:• Use Data Foundation Views to help manage your universe• Use Business Layer Views to help manage your universe• Create a shared project• Work with a shared project• Describe the purpose of the various connection parameters• Describe the purpose of the various data foundation parameters• Identify best practices when designing universes

150 © 2011 SAP AG. All rights reserved. 2012

Page 167: Boid20 en Col96 Fv Part Ltr
Page 168: Boid20 en Col96 Fv Part Ltr
Page 169: Boid20 en Col96 Fv Part Ltr

Test Your Knowledge BOID20

151 © 2011 SAP AG. All rights reserved. 2012

Page 170: Boid20 en Col96 Fv Part Ltr

Course Summary BOID20

Course SummaryYou should now be able to:

• Resolve SQL Traps• Learn advanced use of the @AggregateAware function• Create a universe from and OLAP source and from multiple relational sources• Deploy a universe in different languages• Manage and optimize the universe

152 © 2011 SAP AG. All rights reserved. 2012

Page 171: Boid20 en Col96 Fv Part Ltr

FeedbackSAP AG has made every effort in the preparation of this course to ensure the accuracyand completeness of the materials. If you have any corrections or suggestions forimprovement, please record them in the appropriate place in the course evaluation.

2012 © 2011 SAP AG. All rights reserved. 153