Upload
omkar-narayan
View
220
Download
0
Embed Size (px)
Citation preview
8/2/2019 BO Universe_v1.0
1/61
SAP Business Objects
Universe
8/2/2019 BO Universe_v1.0
2/61
PrepareMe
In this section, we will cover 3 topics
Purpose
Use
Challenges
8/2/2019 BO Universe_v1.0
3/61
8/2/2019 BO Universe_v1.0
4/61
Use As the universe designer, you use Designer to create objects
that represent database structures, for example columns anddatabase functions, that users need to access and query, to get
the information necessary to meet their business requirements.
The role of a universe is to provide an easy to use andunderstand interface for non technical Web Intelligence users to
run queries against a database to create reports and performdata analysis.
8/2/2019 BO Universe_v1.0
5/61
Challenges
Universes are created to meet a user need for data. The universedesigner must have the skills to conduct user needs analyses to
create classes and objects that are relevant to the uservocabulary, and to develop universes that meet the needs of theuser community. These needs include report creation and queryresults that are suitable for analysis.
Universe designer needs to have a good working knowledge ofthe company's database management system (DBMS), how thedatabases are deployed, the logical database structure, and the
type of data stored in company databases.
A working knowledge of SQL is necessary.
8/2/2019 BO Universe_v1.0
6/61
SAP Business Object - Universe
1 PrepareMe
2 TellMe
3 ShowMe
4 LetMe
5
HelpMe
8/2/2019 BO Universe_v1.0
7/61
Agenda BO Introduction
- Types of Schemas
Creating a universe with Quick wizard
- Five Steps Creating Universe
Hands on Exercise
Classes and Objects
Joins Loops
@functions
Derived Tables Chasm Trap
Fan Trap
SAP OLAP Universe
8/2/2019 BO Universe_v1.0
8/61
Business Objects Enterprise is a business intelligence (BI)platform that powers the management and secure deployment ofspecialized end-user tools for reporting, query and analysis,
performance management, and analytic applications on aproven and scalable.
Components of Business Object.
CMS (Central Management Server)
CMC (Central Management Console)
Designer (Universe creation)
Web Intelligence Voyager
Crystal Reports
Live Office
Xcelsius
Business Objects
8/2/2019 BO Universe_v1.0
9/61
8/2/2019 BO Universe_v1.0
10/61
Where we can use Universe
8/2/2019 BO Universe_v1.0
11/61
8/2/2019 BO Universe_v1.0
12/61
Five Steps Creating Universe
8/2/2019 BO Universe_v1.0
13/61
Step 1
Click on New it w illopen Connect ion
Wizard
Step 2
Step 3Step 4Step 5
Creating a Universe in 5 Steps
8/2/2019 BO Universe_v1.0
14/61
Here we can find allthe selected tablesand derived valuesas classes, objects
and measures.
Example-
Classes- Scott Dept,Scott Emp.
Objects- deptno,dname, loc, empno,
ename, etc..
Measures- Sum ofSal.
Designer Window
Note- In the designer we can also create our ownclasses and objects.
8/2/2019 BO Universe_v1.0
15/61
A class is a container of objects.
A class is the equivalent of a folder in the Windowsenvironment or you can consider a table as the class.
You create classes to house objects that have a commonpurpose in the universe.
Classes is the logical grouping objects within a universe. In general, the name of the class reflects a business concepts
that conveys the category or type of objects.
Ex( Customer, Finance, Sales, Marketing, etc.,)
Definitions - Classes
8/2/2019 BO Universe_v1.0
16/61
Three modes of connections: Shared connections
Allows access to data for all Business Objects users.
Shared connections can be useful in a universe testing environment
Personal connections
Restricts access to data to the universe creator and the computer on
which it was created. You do not use personal connections to distribute universes.
You could use personal connections in the following situations:
To access personal data on a local machine To access specific database accounts to test an SQL sample
through the Free-hand SQL option in Business Objects
Connections
8/2/2019 BO Universe_v1.0
17/61
Secured connections
Centralizes and controls access to data. It is the safest type ofconnection, and should used be to protect access to sensitive data.
You can create secured connections with Designer or Supervisor .
Connections are stored in the security domain of the repository.These can be shared with designers and supervisors with theappropriate privileges.
You must use secured connections if you want to distributeuniverses through the Business Objects repository
If we want to distribute reports over the net using repository etc thenthe connection should be secured connection
Connections
8/2/2019 BO Universe_v1.0
18/61
Connections
8/2/2019 BO Universe_v1.0
19/61
Inserting Classes and Objects
Inserting Classes
To insert classes in designer, clickclasses in the insert menu.
Name the classes and click ok.
The classes are like creating anotherfolder in a universe according to thebusiness requirement if required
Inserting Objects
To insert object, click objects in theinsert menu.
Name the object, specify the data typeand in the Select column click the arrowand select the column from the tables.
The object can be any columns orderived columns.
8/2/2019 BO Universe_v1.0
20/61
8/2/2019 BO Universe_v1.0
21/61
Details - Provides descriptive data about a dimension. A detail isalways attached to a dimension. It maps to one or more columnsor functions in the database that provide detailed information
related to a dimension.
Ex- Age, Phone number, address
Dimension, Measure and Detail...
8/2/2019 BO Universe_v1.0
22/61
Lets Start Doing Hands on Exercise in BO using Universe
Hands on..
8/2/2019 BO Universe_v1.0
23/61
The advance option will give the securityoption to the object.
- Security level access. Defines the security access level of the
object. You can select a security levelwhich restricts use of the object to endusers with the appropriate securitylevel. Security access levels areassigned to end user profiles inBusiness Objects Supervisor by anadministrator.- You can assign the following securityaccess levels:- Public- Confidential
- Private If you assign Public then all users can see
and use the object. If you assign Restricted,then only users with the user profile ofRestricted or higher can see and use theobject.
Security at Object Level
8/2/2019 BO Universe_v1.0
24/61
Used to create thepre defined filterswhich we can use toget the data required
Its use full for endusers to get databased on certain
criteria like get allreturned customers,grade A, grade B,
grade C customersetc
Conditions
8/2/2019 BO Universe_v1.0
25/61
To create a object, theuser need to select thedata type of the object.
In the select box, click thearrow then you will get the
list of tables and columns,classes and objects,operators and functions.
In the where box, specify
the condition
Obj ect keys allow Designer t o generatemore eff icient SQL by fil t ering on prim arykey values and elim inat ing unnecessary
joins.
Defining your own objects (derived)
8/2/2019 BO Universe_v1.0
26/61
The Keys tab allows you to define index awareness for anobject. Index awareness is the ability to take advantage of theindexes on key columns to speed data retrieval.
The objects that you create in Designer are based on database
columns that are meaningful to an end user. For example, aCustomer object retrieves the field that contains the customername. In this situation the customer table typically has a primarykey (for example an integer) that is not meaningful to the end
user, but which is very important for database performance.When you set up index awareness in Designer you tell Designerwhich database columns are primary and foreign keys. This canhave a dramatic effect on query performance in the followingways:
Designer can take advantage of the indexes on key columns tospeed data retrieval.
Keys in BO (Additional Info..)
8/2/2019 BO Universe_v1.0
27/61
What is Joins in BO?
Joins ?
Once you have inserted more than one table in the schema, you need tocreate joins between related tables.
A join is a condition that links the data in separate but related tables. Thetables usually have a parent-child relationship. If a query does notcontain a join, the database returns a result set that contains all possiblecombinations of the rows in the query tables. Such a result set is knownas a Cartesian product and is rarely useful.
Why use joins in a schema?
You use joins to ensure that queries returning data from multiple tablesdo not return incorrect results. A join between two tables defines howdata is returned when both tables are included in a query.
8/2/2019 BO Universe_v1.0
28/61
We have following three tables (Customer, age_group and sales).Write a query which gives us age_group_wise amount and Quantitysold.
Customer
Cust_id Cust_name Age
Age_group Age_group_id Age_group_desc Min_age Max_age
Sales Sales_id Cust_id Sales_date
Qty Amount
Exercise
8/2/2019 BO Universe_v1.0
29/61
Each table in a schema contains data in one or more columnsthat correspond to user requirements. Linking all tables in theschema with joins ensures that you restrict the number of ways
that data from columns in different tables can be combined in aquery.
Joins limit column combinations between tables to matching or
common columns. This prevents result data being returnedthat contains information from columns that have no sensebeing matched.
Manual join defined in the Where clause for an object, arecreated at run time, so are not considered by Designer forintegrity checks and context detection.
Joins in BO
8/2/2019 BO Universe_v1.0
30/61
EQUI-Joins Link tables based on the equality between the values in the column of one
table and the values in the column of another. Because the same columnis present in both tables, the join synchronizes the two tables.
You can also create complex equi-joins, where one join links multiplecolumns between two tables.
Ex- Table1.column_a = Table2.column_a
Theta Joins Link tables based on a relationship other than equality between two
columns.
A theta join could use any operator other than the "equal operator.
Ex- to find the customers age between the minimum and the maximum(customer.age betweeen age_group.age_min and age_group.age_max )
Types of Joins
8/2/2019 BO Universe_v1.0
31/61
Types of Joins
Outer Joins- Link two tables, one of which has rows
that donot match those in the common column of
theother table.
- You define an outer join by specifyingwhich
table is the outer table in the original equi-join.
The outer table contains the column forwhich
you want to return all values, even if theyareunmatched.
Shortcut Joins
- Join providing an alternative path betweentwo
tables, bypassing intermediate tables,
8/2/2019 BO Universe_v1.0
32/61
To insert join, click join in the insert menu.
In the join editor, we haveto select the respective tablefrom the list boxes.
-The combo box in between thetable1 and table2 is to specify thejoin condition either it is innerjoin, outer join, etc.,
- The cardinality use to detect the
relationship between the twotables.
- In the expression, we can view
the joined key columns.
Working with Joins
8/2/2019 BO Universe_v1.0
33/61
Write a query against the following set of tables.
- Statewise, citywise, customerwise sales amount
- Satewise, Citywise, sales amount
- Citywise sales amount
City---------
City_idCity_nmState_id
state---------State_id
State_nmcountry
Customer-----------
Cust_idCust_nm
cust_phoneCity_id
Sales
---------Sales_idCust_id
QtyAmount
City_id
Exercise
8/2/2019 BO Universe_v1.0
34/61
Join Problems
8/2/2019 BO Universe_v1.0
35/61
Loop (Example1)
8/2/2019 BO Universe_v1.0
36/61
Loops
It also happens in the following model.
Say we have country table which referred by suppliers and
customers table Here when we design our schema, there will be one to many
relationship between country and supplier and there will be one tomany relationship between the country and customer.
In this case when we join supplier, customer and country we mayloose some records if we dont have the supplier and customer inthe same country.
In this case we loose records. So when we you are not getting theexpected number of rows, then you can check on the loops.
More than one path through the SQL
Problem:
Business Objects will not know what path to choose
Remove a j oin
One w ay of resolving t he Loop
Loops
8/2/2019 BO Universe_v1.0
37/61
Country(Region)
resort serviceline
service
Invoice_line
salescustomer
cityregion
Country_resort
Remove a j oin
Add an al ias
Loop / solve it using alias
L l i b
8/2/2019 BO Universe_v1.0
38/61
country
resort serviceline
service
Invoice_line
salescustomercityregion
Loop solving by context
8/2/2019 BO Universe_v1.0
39/61
Aliasing and Contexts for join
problems Alias
Aliases are references to existing tables in a schema. An Alias is atable that is an exact duplicate of the original table (base table), witha different name. The data in the table is exactly the same as theoriginal table, but the different name "tricks" the SQL of a query toaccept that you are using two different tables.
Context
Contexts are a collection of joins which provide a valid query pathfor BusinessObjects and WebIntelligence to generate SQL.
8/2/2019 BO Universe_v1.0
40/61
These functions are used in BO to generate SQL. This providesflexibility to change the select / where clause in the SQL.
@aggregate_aware- This is nothing but Query rewrite mechanism of Oracle database.
@Prompt
- Syntax: @Prompt(message,type,[lov],[MONO|MULTI],[FREE|CONSTRAINED])In the where clause you type the following functioncountry = @Prompt('Enter Country','A','Customers\Country','MONO','FREE')
@Where
- Usually we use this in the condition. You can restrict the result based on Geo
@ Functions
8/2/2019 BO Universe_v1.0
41/61
@Select
We use @select in the formula or derived dimension / detail objects.When we have cost and price as measures, then we create margin
measure using @Select function.
@Variable
You can use the variable in the where clause.
Usage - @variable(country_name)
@Script
- This is involving the VBA script. If you are dealing with generation ofcomplex where clause you use the SCRIPT variable. If I find any code I willpass it on to you. VBA macros can run only in Windows environment.
@ Functions
8/2/2019 BO Universe_v1.0
42/61
8/2/2019 BO Universe_v1.0
43/61
Hierarchies Are used to perform multidimensional analysis.
By default the class objects become the default hierarchy for theanalysis.
If you want to create customized hierarchies from differentclasses then create the custom hierarchy.
While we use the drill or slice and dice in BO or Webi you cansee these hierarchies so that you can use it for analysis.
8/2/2019 BO Universe_v1.0
44/61
Aggregate Awareness
@Aggregate_awareness
This is equivalent to Query re write option in Oracle database.
Three steps
Identify the summary tables
Higher aggregate tables (YYYY wise)
Medium aggregate table (QQ wise)
Low level aggregate table ( Month wise)
Detail table (Day wise)
Use Aggregate awareness functions in all the objects.
Set the properties in Aggregate Navigation.
O
8/2/2019 BO Universe_v1.0
45/61
A derived table is defined by an SQL query at the universe level
that can be used as a logical table in Designer.
Derived tables have the following advantages:
You can include complex calculations and functions in a derivedtable. These operations are performed before the result set isreturned to a document, which saves time and reduces the need forcomplex analysis of large amounts of data at the report level.
Derived tables can, in some cases, replace statistical tables that holdresults for complex calculations that are incorporated into theuniverse using aggregate awareness. These aggregate tables are
costly to maintain and refresh frequently. Derived tables can returnthe same data and provide real time data analysis.
Derived tables are similar to database views, with the advantage thatthe SQL for a derived table can include Business Objects prompts.
Derived Tables in BO
8/2/2019 BO Universe_v1.0
46/61
Derived tables are SQLqueries that Designertreats as tables. You can
use the columns returnedby these queries to buildobjects just as you usethe columns of normal
database tables.
To user can either typethe query or use the
tables and columns,operators and functions.
Creating Derived tables
The derived tables appears in the schema with the physicaldatabase tables.
S i h ill
8/2/2019 BO Universe_v1.0
47/61
Think you have customer table (cust_id, name, city) andsupplier table (supp_id, name, city).
End user wants to do analysis of customer and supplier basedon the city.
In this case you cannot join the supplier and customer table to
get the information. If you join the customer and supplier table with the city column
then it becomes many to many which inflates the results
So, in this case you can create a derived table with the followingselect
Select city from customer union select city from supplier
Now you do join the derived table with customer and suppliertables based on the city and do the analysis.
Scenario where you will use
Derived table
F T
8/2/2019 BO Universe_v1.0
48/61
Its a less common problemwhen we compared to Loops
and Chasm traps. Consecutive two One tomany relations at a stretchmay cause this problem.
(especially if you havemeasure in the middle table)
What is a Fan Trap?A fan trap occurs when joins fan out over multiple one -< manyrelationships in a row.
For example:
A -< B -< C
This is one of the reasons why it is important to set cardinalities in youruniverse design. If you dont set the cardinalities it becomes more difficult to
identify fan traps (and other design issues).
Fan Traps
S l F T D t
8/2/2019 BO Universe_v1.0
49/61
Sample Fan Trap Data
Sample Fan Trap Data- Its a subtle issue, so let me demonstrate with a simple example. Iwill use two hypothetical tables for this example. First is a tableused to store order information, and the second is used to store
details about the items for the order.- create table orders (order_id number(8) not null ,order_date date notnull ,order_budget decimal(11,2) not null);
- create table order_lines (order_line_id number(11) not null ,order_idnumber(8) not null ,item_id number(11) not null ,order_qtynumber(5) not null);
- There will be an order number object built from the orders.order_id
column. I will build a Total Order Budget measure object from theorders.order_budget column. And I will also create a measure objectcalled Total Order Quantity using the formula sum(order_lines.qty).This gives me one dimension object and two basic measure objects.
8/2/2019 BO Universe_v1.0
50/61
S l F T D t C t
8/2/2019 BO Universe_v1.0
51/61
If I include all three of the objects from my imaginary universe Iwould get this sql code, and the following results:
select orders.order_id
, sum(orders.order_budget), sum(order_lines.order_qty)from orders, order_lineswhere orders.order_id = order_lines.order_id
group by orders.order_id
The issue is that the line item total (sum) is correct, but the headertotal budget (also a sum) is way too high. If you look back at the raw
data shown earlier, you might notice that the budget amount hasbeen multiplied by the number of line items in the second table. Thisis a fan trap in action. The number of lines in the detail table has animpact on the measures from the header table.
Sample Fan Trap Data Cont
S l F T D t C t
8/2/2019 BO Universe_v1.0
52/61
In this case where I only have measure objects from the detailtable there is a very simple solution. I would open my universe andmark the Multiple SQL Statements for each Measure checkbox.And here is where the cardinality settings become important.
What this means it when the SQL generator sees the measuresand notes that they are spread across a one-many join, it will split
the query into two passes and then merge the results backtogether. So instead of the inflated results shown above I will getthese two sets of data:
Sample Fan Trap Data Cont
S l F T D t C t
8/2/2019 BO Universe_v1.0
53/61
There were only two rows processed by the first query, and sevenrows processed by the second query. There are two rows in eachresult set because of the group by clause. And when the queryresults are merged back together (in a process that is completely
transparent to the user, by the way) they will be correct.
So Far, So Good
The problem is this is not a complete solution. As long as I only
have measure objects from the lower (more detailed) table then thisshortcut will work. And as long as I never ever add a new table tothe universe, or add a new dimension or detail object, it will continue
to work. But its a fragile solution, because nothing has really beenfixed.
To solve this issue in the most robust and correct way possiblerequires setting up a couple of contexts and an alias.
Sample Fan Trap Data Cont
F T / U f d i d t bl
8/2/2019 BO Universe_v1.0
54/61
Cust
Cust_idCust_name
phone
Sales
Sales_idCust_id
Sales_amt
Call_records
Call_idSales_id
Sales_repCall_timing
Cust_name, sales_amount, total_time
Sales_cust
Sales_idCust_id
Fan Trap / Usage of derived table
Ch T
8/2/2019 BO Universe_v1.0
55/61
It happens in the D/W environment where we have multiple starschemas
When you have a confirmed dimension where we share the
same dimension key to more than one fact, we get more recordsthan we expected.
Consider we have product_dim, sales_fact (sales_perspective)and order_fact (supplier perspective), we get this chasm trap.
We create contexts in order to solve the issue. Context beingproduct sales in terms of customer, product orders in terms ofSupplier.
Chasm Trap
Chasm trap and Loop
8/2/2019 BO Universe_v1.0
56/61
location emp
project date
Timesheet payroll
dept
Location.loc_id = timesheet.loc_idProject.proj_id = timesheet.proj_idEmp.emp_id = timesheet.emp_idDate.date_id = timesheet.date_idEmp.emp_id = payroll.emp_idDate.date_id = payroll.date_idDept.detp_id = payroll.dept_idtimesheet payroll
Chasm trap and Loop -
Example2
Ch k I i
8/2/2019 BO Universe_v1.0
57/61
What does Check Integrityverify?
- Before examining the elements of the
universe against those of thedatabase, the function checks whetherthe connection to the database isvalid. If the connection is not valid, thefunction stops and returns an errormessage.
-Check Integrity can detect the
following types of errors: Invalid
syntax in the SQL definition of anobject, condition, or join.
Loops, Isolated tables, Isolated joins,
Loops within contexts, Missing or
incorrect cardinalities.
Check Integrity
Ch k I i
8/2/2019 BO Universe_v1.0
58/61
Note: The option Check Cardinalities can be slow to run with largeamounts of data. If there is ambiguous or missing data, results canalso be inaccurate. If your database is large, and may have
incomplete data entries, then you should not select the optionCheck Cardinalities.
Check Integrity
U i E
8/2/2019 BO Universe_v1.0
59/61
A universe must have a secured connection before it can beexported. If you created a universe with a personal or sharedconnection, you must create a new connection with a securedtype and assign it to the universe.
To export a universe to the repository.
- Select File > Export. The Export Universe dialog box appears.
- Select a universe folder from the Domain drop down list box. If theuniverse is in another folder on the file system, Browse to the folder.
If you want to lock the universe, double-click the universe name.
- A locked universe appears with a padlock symbol. To unlock a
universe, double-click it again.
- Click a group in the Groups list box. This is the user group that uses the
exported universe.
Universe Export
8/2/2019 BO Universe_v1.0
60/61
Universe Export
- Click a universe in the Universes list box. The Universes list box shows
the names of the active universes.
- If you want to export other universes that are not open, click the AddUniverse button, and then use the browser to select the other universes.
- Click OK. At the end of the export, DESIGNER displays a message. Click OK.
8/2/2019 BO Universe_v1.0
61/61
Thank you