You are on page 1of 33

Universe Design Exercises

Exercise 1: Populating the Universe Structure


Insert the tables listed below into your blank PrestigeMotors universe.
1. CLIENT
2. COLOUR
3. COUNTRY
4. FINANCE_PERIOD
5. MAKER
6. MODEL
7. REGION
8. SALE
9. SALES_PRICE_RANGE
10. SALE_MODEL
11. SHOWROOM
12. STYLE

And layout the table as stated below:

Universe Design Exercises Version 1.0

Exercise 2: Defining Joins in a Universe


Insert joins between tables in your Motors universe and set cardinalities.

Instructions:
1.
2.
3.
4.
5.
6.

Insert the following equi-join using the drag-and-drop technique:


COUNTRY.COUNTRY_ID to REGION.COUNTRY_ID
Set the cardinality for the join manually in the Edit Join dialog box.
Insert the following Equi-Join using the Edit Join dialog box and set the cardinality.
REGION.REGION_ID to CLIENT.REGION_ID
Check integrity for:
Universe structure and joins
Notice the divergences found in the integrity check of your Motors universe, which is the result of having
unjoined tables.
Complete the universe and ensure the following joins and cardinalities are included in the universe
structure:

Universe Design Exercises Version 1.0

7. Save the changes to your Universe.

Exercise 3: Creating and testing Classes and Objects

Create Classes, Subclasses, Dimension, and Detail Objects

Instructions
1.

2.

Create the following classes:


Client

Car

Showroom

Sales

Finance_Period
Create objects for each of the classes as identified in the tables. Some of the properties for each object
have been specified for you. However, you need to determine the data type, qualification (dimension or
detail), and whether or not an LOV should be associated with each object:

Universe Design Exercises Version 1.0

Universe Design Exercises Version 1.0

3.

4.

Create the following subclasses:


Sale Prices (subclass of Car)
Sales Details (subclass of Sales)
Sales Dates (subclass of Sales)
Create objects for each of the subclasses as identified in the tables below. Some of the properties for each
object have been specified for you. However, you need to determine the data type, qualification
(dimension or detail), and whether or not an LOV should be associated with each object.

Universe Design Exercises Version 1.0

5.
6.

Ensure you have defined each object using the appropriate object type.
The Universe pane in Universe Designer should appear similar to this:
Check the integrity of the objects, and make any alterations required.
Note: Test the validity of the joins also.

7.
8.

Save your universe locally. Test the universe by building queries in Web
Intelligence Rich Client using the new objects.
Launch Web Intelligence Rich Client and log on using the credentials
provided by the instructor.
Tip: Ensure to maximize the Web Intelligence Rich Client
screen to enhance visibility ofmenu options.

9.
10.
11.

12.
13.

Select the create a new document based on a data source icon. Select
Browse for more data sources.
In the Data source selection menu select Universe, and click Next.
Select your local Motors universe, and click OK. Your universe appears
italicized. This indicates that this is a local copy of the universe rather
than an exported version.
Build a new query using the objects you have created. Drag and drop
the objects into the Result Objects pane.
Click Run Query to view the final results displayed in the report.

Exercise 4: Creating and testing Measure Objects


Instructions
1.
2.

Create the following subclass in the Sales class:


Sales Figures
Create measure objects in the new Sales Figures subclass as identified in the tables below. The SQL code
for the SELECT properties of each object has been specified for you. However, you need to determine the
appropriate projection function aggregate.

Universe Design Exercises Version 1.0

3.

Tip: When using the Number of Cars Sold, and Cost of Car Sales objects, ensure that the result is always
restricted to Sales data.
Create measure objects in the classes as identified in the tables below. The SQL code for the SELECT
properties of each object has been specified for you. However, you need to determine the appropriate
projection function aggregate.

Universe Design Exercises Version 1.0

4.
5.
6.
7.

Save your universe locally.


Log onto Web Intelligence Rich Client, and test the Sales Revenue object by running three queries.
Create a new query based on your Motors universe, with only the Sales Revenue object. Note the value
returned.
Test the Sales Revenue measure object by adding a second query, using the following steps:
Edit the query created in the previous step, and click Add Query.
Select your universe.
Create a new query with Country and Sales Revenue. Check the SQL and note the GROUP BY
clause. It should contain the SQL for country.
Click Run Queries.
Note: You are prompted to select a way to display the new query. You can
leave the default option to add a new tab to the report or you can select the
option to display the table in the current report.

8.

