Professional Documents
Culture Documents
Model
DMR - Dimensionally
Modeled Relational Model
The Problem
You want to create a dimensionally modeled relational model from a
relational data source so you can publish the data for your business users
to query.
The Solution
Framework Manager
The Steps
1. Create a Project
2.
3.
4.
5.
6. Publish Package
open in browser PRO version
pdfcrowd.com
Note: We can jumpstart a new project with the Model Design Accelerator
(MDA) wizard to create a single-fact star-schema model, but it may contain
errors that's difficult to catch.
2. A New Project dialog opens. Give your project a name. Click OK.
3. After logging in and selecting a language, the Metadata Wizard will start.
open in browser PRO version
pdfcrowd.com
4. In Select Data Source, there will be a list of data sources that was configured in
Cognos. Choose foodmart-reduced. Click Next.
5. In Select Objects, expand dbo, and check Tables. In this example, well
choose all tables.
Usually, you would only pick the tables necessary for the query or star
open in browser PRO version
pdfcrowd.com
Note: The wizard can create relationships with the joins and cardinality from
open in browser PRO version
pdfcrowd.com
the data source, but it will still need manual adjustments, and it's possible for
one to miss a detail because the lack of knowledge about the model. So it's
recommended to take the manual route.
7. When the wizard completes the import process, there should be 8 query subjects
(one per table). Click Finish. Congratulations. You created a project. Now its time
to get familiar with the different kinds of objects and components so we can
open in browser PRO version
pdfcrowd.com
Data
Sources
Parameter
Maps
Packages
pdfcrowd.com
Note: Uniquely identifies means that a namespace has its own scope so two different
namespaces can have an object with the same name and there won't be any conflict
because they do not affect one another. You can link one object to an object in
another namespace though. It'll hopefully make more sense by the end of this recipe.
A Namespace can contain:
Query
Subjects
Relationships
Folders
pdfcrowd.com
And More
Namespaces
pdfcrowd.com
pdfcrowd.com
> Relationship.
pdfcrowd.com
pdfcrowd.com
6. Do the same for the rest of the query items. Your end result should be the
following:
sales_fact_1997.promotion_id (1..n)
promotion.promotion_id (1..1)
sales_fact_1997.customer_id (1..n)
customer.customer_id (1..1)
sales_fact_1997.store_id (1..n)
store.store_id (1..1)
sales_fact_1997.product_id (1..n)
product.product_id (1..1)
sales_fact_1997.time_id (1..n)
time_by_day.time_id (1..1)
pdfcrowd.com
product.product_class_id (1..n)
product_class.product_class_id (1..1)
store.region_id (1..n)
region.region_id (1..1)
customer.customer_region_id (1..n)
region.region_id (1..1)
pdfcrowd.com
Note: The foodmart-reduced data source schema is not the same from the one we
have now. That's because customer has a customer_region_id that is obviously a
foreign key of region. Also, some tables have a foreign key for a table named district,
open in browser PRO version
pdfcrowd.com
but it's not in the data source. That's okay. You can just delete it in the next step.
Three Tier
Design
Physical
View
holds the query subjects and relationships used to build the model.
Query subjects should be unmodified views of the source tables. It's
what you have now.
Business
View
Presentation this view will be presented to the business user. Query subjects are
View
organized in a way that business users can understand.
pdfcrowd.com
2. Move all subject queries into Physical View namespace. Your project
should be structured like the following:
3. Right click on foodmart-reduced namespace, and Create > Namespace. Name the
namespace, Business View.
4. Right click Business View, and Create > Query Subject.
pdfcrowd.com
A dialog will appear. Name the subject query, Time and mark it as
a Model query subject. Click OK.
pdfcrowd.com
Note: The subject queries that were created at the beginning of this recipe
are known as data source query subject which is comparable to a table in SQL.
In the other hand, model query subjects are made from one or more data
source subject queries. This means the query subjects in Physical View should
be data source while the query subjects in Business View should be model.
5. A dialog will open. To the left you will find your project hierarchy. Collapse
Physical View and drag time by day to the white area on the right.
6. Make adjustments like renaming or removing query items for simplicity.
You can do the following:
Remove the following
month_of_year
fiscal_period
open in browser PRO version
pdfcrowd.com
SSMA_TimeStamp
Rename the following
the_date
Date
the_day
the_month
Month
the_year
Year
day_of_month
week_of_year
quarter
Quarter
pdfcrowd.com
7. For Customer repeat step #4, but name the subject query, Customer.
Repeat step #5, but drag customer to the white area on the right and
then at the bottom right-hand corner, click on Add to add a new Query
Item. Name it, Name. From the Available Components white area,
drag fname query item from customer in Physical View to Express
Definition white area to the right. And then drag lname after fname,
separated by + + (excluding double quotes). You can do a lot with
expressions in Cognos. You can check all of their many functions and
parameters by clicking on the tabs on the lower left-hand corner, but we
will cover that some other time. Your final expression definition should
be:
[Physical View].[customer].[fname] + ' ' + [Physical View].[customer].[lname]
To test it, click on the blue play button and it should show you the
correct results like in the picture below:
pdfcrowd.com
pdfcrowd.com
address4
SSMA_TimeStamp
Rename the following
account_num
Account Number
address1
Address
state_province
State / Province
postal_code
Postal Code
country
Country
phone1
Phone #1
phone2
Phone #2
birthdate
Date of Birth
marital_status
Marital Status
yearly_income
Annual Income
gender
Gender
total_children
Total Children
num_children_at_home
education
Education
date_accnt_opened
member_card
Member Card
occupation
Occupation
pdfcrowd.com
houseowner
House Owner
num_cars_owned
Type
When to Use
Identifier
Fact
pdfcrowd.com
Attribute / Unknown
With the rule of thumb table above, try to correct the usage type for all
query items in Customer. Some of them are correct already. Property
settings can be found at the bottom of Framework Manager after
selecting a query item.
pdfcrowd.com
pdfcrowd.com
pdfcrowd.com
pdfcrowd.com
pdfcrowd.com
3. Now you have to define your objects. The green checkmark means the
object will be included, red X means it will be excluded, and the third
option means its included, but its hidden. We only want business users
to have access to Presentation View, not Physical or Business View, but
we cannot exclude Physical or Business because Presentation depends
on it. Your setting should look like the following image:
pdfcrowd.com
pdfcrowd.com
5. You created your package, now you should get a prompt asking if you
want to open the Publishing Package Wizard. Click Yes.
pdfcrowd.com
6. In Select Location Type window, you need to choose where youre going
to store your package. The typical place to store packages is in Cognos
Content Store. There are two folders in the Content Store you can save
your package or pretty much any file type:
Public
Folders
My Folder
pdfcrowd.com
pdfcrowd.com
7. Click Publish.
Downloads
Framework Manager Project Example Above
pdfcrowd.com
Do It Yourself
Create a DMR Model with the FoodMart 2008 db. FoodMart 2008 has
lots of more tables, but dont worry. As long as you create a snowflake or
star schema that has relationships of many-to-one from the inside out,
clean things up, denormalize it, and etc, you should be okay.
Fact Table: inventory_fact 1997
Other Tables: product, product_class, warehouse, and time_by day.
Contents
Cognos Express Cookbook
1. About this text
2. Setting Up Data Source
3. Relational Models
a. DMR - Dimensionally Modeled Relational Model
b. Simple Report with Graph
c. Report - Common Techniques
d. Report - with Some Scripting
e. Workspace aka Dashboards
4. Dimensional Models
a. Create TM1 Server
open in browser PRO version
pdfcrowd.com
pdfcrowd.com