Download Creating the data foundation

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Database wikipedia , lookup

Versant Object Database wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Clusterpoint wikipedia , lookup

Information privacy law wikipedia , lookup

Expense and cost recovery system (ECRS) wikipedia , lookup

Data vault modeling wikipedia , lookup

Business intelligence wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

SAP IQ wikipedia , lookup

Transcript
Lab: Multi Source Universe
Create a Universe Based on Two Relational Sources
Scenario
Create a universe based on two relational sources
Objectives
In this lab, you will:
 Create a universe that is based on both a MS SQL 2008 server database and on
a MySQL 5 database
 Create a relation between both sources
© SAP AG 2011 SAP BusinessObjects / Page 1
Scenario Background
Your company has an HR database with details about employees. The customer support department
has independently created a database for keeping track of case dispatch and customer satisfaction. Now
you wish to report the customer support database but using the official company employee information. To
do this you will need to link both data sources even though they were not written to be compatible.
Perform the following steps as described in order:
Preparing the environment in the Information Design Tool
1.
2.
3.
4.
5.
6.
Launch the Information Design Tool
On the main menu bar choose Window > Preferences
Select Window > Preferences..
Expand Information Design Tool and Data Foundation Editor
Select Detections
Make sure the Detect joins is UNCHECKED
7.
8.
9.
10.
11.
Click OK
Select File > New > Project
Name the project Multi Source Universe
Click Finish
Right click on the project and select New > Folder
© SAP AG 2011 SAP BusinessObjects / Page 2
12. Set the Folder name: to be MSU
Connect to the BOE BI 4.0 Server to Access Resources
1. Click Insert in the Repository Resources tab
2. Click Insert Session
3. In the new Open Session page enter the information listed for the BOE server:
System
bi40:6400
User Name
Administrator
Password
G0ldeneye
Authentication
Enterprise
4. Click OK
© SAP AG 2011 SAP BusinessObjects / Page 3
Create a connection to the MS SQL Server 2008 HR database
1. Expand bi40:6400 under Repository Resources
2. Expand Connections
3. Right click on Connections and select Insert Folder
4. Name the folder train-xx (where xx is either 01 or 02). Ensure this is unique on this machine.
5. Right click on the train-xx folder you have just created and select Insert Relational Connection
6. For the resource name use HR_MSSQL2008
7. Click Next >
8. Choose Microsoft > MS SQL Server 2008 > ODBC Drivers
9. Insert the following credentials
User name:
sa
Password:
G0ldeneye
Data source name: HR
© SAP AG 2011 SAP BusinessObjects / Page 4
10. Click Test Connection
11. Click Close
12. Click Finish
13. Right-click on your newly created connection and select Create Relational Connection Shortcut
14. In the Select a Local Project dialog, expand Multi Source Universe and select the MSU folder
15. Click OK
© SAP AG 2011 SAP BusinessObjects / Page 5
Create a connection to the MySQL 5.1 customer support database
1. Expand bi40:6400 under Repository Resources
2. Expand Connections
3. Right click on the train-xx folder you created and select Insert Relational Connection
4. For the resource name use Support_MySQL
5. Click Next >
6. Choose Sun > MySQL 5 > ODBC Drivers
7. Insert the following credentials
User name:
root
Password:
G0ldeneye
Data source name: customer_support
8. Click Test Connection
9. Click Close
10. Click Finish
© SAP AG 2011 SAP BusinessObjects / Page 6
11. Right-click on your newly created connection and select Create Relational Connection Shortcut
12. In the Select a Local Project dialog, expand Multi Source Universe and select the MSU folder
13. Click OK
14. You should now have the following in your local project
© SAP AG 2011 SAP BusinessObjects / Page 7
Creating the data foundation
1. Right click on your MSU folder and select New > Data Foundation
2. Use the Resource Name Employee Case Info
3. Click Next >
4. Select Multisource-Enabled
5. Click Next >
6. Ensure the session is set to bi40:6400. Use the credentials Administrator, G0ldeneye and Enterprise and
click Connect if required
7. Click Next >
8. Select the connections HR_MSSQL2008.cns and Support_MySQL.cns
9. Click Next >
10. If you wish, change the Color for Table Headers or leave it with the default
© SAP AG 2011 SAP BusinessObjects / Page 8
11. Click Next >
12. If you wish, change the Color for Table Headers or leave it with the default
13. Click Finish
14. Expand the HR_MSSQL2008 connection
15. Find the HR.dbo database
16. Select employee and job_title using Ctrl and drag the tables into the Master Data Foundation view
17. Expand the SUPPORT_MYSQL connection
18. Select case_info and user_data using Ctrl and drag the tables into the Master Data Foundation view
19. Click Arrange Tables (
)
© SAP AG 2011 SAP BusinessObjects / Page 9
Create the joins
1. Link the employee tables job_id column to the job_title tables job_id column
2. Link the user_data tables internal_id column to the case_info tables internal_user_id column
3. You data foundation should look like this:
We will now link the tables employee > user_id column from the MS SQL Server 2008 database and the
user_data > logon column from the MySQL database. First, let’s check the contents of these two columns
4. Right-click employee tables user_id column and select Show Column Values...
Note the user_id column contains the user id in integer format.
Now compare this against the user_data tables logon column
5. Close the Show values window
6. Right-click user_data tables logon column and select Show Column Values...
7.
8.
9.
10.
In this table logon is what the user uses to logon to the system. The logon is the similar to the user_id
column from the employee table except that it is a string, starting with an i followed by the users user_id
represented as a 5 character string with leading zeros.
Close the Show values window
Link the employee tables user_id column to the user_data tables logon column
Right-click on the new join and select Edit Join...
You will see the following Expression:
@catalog('HR_MSSQL2008')."HR.dbo".employee."user_id"=@catalog('SUPPORT_MYSQL')."PUBLIC".
user_data."logon"
This will not work because the two formats are not compatible (one is a string and the other an integer. It will
generate an error at runtime.
To make them compatible we will take the right hand 5 characters and convert them to an integer. We can use
the right() and toInteger() functions to do this:
Replace the Expression with the following one:
@catalog('HR_MSSQL2008')."HR.dbo".employee."user_id"=toInteger(right(@catalog('SUPPORT_MYS
QL')."PUBLIC".user_data."logon",5))
© SAP AG 2011 SAP BusinessObjects / Page 10
An alternate way of doing this would be to create a derived column in the MySQL user_data table
which already has the logon script converted to an integer using a similar formula. The join would
then be between this derived column and the user_id column of the HR employee table and would
not require you to update the join as the calculated is done elsewhere.
11. Click Validate
12. Click OK
13. Click Arrange Tables (
)
14. Ensure no joins are selected
15. Click Detect (
) and choose Detect Keys
16. Click Detect (
) and choose Detect Cardinalities
17. Select all joins and choose Detect Selected
18. Click Finish
19. Click File > Save All
© SAP AG 2011 SAP BusinessObjects / Page 11
Creating the business layer
1. Right-click on your MSU folder in the Local Projects and choose New > Business Layer
2. Select Relational Data Source
3.
4.
5.
6.
7.
Click Next >
In the Resource Name type Employee Case Info
Click Next >
Click the
button
Select you Employee Case Info.dfx Data Foundation
8. Click OK
9. Select the Automatically create classes and objects for all connections
© SAP AG 2011 SAP BusinessObjects / Page 12
10. Click Finish
11.
12.
13.
14.
15.
Click Expand All (
)
Delete the following from the Employee folder: User Id, Job Id
Delete the following from the Job Title folder: Job Id
Delete the following from the Case Info folder: Internal User Id
Delete the following from the User Data folder: Internal Id
Test the results
1. Click the Queries pane within the Business Layer
2. Insert Query (
)
3. In the Query Panel click Expand All (
)
4. Use Ctrl to select First Name, Surname, Title, Nickname and drag them into the result objects pane
5. Use Ctrl to select only Case Number and Customer Satisfaction Pct and drag them into the result objects
pane
© SAP AG 2011 SAP BusinessObjects / Page 13
6. Click Refresh in the Data Preview pane
7. Click OK
8. Name the Query Employee Case Information
9. Select File > Save All
© SAP AG 2011 SAP BusinessObjects / Page 14
Publish the universe
1. In the local projects view, right-click the Employee Case Info and select Publish > To a Repository...
2. Click Next >
3. Click Insert Folder (
)
4. Name the folder the same as your train user (e.g. train-xx where xx is 01 or 02)
5. Select this new folder
6. Click Finish
Your universe is now ready for use with BOE BI 4.0
End of lab
© SAP AG 2011 SAP BusinessObjects / Page 15