Apply a sum calculation to the Sales Revenue column in the new projected block. Select the Sales
Revenue column, activate the sum drop-down list in the toolbar, and select sum. Does the sum
match the value shown in the first table? Note the sales revenue value in a row of the block (for
example, USA).
Test the Sales Revenue measure object by creating a third query, using the following steps:
Edit the second query and then click Add Query.
Create a new query with Country, Region, and Sales Revenue.
Check the SQL and note the GROUP BY clause. It should now contain the SQL for country and
region. Click Run Queries.
Apply a break to the Country column and apply a sum calculation to the Sales Revenue column of
the new projected block. Does the country group sum match the value of the noted block row in
the second table (for example, USA)?
Edit the query. Change the projection to the block from the microcube by removing the Region
column from the block. Does it aggregate to country level correctly?
Edit the query again. Change the projection to the block from the microcube by removing the
Country column from the block. Does it aggregate to the total sales revenue level correctly?
Edit the query again. Add the Showroom and Maker objects.
Using drag and drop, insert two new tables, one to show Showroom and Sales Revenue, and the
other to show Maker and Sales Revenue, and apply a sum to both tables. Note that the total
values remain the same. The final version of the report should look similar to this:

Universe Design Exercises Version 1.0

9.

Test the other measure objects in Web Intelligence Rich Client.

Exercise 5: Creating and using a Delegated Measure:

Instructions
1. In Universe Designer, open your Motors universe file.
2. In the Sales Figures class, create a new measure called Average Sales Total with
the following syntax:
avg(SALE.SALES_TOTAL)
In the Properties tab, set the aggregation function to None.
3. Save the universe and log onto Web Intelligence Rich Client.
4. Create a new query using the Region and the Average Sales Total objects. Click
Run Query.
5. Select the Average Sales Total column and select the average function from the
toolbar. Activate the sum drop-down list and select average. Evaluate the result.
6. Edit the query and add Number of Cars Sold. Evaluate the average value that is
shown at the bottom of the Average Sales Total column. Does this reflect the
correct average per Region?

Universe Design Exercises Version 1.0

7. Return to Universe Designer and copy the Average Sales Total object and paste it
in the same class. Name the copied object Delegated Sales Total Average. Ensure
the Associate a List of Values option for the Delegated Sales Total Average
measure is cleared.
8. In the Properties tab, set the aggregation function to Database delegated. Save
your universe locally.
9. Return to Web Intelligence Rich Client.
Tip: To ensure that your new version of your universe is available, go to Tools
Universes and refresh the list.
10.Create a new query with the Region, Average Sales Total, and the Delegated Sales
Total Average objects.
11.Add an average to the Average Sales Total column, as done in step 5.
12.Drag the Delegated Sales Total measure object from the Data tab and position it in
the cell at the bottom of the Delegated Sales Total column. Drop the Delegated Sales
Total measure object in the cell at the bottom of this column.

Note that the cell now displays a text string: #TOREFRESH. This indicates that the
average is not calculated by Web Intelligence Rich Client, but it must be calculated
by the database. You need to refresh the document to retrieve the calculated results
from the database.
13.Click Refresh Data.

Universe Design Exercises Version 1.0

10

You see here that the average calculated by the database does not return the same value as
the value calculated by Web Intelligence Rich Client.
Because the database has access to the detailed data concerning all satisfaction levels in
these regions, the result is based on a weighted average. The database is able to take into
account the difference in numbers of customers per region.

Exercise 6: Using Aliases to Resolve Loops:


Instructions
In this activity new tables, new joins, cardinality, are inserted into your Motors universe.
These result in loops in your universe structure. Resolve these loops and test the results in
Web Intelligence Rich Client.
1. Insert the following join and set its cardinality.
COUNTRY.COUNTRY_ID = SHOWROOM.COUNTRY_ID
2. Use the Detect Loop toolbar button to test for loops in your universe. To solve the
loops that you have detected by creating alias tables, press the Insert Aliases button
in the Loop Detection dialog box, or use the Insert Alias toolbar button and create
two alias tables called:
COUNTRY_SHOWROOM
COUNTRY_REGION
COUNTRY_MAKER
3. Disconnect the original COUNTRY table from the other tables and use the alias tables to
redefine the joins as follows:
COUNTRY_SHOWROOM.COUNTRY_ID = SHOWROOM.COUNTRY_ID
COUNTRY_REGION.COUNTRY_ID = REGION.COUNTRY_ID
COUNTRY_MAKER.COUNTRY_ID = MAKER.COUNTRY_ID
Note: Ensure that the join cardinality for the last join is set to one-to-many (1-N).

Universe Design Exercises Version 1.0

11

4. Create the following object in the Showroom class:

7. Check integrity by selecting the Check Integrity button in the toolbar. The check
integrity tool finds divergences because the COUNTRY table is now isolated. Ignore this
message and dont delete the original table.
8. Save the universe.
9. Test your changes in Web Intelligence Rich Client by building the following queries:

10.
11.
12.
13.
14.

15.

Showroom Country, Showroom, and Sales Revenue.


Client Country, Client Name, and Sales Revenue.
Maker Country, Maker, and Model.

In Universe Designer, open your blank Staff universe. You want to report on managers
and their staff.
Add the EMPLOYEE table to the structure and create a self-referencing join, joining the
EMP_ID and EMP_MGR_ID columns.
Create a class called Staff.
Create an Employee dimension object based on the EMPLOYEE table. Concatenate the
employee's last name and first name.
Test the object by displaying the List of Values in the Properties tab. Is this returning
the correct results?
Tip: To get the query to infer the correct SQL, you need to resolve the selfreferencing join in the universe structure.
Create an alias table of the EMPLOYEE table and rename it MANAGER.

Universe Design Exercises Version 1.0

12

16.

Join the tables as shown below:

Create a Staff Class. In the Staff class create a Managers dimension object based
on the MANAGER alias table. Concatenate the manager's last name and first name
columns.
Check the integrity of the Staff universe with all except the cardinality options
checked. Resolve any relevant divergence.
Tip: You should not find any divergences.
Save your Staff universe, and test the results in Web Intelligence Rich Client as
follows:

17.
18.

a. Run a query using Manager and Employee. Add a count on both columns.
b. Add a query with only the Manager object. Add a count. Is this the correct value?
c. Open your Staff universe in Universe Designer and edit the Manager object. To ensure
that the data is restricted to only manager data, use the Tables button. Select the
EMPLOYEE table, to force the object to use the join between the table and restrict the
data.
d. Test the result, creating a new query with only the Manager object. It returns the
correct number of managers.
e. Edit the query and add Employee. Run and display the count. There are 26 rows.
Why? The join restricts the data to look only for employees that have managers.
However, there is a manager that does not have a manager, and is now excluded.
f. Open your Staff universe in Universe Designer and add an outer join on the MANAGER
table side.
g. Save the changes and test the results in Web Intelligence Rich Client.

Exercise 7: Using contexts to resolve loops Objective

Resolve loops by using contexts

Instructions
In this activity new tables, new joins, and cardinality, are inserted into your Motors
universe. These result in loops in your universe structure. Resolve these loops and test the
results in Web Intelligence Rich Client.

Universe Design Exercises Version 1.0

13

1. In Universe Designer, create the following aliased tables:

RENTAL (alias of SALE)


RENTAL_MODEL (alias of SALE_MODEL)

2. Insert the RENTAL_PRICE_RANGE table. Select the Manager object and select the
Tables button.
3. Insert the following joins and set their cardinality.

4. View loops using the loop detection tool.


Tip: You should find 10 loops.
5. Resolve the loops by using the context detection tool.
6. Edit the RENTAL_MODEL context as follows:

Change the name of the context to RENTALS (RENTAL_MODEL).

Tip: To avoid overwriting, ensure that the modified context is renamed, and a
best practice is to add the original table name in brackets after your
customized context name, for example, RENTALS (RENTAL_MODEL), and
SALES (SALE_MODEL). That way, you know what the original table was, so

Universe Design Exercises Version 1.0

14

when you get asked for the context, you can recognize that customization has
been applied.

As a description for the context enter: Returns information on cars rented.

Remove the following join from the context list:


MODEL.MODEL_PRICE between
SALES_PRICE_RANGE.PRICE_RANGE_MIN and
SALES_PRICE_RANGE.PRICE_RANGE_MAX

Ensure the following self-restricting join is added to the context (if the
cardinality is set to 1:1, this join is automatically added to the context):
RENTAL.SALE_TYPE = 'R'

7. Edit the SALE_MODEL context as follows:


Change the name of the context to SALES (SALE_MODEL).
As a description for the context enter: Returns information on cars sold.
Remove the following join from the context list:
MODEL.MODEL_DAYRENT between
RENTAL_PRICE_RANGE.RENT_RANGE_MIN and
RENTAL_PRICE_RANGE.RENT_RANGE_MAX

Ensure the following self-restricting join is added to the context (if the
cardinality is set to 1:1, this join is automatically added to the context):
SALE.SALE_TYPE = 'S'

8. Create a class called Rentals above the Sales class.


9. Create the following subclasses in the Rentals class:
Rental Details
Rental Dates
Rental Figures
10.Create the following four objects in the appropriate subclass of the Rentals class:

Universe Design Exercises Version 1.0

15

Note: RENTAL.DAYS_RENTED RENTAL.SALE_RENTAL_PERIOD

is not is table,

Use

11.Create a subclass called Day Rental Charges in the Car class, and then populate the
subclass with the following objects:

12.A requirement is raised from managers wanting to see which showrooms have which
franchises. Queries made for this requirement should bypass the sales and rentals
contexts.
A linking table between SHOWROOM and MAKER, together with a new context, is
required to return these results. Insert the table named FRANCHISE in the universe
structure. Insert the joins specified below and set cardinalities:
SHOWROOM.SHOWROOM_ID = FRANCHISE.SHOWROOM_ID
FRANCHISE.MAKER_ID = MAKER.MAKER_ID
13.Create a FRANCHISE context with the following joins:
SHOWROOM.COUNTRY_ID = COUNTRY_SHOWROOM.COUNTRY_ID
MAKER.COUNTRY_ID = COUNTRY_MAKER.COUNTRY_ID
FRANCHISE.MAKER_ID = MAKER.MAKER_ID
FRANCHISE.SHOWROOM_ID = SHOWROOM.SHOWROOM_ID

Universe Design Exercises Version 1.0

16

Detect this new context using the method of your choice.

Tip: In this instance, it is unnecessary to remove existing contexts and


redetect them as they are not affected by the FRANCHISE table and its
joins.
14.Create the following object in the Showroom class, and then use it in a query to test
that the context has resolved the loop correctly.

15.Launch the Universe Designer Query Panel via Tools Query Panel. Add the
Showroom and Franchises objects to the Result Objects pane and view the SQL.
Does this query bypass the sales and rentals contexts?
Tip: Use the Tables button for the Franchises object to ensure only the
FRANCHISE context is used.
16.Insert the MODEL_COLOURS table and join it to MODEL and COLOUR tables, by
inserting the following joins:
COLOUR.COLOUR_ID = MODEL_COLOURS.COLOUR_ID (1-N)
MODEL.MODEL_ID = MODEL_COLOURS.MODEL_ID (1-N)
Adding this table, allows users to report on models of any color regardless of
whether they are for sale or for rental.
17.Create a new MODEL_COLOURS context.
18.In the Car class, create a new Colors detail object (associated to the Model
dimension).
19.Check the integrity of the Motors universe with all options except cardinality
checked. Resolve any relevant divergence.
20.Save your Motors universe and close it.
21.Save your universe and then test the contexts used to resolve the loops by building
the following queries in Web Intelligence Rich Client:
o Showroom and Sales Revenue. The inferred SELECT statement for this
query should use the SALES (SALE_MODEL) context.
o Showroom and Rental Revenue. The inferred SELECT statement for this
query should use the RENTALS (RENTAL_MODEL) context.
o Showroom, Sales Revenue, and Rental Revenue. This query should infer
two SELECT statements, one for each context.
o Showroom, Model, and Maker. With this query, a dialog box should appear
asking which context to use.
o Showroom and Franchises. With this query, the FRANCHISES context
should be used. Resolving Loops

Exercise 8: Resolving Chasm traps


Detect contexts to resolve a chasm trap in the universe structure.
Instructions

Universe Design Exercises Version 1.0

17

1. Create a new universe called Chasm_xx, where "xx" is your initials. Use your
MotorsODBC_xx connection to connect to the Motors database.
2. Select File Parameters from the menu bar or click the Parameters button and select
the SQL tab.
3. Clear the Multiple SQL statements for each measure option by clearing the check
box.
4. Add the following tables:

CLIENT
SALE
RENTAL (as an alias of the SALE table)

5. Create the following joins and set the cardinality:

6. Create two classes:


Chasm Objects
Measures
7. Add the following objects with the following syntax:

Universe Design Exercises Version 1.0

18

8. Perform an integrity check on:


a. Check Universe Structure. Parse Objects, Parse Joins
9. Select File Save As to save your universe locally.
10.In Web Intelligence Rich Client, create a new document with two control queries to
display the correct sales and rental figures for Paul Brent in your Chasm universe.
In the first query, use the Sales Revenue, and Client Name objects. Select the
Client Name object, and click the Apply a Quick Filter button. From the List of
Values, select Brent, Paul.
In the second query, use the Rental Revenue, and Client Name objects. Select
the Client Name object, and click the Apply a Quick Filter button. From the List of
Values, select Brent, Paul.
11.Click Run Queries and view the results in the report.
What is the sale amount?
What is the rental amount?
12.In the same report add a new table by clicking the Edit Query button. Click Add Query,
and create a new query using the Sales Revenue, Rental Revenue, and Client Name
objects. Select the Client Name object, and click the Apply a Quick Filter button. From
the List of Values, select Brent, Paul.
13.Click View SQL to check the SQL statement generated.
14.Click Run Queries and select the Insert a table in the current report option.
What is the sale amount in the new table?
What is the rental amount in the new table?
What happened to your figures?
15.In Universe Designer, edit the universe by clicking FileParametersSQL tab, and
select the Multiple SQL statements for each measure option.
16.Save your universe locally.

Universe Design Exercises Version 1.0

19

17.In Web Intelligence Rich Client, create a new document using the Sales Revenue, Rental
Revenue, and Client Name objects. Select the Client Name object, and click the Apply a
Quick Filter button. From the List of Values, select Brent, Paul. Click View SQL to check
the SQL statement generated.
Tip: You may need to refresh the universes list to get the latest version of your
universe.
Select Tools Universes and click Refresh.
What is the sale amount?
What is the rental amount in the new table?
What happened to your figures?
18.Edit the query by clicking the Edit Query button on the toolbar.
19.Remove the Sales Revenue, and the Rental Revenue objects. Add the Sale Date, and
Rental Date objects. Click Run Query.
What happens to the SQL and to the results?
20.In Universe Designer, edit the universe by clicking FileParametersSQL tab and clear
the Multiple SQL statements for each measure option again (clear the check box).
21.Insert the following contexts:

22.Save your universe locally.


23.In Web Intelligence Rich Client, create a new query with the Client Name, Sales
Revenue, and Rental Revenue objects. Select the Client Name object and click the Apply
a Quick Filter button. From the List of Values, select Brent, Paul.
What is the sale amount?
What is the rental amount?
What happened to your figures?

Exercise 9: Resolving fan traps


Detect contexts to resolve a fan trap in the universe structure.
Instructions
1. Create a new universe called Fan_xx, where "xx" is your initials. Use your
MotorsODBC_xx connection to connect to the Motors database.

Universe Design Exercises Version 1.0

20

2. Select File Parameters from the menu bar or click the Parameter button and select
the SQL tab.
3. Clear the Multiple SQL statements for each measure option by clearing the check
box.
4. Add the following tables:
CLIENT
SALE
SALE_MODEL
5. Create the following joins and set the cardinality:

6. Create two classes:


Fan Objects
Measures
7. Add the following objects with the following syntax:

Universe Design Exercises Version 1.0

21

8. Perform an integrity check on:


Check Universe Structure
Parse Objects
Parse Joins
9. Select File Save As to save your universe locally.
10.In Web Intelligence Rich Client, create a new document using the Sales Revenue and
Client Name objects. Select the Client Name object and click the Apply a Quick Filter
button. From the List of Values, select Randall, Sean.
11.Click Run Query and view the results in the report.
What is the sale amount?
12.Edit the query and add the Number of Cars Sold object.
What is the sale amount now?
What is the total number of cars sold ?
13.In Universe Designer, edit the universe by clicking FileParametersSQL tab and
select
the Multiple SQL statements for each measure option.
14.Save your universe locally.
15.In Web Intelligence Rich Client, create a new document using the Sales Revenue,
Number
of Cars Sold, and Client Name objects. Select the Client Name object and click the
Apply
a Quick Filter button. From the List of Values, select Randall, Sean.
Tip: You may need to refresh the universes list to get the latest version of your
universe.
Select Tools Universes and click Refresh.
16.Click Run Query and view the results in the report.
What is the sale amount?
What is the total number of cars sold ?

Universe Design Exercises Version 1.0

22

17.Edit the query and add the Model ID object.


What is the total sale amount?
What is the total number of cars sold?
How many different models were purchased?
What happened to your figures?
Tip: To retrieve the sum value, highlight the relevant measure column without
highlighting the header, and select the Insert Sum toolbar icon.
18.In Universe Designer, edit the universe by clicking FileParametersSQL tab and
clear the Multiple SQL statements for each measure option by clearing the check
box. Select the Multiple SQL statements for each context option if it is not already
selected.
19.Add an alias to the SALE table (SALE2).
20.Create the following joins:

Note: Force the cardinality on CLIENT.CLIENT_ID=SALE2.CLIENT_ID join to 1:N.


21.Use the Detect Contexts button to detect contexts. Be sure you have the following
contexts. You may have to edit the context by removing or adding joins.

22.Modify the definition of the object that is performing multiple aggregations so that it
points to the alias table:

Universe Design Exercises Version 1.0

23

23.Save your universe locally.


24.In Web Intelligence Rich Client, create a new document using the Sales Revenue,
Number of Cars Sold, and Client Name objects. Select the Client Name object and
click the Apply a Quick Filter button. From the List of Values, select Randall, Sean.
25.Click Run Query and view the results in the report.
What is the total sale amount?
What is the total number of cars sold?
How many different models were purchased?

What happened to your figures?

Q & A:
Q. Describe two ways to resolve chasm traps.

Q. Describe three ways to resolve fan traps.

Exercise 10: Applying restrictions

Apply enforced restrictions to objects and tables and create optional restrictions using
condition objects.

Instructions

The sales staff of Prestige Motors needs to drill from Day Rental Range through Model Day
Rental Charge to Model for Rental to deal with queries from potential customers.

1. Create a Model for Rental dimension object in the Day Rental Charges subclass. This

object has the same SELECT properties as the Model object.


2. Add a WHERE restriction to the Model for Rental object so that only models available

for rent are returned. The restriction is:


MODEL.MODEL_DAYRENT IS NOT NULL
3. Create a US Clients dimension object in the Client class below the Client Name object

with the settings:

Type = Character

Description = Returns only data for clients in the USA

Select syntax:
CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME

Universe Design Exercises Version 1.0

24

Where syntax:
COUNTRY_REGION.COUNTRY_NAME = 'USA'

4. Create another object in the Client class for UK Clients.


5. Save your universe locally and then test the two new Client objects in Webi Rich

Client:

Build a query containing UK Clients, US Clients, and Sales Revenue objects. The

query returns no data because of the conflict of restrictions.


6. In Universe Designer, create a new subclass below the Sales class called Annual

Revenue. Populate it with separate Sales Revenue measure objects for the calendar
years 2003 and 2004 as indicated below. Use the CASE function.

2003 Sales Revenue

2004 Sales Revenue

7. In the Annual Revenue subclass create two separate Sales Revenue measure objects

related to financial years FY03-04 and FY04-05 as indicated below. Use the CASE
function.

Sales Revenue for FY03-04

Sales Revenue for FY04-05

8. Save your universe locally, then test the two new calendar year Sales Revenue

objects in Webi Rich Client:

Build a query containing Showroom, 2003 Sales Revenue, and 2004 Sales Revenue
objects.

Replace the 2003 Sales Revenue and 2004 Sales Revenue objects with the Sales
Revenue for FY03-04 and Sales Revenue for FY04-05 objects.

9. Remove the US and UK objects in the Client class that you just created, and create

the following condition objects instead:

A condition object for US Clients.

A condition object for European Clients.

A condition object for Other Clients.

10. Save your universe locally and test each restriction by building a query in Web

Intelligence Rich Client.


11. Run a query using Showroom Country to see the list of countries that have

showrooms.

Universe Design Exercises Version 1.0

25

12. In Universe Designer, edit the properties of the Showroom Country object by

adding the Showroom table to the list of tables associated with the object. Use the
Tables button in Edit Properties Definition of the object.
13. Save your universe locally.
14. In Web Intelligence Rich Client, run the above query again and compare the results.
15. In Universe Designer, ensure that the Client Country object only returns the
countries in which clients exist, whichever query is run. Do this by adding the Client
table to the list of tables associated with the object.
16. Edit the Maker Country object in the same way to ensure that it only returns the
countries in which car makers exist.
17. Edit the Franchise object so that it automatically infers the FRANCHISE context
instead of prompting the user to choose among the SALES, RENTALS, and
FRANCHISE contexts. This allows end users to report on the franchises and their
location regardless of sales or rentals information. Use the Tables button to highlight
the MAKER and FRANCHISE tables.
18. Check the integrity of your universe.
19. Save your universe locally.
20.

Exercise 11: Using @functions

Apply @functions to objects and condition objects.

Instructions
Continue to work with the Model for Rental dimension object that you created in the
Day Rental Charges subclass. This object returns all models available for rental. This
is to be used by sales staff and requires further restriction to a specific showroom.

1. Add the following @prompt syntax in the WHERE clause of the Model for Rental
dimension:
SHOWROOM.SHOWROOM_NAME = @prompt
('Select showroom name','A','Showroom\Showroom',mono,constrained)
o Note: When inserting the @prompt function, it automatically inserts seven
commas. You may need to remove the remaining two commas in the
@prompt syntax, to make the syntax work correctly.
o Note: Parse the syntax. Parse fails as there is no SELECT statement defined
in the object.
2. The SELECT properties of the Model and Model for Rental objects are the same. Use
the @select in the Model for Rental object to point to the SELECT properties of the
Model object.
3. Create a new condition object called Showroom Rental Model in the Showroom class.
The WHERE clause restrictions for this condition already exist in the Model for Rental
object. Use the @where function in the condition object to point to the where
properties of the Model for Rental object.
4. Create a new class called Where Restriction Objects.
5. Create two new objects to go into the Where Restriction Objects class as follows:

Rental Model containing the restriction:

Universe Design Exercises Version 1.0

26

MODEL.MODEL_DAYRENT IS NOT NULL

Showroom Choice containing the restriction:


SHOWROOM.SHOWROOM_NAME = @prompt
('Select showroom name','A','Showroom\Showroom',mono,constrained)

Note: When inserting the @prompt function, it automatically inserts seven


commas. You may need to remove the remaining two commas in the
@prompt syntax to make the syntax work correctly.
Note: Parse the syntax. Parse fails as there is no SELECT statement defined
in the object.

6. Hide the Where Restriction Objects class.


7. Edit the following object and condition object so that the WHERE clause of each
contains no SQL code, but instead uses @where functions to point to the WHERE
clause restriction objects.

Model for Rental object inherits the Rental Model objects WHERE clause.
Showroom Rental Model condition object inherits the Showroom Choice
objects WHERE clause, and it should also point to the Rental Model object in
the same hidden class to ensure they are rentals that are returned.

8. Create a Maker Choice condition object under the Car class that, when used in a
query, produces a prompt dialog box requesting the user to enter a single
manufacturer.
9. Check the integrity of the universe.
Note: The Integrity Check dialog box alerts you regarding the two hidden
objects.
10. Save your universe locally.
Note: Remember to test your solution in Web Intelligence Rich Client.

Exercise 12: Using Hierarchies

Infer default hierarchies and create custom hierarchies for your Motors universe.

Note: Switch back to default hierarchies if you have followed along during this lesson.
Instructions
1. To view all hierarchies, click the hierarchy button. Remove all custom hierarchies in
the Custom selection list.
2. Check that the hierarchical order of the dimension objects in the Client class is based
on geography.
The geographic hierarchy is: Country -> Region -> Area -> Town.
3. Save your universe locally, and then test the default hierarchy in Web Intelligence
Rich Client.

Universe Design Exercises Version 1.0

27

4. Create the following dimension objects using the automatic time hierarchy method:
Sale Year, Sale Quarter, and Sale Month.
5. Save the universe locally, and then test the resulting hierarchy in Web Intelligence
Rich Client.
When you run the query, view the SQL and note the scalar function used.
6. Using the automatic time hierarchy method poses some limitations.
Remove the automatically created Sale Year, Sale Quarter, and Sale Month objects,
and replace them with manually created objects, using numeric database scalar
functions:

Sales Year:
{fn year(SALE.SALE_DATE)}
Sales Quarter:
{fn quarter(SALE.SALE_DATE)}
Sales Month:
{fn month(SALE.SALE_DATE)}

7. Create the following dimension objects manually in the Rental Dates subclass, using
alphanumeric database scalar functions and formatting: Rental Year, Rental Quarter,
and Rental Month.

Rental Year:
'Calendar Year ' + datename(YYYY,RENTAL.SALE_DATE)
Rental Quarter:
'Q ' + datename(Q,RENTAL.SALE_DATE)
Rental Month:
datename(mm,RENTAL.SALE_DATE)

8. Check that the order of the dimension objects in the Financial Period class is based
on time.
9. Save your universe locally, and test the resulting hierarchies in Web Intelligence Rich
Client.
10. Prestige Motors wants to analyze clients geographically (by Country, Region, and
Town) but then further analyze the breakdown of client expenditure by financial
year. Create a custom hierarchy to allow users to do this by including the Country,
Region, Town, and Financial Year objects in the hierarchy.
11. Make the following default hierarchies available to the user:

Car
Day Rental Charges
Showroom
Financial Period
Rental Dates
Sale Dates

Universe Design Exercises Version 1.0

28

12. Save your universe locally, and test the resulting hierarchy in Web Intelligence Rich
Client.
13.Sales people want to drill down to a model using a specific drill path. In the bottom
of your custom hierarchy list, create a hierarchy to allow this drill path using the
following objects:

Showroom Country
Showroom Name
Maker
Model

14. Save your universe locally, and then test the resulting hierarchy in Webi Rich Client.

Exercise 13: Using a Cascading LOV in Webi Rich Client

Associate a Cascading LOV to an object.

Instructions
1. In Universe Designer, create a cascading LOV using the Maker, Category of Car, and
Model objects in the Car class.
2. Save your universe locally.
3. Build a query in Web Intelligence Rich Client that shows the number of cars sold per
showroom and prompts the users to select the Category of Car that they want to see
in the report.
Note: At the end of this activity, please remove the Cascading List of Values using the
following steps:

In Universe Designer, change the object definition to associate a standard list of


values for all objects in the Car class. Save your universe locally.

Exercise 14: Adding Derived Tables

Create a derived table that shows the number of transactions per customer.
Create a nested derived table.

Instructions
1. Using your Motors universe, insert a derived table to show the number of
transactions per customer.
2. Name the newly derived table DT_Best_Cust.

Universe Design Exercises Version 1.0

29

3. Create the SQL statement so that it looks like this:


SELECT
CLIENT.CLIENT_ID,
COUNT(SALE.SALE_ID)
Number_of_transactions
FROM CLIENT, SALE
WHERE CLIENT.CLIENT_ID=SALE.CLIENT_ID
GROUP BY CLIENT.CLIENT_ID

AS

4. Use Check Syntax to verify your SQL statement syntax.


5. Insert a join between the DT_Best_Cust and CLIENT tables (1:1).
6. Every join (except shortcut joins) must exist in at least one context. Add the new
join to the Sales and to the Rentals contexts.
7. The join between the DT_Best_Cust and CLIENT tables is from the Client_ID primary
key in the CLIENT table to the Client_ID foreign key in the DT_Best_Cust table.
The table schema looks similar to this.

Add the Number of Transactions object to the Client class. Define the object as a
measure object, and ensure the Associate a List of Values option is cleared.
8. In Universe Designer build a nested derived table, called DT_Nested, using the
following syntax:
SELECT DT_Best_Cust.CLIENT_ID,CLIENT.CLIENT_LASTNAME,
sum(DT_Best_Cust.Number_of_transactions)as Total_Transactions
FROM @DerivedTable(DT_Best_Cust),CLIENT
WHERE DT_Best_Cust.CLIENT_ID=CLIENT.CLIENT_ID
GROUP BY DT_Best_Cust.CLIENT_ID,CLIENT.CLIENT_LASTNAME

9. Join the DT_Nested to the DT_Best_Cust table (1:1).


Tip: Every join (except shortcut joins) must exist in at least one context.

10. Add the Total_Transactions object to the Client class. Define the object as a
measure object, and ensure the Associate a List of Values option is cleared.
11. Save your universe locally.
12. In Web Intelligence Rich Client, build:

A report that shows the number of transactions per customer and the number of
transactions per country.

Universe Design Exercises Version 1.0

30

A report that shows the total transactions and sales revenue, per customer and per
country.

Exercise 15: Setting up Index Awareness

Apply index awareness to improve the performance of SQL generation in Webi Rich
Client.

Instructions:
1. Using the Client Country object in your Motors universe, enter the following under
Keys:

2. Save your universe locally.


3. Create a query in Web Intelligence Rich Client with Client Country and Client
Name.
4. Apply a query filter, and use the Value(s) from list option to restrict the data to a
single country, such as the United States.
5. View the SQL.
Notice that the WHERE clause no longer uses the COUNTRY_REGION.COUNTRY_NAME
= USA statement (or whichever country you specified). It uses CLIENT.COUNTRY_ID =1.

Exercise 16: Linking Universes

Link and then Include Universes

Instructions
Business requirement: Prestige Motors management wants to report on the sales
performance
of its sales staff and their managers.

Universe Design Exercises Version 1.0

31

Use your Motors and Staff universes for this activity.


1. Export your Staff universe to the Central Management System. Go to File Export
and browse to the location specified by the instructor.
2. Open your Motors universe in Universe Designer. This is your derived universe.
3. Make room in the upper left corner of the Structure pane in the Motors universe. To
do this, click in any white space in the Structure pane, click Select All from the Edit
menu and then drag the tables to the right of the pane.
4. Link the structure and objects of your Staff universe in your Motors universe.
5. Place the Staff table structure in the top left-hand corner of your Motors universe
structure and insert a join between the EMPLOYEE and CLIENT tables as follows:

EMPLOYEE.EMP_ID = CLIENT.EMPLOYEE_ID

6. Update the contexts. Remember to ensure that context customization is reapplied, to


include and exclude certain joins in each context.
7. Save your Motors universe and close it.
8. Open your Staff universe and make the following changes to the Employee object:

Name = Sales Person


WHERE syntax= EMPLOYEE.JOB_ID = 3

9. Save your Staff universe, export it to the same location as in step 1, and close it.
10.Open your Motors universe and check that the change in your Staff universe is
reflected.
11.Change the Link to Include.
12.Save and export your Motors universe to the same location as in step1.
13.Test the results in Web Intelligence Rich Client.
Note: The exported Motors universe appears as normal text format in Webi Rich
Client.

Exercise 17: Setting Access Restrictions

Create a new restriction set


Apply the restriction set to a user group
Test the restriction set in Web Intelligence Rich Client

Instructions
1. You must export the universe before you can create security restrictions. Click
FileExport. In the Export Universe menu click Browse and select the folder to
export to, as specified by the instructor.
2. In your Motors universe, create a restriction set called Sales_only with the following
restrictions:

Set the value of Limit size of result set to to five rows.


Restrict all objects in the staff class.
Add a row restriction with a WHERE clause definition SHOWROOM.COUNTRY_ID =
(44).

3. Apply this restriction set to the sales user. Check with the instructor for the exact
user name to use.
4. Preview the restriction to check that it is correct.
5. Save your universe and export it to the same location as in step 1.
6. Log onto Web Intelligence Rich Client with the sales user account. Check with the
instructor for the exact user name to use.

Universe Design Exercises Version 1.0

32

7. Create a new report based on your Motors universe.


8. Verify that:

Any query only returns 5 rows.


The employees objects are not visible.
No sales data for UK showrooms is returned.

Exercise 18: Translating a Universe with Translation


Manager

Use Translation Manager to translate classes and objects into French and German.

Instructions
1.
2.
3.
4.
5.

In Universe Designer, import your Motors universe and save it locally.


Launch Translation Manager.
Click File Open.
Browse to the local copy of your Motors universe.
With your Motors universe open in Translation Manager, choose French (France)
and German (Germany) as the languages and add the following values to the
appropriate class and object names:

6. Ensure that your universe is ready for use.


7. Select File Save to save the changes to the local copy of the universe. Test the
translated

Universe Design Exercises Version 1.0

33

You might also like