Documente Academic
Documente Profesional
Documente Cultură
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
B2480
(V8.4)
IP-2
INSTRUCTOR
PREFACE
Contents
PREFACE ....................................................................................................................... IP-1
CONTENTS ......................................................................................................................IP-3
COURSE OVERVIEW ...................................................................................................... IP-14
IMPORTANT COURSE CHANGES .................................................................................... IP-16
COURSE OUTLINE ......................................................................................................... IP-19
INSTRUCTIONAL MATERIALS ........................................................................................ IP-28
GENERAL SETUP AND INSTRUCTOR PREPARATION ....................................................... IP-32
DOCUMENT CONVENTIONS ........................................................................................... IP-33
POWERPOINT TIPS ........................................................................................................ IP-34
VMWARE KEYBOARD SHORTCUTS ............................................................................... IP-35
GET THE CLASS STARTED ............................................................................................. IP-37
POST-CLASS AGENDA................................................................................................... IP-38
SUBMIT FEEDBACK AND LOCATE ADDITIONAL PRODUCT INFORMATION ..................... IP-39
COGNOS PRODUCT HELP .............................................................................................. IP-40
SETUP INSTRUCTIONS ...............................................................................................SI-1
IMPORTANT SETUP INSTRUCTIONS FOR THIS COURSE ....................................................SI-3
INSTALL MICROSOFT SQL SERVER 2000........................................................................SI-4
INSTALL MICROSOFT SQL SERVER 2000 SP4 ................................................................SI-7
ENSURE THAT YOU HAVE INTERNET INFORMATION SERVICES INSTALLED .....................SI-8
CREATE THE IBM COGNOS 8 CONTENT STORE............................................................. SI-11
SET UP WEB ALIASES ................................................................................................... SI-13
CONFIGURE IBM COGNOS 8 ......................................................................................... SI-14
CREATE USERS IN THIRD-PARTY AUTHENTICATION PROVIDERS .................................. SI-16
SET UP IBM COGNOS 8 SAMPLES ................................................................................. SI-17
ENSURE SIMPLE FILE SHARING IS OFF .......................................................................... SI-19
STOP DEFAULT SMTP VIRTUAL SERVER ..................................................................... SI-20
INTRODUCTION ................................................................................................. INTRO-1
OBJECTIVES .............................................................................................................. INTRO-3
BUSINESS SCENARIO ................................................................................................. INTRO-8
ADDITIONAL TRAINING ............................................................................................ INTRO-9
GETTING STARTED ...................................................................................................... 1-1
OBJECTIVES ..................................................................................................................... 1-3
WHAT IS DATA MANAGER? ............................................................................................. 1-4
WHAT IS A DATA WAREHOUSE?...................................................................................... 1-5
DATA WAREHOUSE ARCHITECTURE ................................................................................ 1-6
STAR SCHEMA DATA MARTS ........................................................................................... 1-7
THE IBM COGNOS APPROACH TO DATA WAREHOUSING ............................................... 1-8
WHAT IS A DIMENSION .................................................................................................... 1-9
CONFORMED (SHARED) DIMENSIONS ............................................................................ 1-10
DATA MART VERSUS DATA WAREHOUSE ..................................................................... 1-11
DATA MART VERSUS OLTP SYSTEM ............................................................................ 1-12
DATA MANAGER INSTALLATION COMPONENTS ............................................................ 1-13
DATA MANAGER CAPABILITIES ..................................................................................... 1-14
THE ROLE OF DATA MANAGER IN IBM COGNOS 8 BI ................................................... 1-16
IBM COGNOS 8 ARCHITECTURE .................................................................................... 1-17
MULTI-DEVELOPER COMMUNITY .................................................................................. 1-18
DATA MANAGER AUTOMATION & INSTALL OPTIONS ................................................... 1-19
MAINTAIN CONFORMED DATA MARTS .......................................................................... 1-20
THE DATA MART DEVELOPMENT PROCESS: OVERVIEW................................................ 1-21
DEMO 1: EXPLORE THE DATA MANAGER INTERFACE .................................................... 1-22
SUMMARY ..................................................................................................................... 1-26
2008, Cognos ULC (formerly Cognos Incorporated)
Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,
or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).
IP-3
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
IP-4
INSTRUCTOR
PREFACE
IP-5
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
IP-6
INSTRUCTOR
PREFACE
IP-7
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
IP-8
INSTRUCTOR
PREFACE
IP-9
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
IP-10
INSTRUCTOR
PREFACE
IP-11
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
IP-12
INSTRUCTOR
PREFACE
IP-13
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
Course Overview
Course Overview
IBM Cognos 8 BI Data Manager: Build Datamarts with Enterprise Data
(v8.4) is a five-day, instructor-led course that teaches participants how to
move, merge, consolidate, and transform data from a range of data sources
to build and maintain subject-area data marts. In the process, students will
create a catalog and add connections to data sources and targets. They will
also deliver fact and dimension data to a data mart through the use of builds
and the dimensional framework. In addition, students will learn how to
automate common functionality and handle complex data issues, such as
unbalanced hierarchical structures.
Intended Audience
Developers
Topics Covered
Topics covered in this course include:
IP-14
INSTRUCTOR
PREFACE
Course Prerequisites
Participants should have:
IP-15
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
This book uses the version 6.3 development templates for Microsoft
Word and Microsoft PowerPoint. For example, all of the slides have
been "bluewashed" to incorporate the IBM logo and corporate
colors.
This course now uses a mix of Microsoft SQL Server and Microsoft
Access databases (mostly the former). For example, in Module 2,
Demo 1, Task 3, the students are instructed to create a connection
to the dm_sales SQL Server database, using the SQL Server (OLEDB) connection type.
IP-16
INSTRUCTOR
PREFACE
The "late arriving dimension details" and "late arriving facts" topics
are no longer covered in separate modules. Previously, in the 8.3
version of this course, they were covered in modules 8 and 11,
respectively.
IP-17
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
Page 13-17 is new. It discusses the new DataStage node that you
can add to a JobStream.
In addition, this module includes new content pages that outline the
three different ways to deliver unbalanced hierarchical data, and the
appropriate situations when to use each.
IP-18
This new section contains slides that review (at a high level) the key
information in the course.
INSTRUCTOR
PREFACE
Course Outline
The following table outlines the high-level topics for each module, and the
number of slides, demos and workshops included, as well as the estimated
teaching time.
Module 1: Getting Started
Topics
Slides
Demos
Workshops
Est. Time
22
1 hr.
Slides
Demos
Workshops
Est. Time
17
1.5 hrs.
create a catalog
IP-19
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
Slides
Demos
Workshops
Est. Time
23
2 hrs.
Slides
Demos
Workshops
Est. Time
29
2 hrs.
document a catalog
IP-20
INSTRUCTOR
PREFACE
examine derivations
Slides
Demos
Workshops
Est. Time
15
0.5 hrs.
Slides
Demos
Workshops
Est. Time
29
2 hrs.
IP-21
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
examine literals
examine fostering
Slides
Demos
Workshops
Est. Time
17
2 hrs.
Slides
Demos
Workshops
Est. Time
31
2 hrs.
IP-22
Slides
Demos
Workshops
Est. Time
13
1.5 hrs.
INSTRUCTOR
PREFACE
Slides
Demos
Workshops
Est. Time
18
1 hr.
Slides
Demos
Workshops
Est. Time
15
1 hr.
Slides
Demos
Workshops
Est. Time
23
1.5 hrs.
Slides
Demos
Workshops
Est. Time
26
1.5 hrs.
create a JobStream
IP-23
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
examine variables
Slides
Demos
Workshops
Est. Time
11
0.5 hrs.
Slides
Demos
Workshops
Est. Time
15
1 hr.
Slides
Demos
Workshops
Est. Time
27
1.5 hrs.
Slides
Demos
Workshops
Est. Time
14
1 hr.
examine pivoting
IP-24
INSTRUCTOR
PREFACE
Slides
Demos
Workshops
Est. Time
18
1 hr.
Slides
Demos
Workshops
Est. Time
15
0.5 hrs.
Slides
Demos
Workshops
Est. Time
0.5 hrs.
IP-25
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
Slides
Demos
Workshops
Est. Time
16
1 hr.
Slides
Demos
Workshops
Est. Time
N/A
N/A
N/A
N/A
Slides
Demos
Workshops
Est. Time
0.5 hrs.
Slides
Demos
Workshops
Est. Time
N/A
N/A
N/A
4 hrs.
IP-26
INSTRUCTOR
PREFACE
Slides
Demos
Workshops
Est. Time
N/A
N/A
N/A
0.5 hrs.
Slides
Demos
Workshops
Est. Time
45
N/A
N/A
1.0 hrs.
IP-27
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
Instructional Materials
Student Guide
The Student Guide contains material that helps to explain features of the
product, along with the presentation slides that are presented by the
instructor. Student demos and workshops are incorporated in the course to
enrich the learning experience through hands-on practice.
Demos
Demos appear after covering one or more topics or features of the
application. While not every product function is demonstrated, participants
work with the more important and complex features through a series of
tasks. Demo tasks contain a number of steps related to a specific action or
feature of the product.
Workshops
In most of the modules, a supplementary workshop is included. If
participants followed the concepts in class without difficulties, they can
probably complete the workshop with no additional information. The second
section for each workshop contains a task table that identifies each task,
where to work in the application, and any applicable hints to help the
participants. The third section of the workshop contains screen captures of
the expected results. The fourth section contains a step-by-step solution to
the workshop. Participants may want to follow these instructions if they are
not able to complete the workshop or if they require a little more practice
with the application.
Instructor Guide
The Instructor Guide contains the same content presented in the Student
Guide, along with additional notes to supplement and add value to the
lecture. The information can be generic, non-technical information, such as
multiple ways to perform the same command or a more in-depth discussion
of a topic. It may also be used to address more technical questions from
participants or as supplementary technical discussion, at the discretion of
the instructor. It helps to provide the appropriate level of information to a
specific audience.
IP-28
INSTRUCTOR
PREFACE
StartB2480.ppt
IntroB2480.ppt
C8DM-01-Getting_Started.ppt
C8DM-02-Create_a_Catalog.ppt
C8DM-03-Create_Hierarchies.ppt
C8DM-04-Create_Basic_Builds.ppt
C8DM-05-Create_Derivations.ppt
C8DM-06-Create_Conformed_Dimensions.ppt
C8DM-07-Customize_Reference_Structures.ppt
C8DM-08-Process_Dimensional_History_and_Late_Arriving_Facts.ppt
C8DM-09-Transform_Data_Using_Lookups_and_Derived_Dimensions.ppt
C8DM-10-Customize_Data_Delivery.ppt
C8DM-11-Customize_Fact_Data_Processing.ppt
C8DM-12-Aggregate_Filter_and_Partition_Fact_Data.ppt
C8DM-13-Implement_Job_Control.ppt
C8DM-14-Automate_Functionality_Using_Commands.ppt
C8DM-15-Customize_Functionality_with_User-Defined_Functions_and_Variables.ppt
C8DM-16-Process_Unbalanced_Hierarchical_Data.ppt
C8DM-17-Pivot_Fact_Data.ppt
C8DM-18-Resolve_Data_Quality_Issues.ppt
C8DM-19-Troubleshoot_and_Tune_the_Environment.ppt
C8DM-20-Organize_and_Package_Components.ppt
C8DM-21-Integrate_with_Cognos_8.ppt
IP-29
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
C8DM-A-Entity-Relationship_Model_of_the_GO_Demo_Database_(Optional).ppt
C8DM-B-Work_in_a_Multi-Developer_Environment_(Optional).ppt
C8DM-C-End_to_End_Workshop_(Optional).ppt
C8DM-D-Standardizing_Dimensions_Facts_Exercise_(Optional).ppt
C8DM-E-Review_of_DM_Essentials_(Optional).ppt
DATA
(V8.4)
IP-30
INSTRUCTOR
PREFACE
Student Data
Backups folder
Additional_Sales.txt
dm_additional
dm_out
dm_ref
dm_sales
DM_Sources.def
dm_stock
DWH
GO_Catalog
GO_Demo
GO_Logical_DataMap.xls
GO_Target
GOSL
Oracle.mdb
Order_Information.csv
Product_translation.csv
Rolling_12_months.csv
Sales_Staff_Update.txt
Sybase.mdb
IP-31
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
What hours are available for accessing the teaching site, copying
the files to the hard disk, tuning the color on the PC viewer, and so
on?
If the course has been previously taught on the computers you are
using, have the Preferences been reset to their defaults, and have
student files been deleted?
Prepare to Teach
After you have configured the instructor and student computers, consider
the following:
Make sure you complete each of the demos before teaching the
course so that you become familiar with each step required.
IP-32
INSTRUCTOR
PREFACE
Document Conventions
Conventions used in this guide follow Microsoft Windows application
standards, where applicable. As well, the following conventions are
observed:
Bold
Italic
CAPITALIZATION
IP-33
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
PowerPoint Tips
Here are valuable keyboard commands you can use to improve your
presentation.
Command
Key(s)
Right-click/Pen or Ctrl+P
Help
You can also jump to a specific slide by typing its slide number and pressing
the Enter key. However the slide number is not the same as the printed
page number because a page may be built from several slides to produce
an animation sequence.
Important Tips:
IP-34
INSTRUCTOR
PREFACE
Action
Ctrl-B
Power on.
Ctrl-E
Power off.
Ctrl-R
Ctrl-Z
Suspend.
Ctrl-N
Ctrl-O
Ctrl-F4
Ctrl-D
Ctrl-G
Ctrl-P
Edit preferences.
Ctrl-AltEnter
Ctrl-Alt
Ctrl-AltTab
Switch among open virtual machines while mouse and keyboard input are
grabbed.
Ctrl-Tab
Switch among open virtual machines while mouse and keyboard input are
not grabbed. VMware Workstation must be the active application.
IP-35
IBM
COGNOS
Shortcut
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
Action
CtrlSwitch among open virtual machines while mouse and keyboard input are
Shift-Tab not grabbed. VMware Workstation must be the active application.
Ctrl-AltFx
Linux hosts: Switch among open virtual machines while using full screen
mode. Fx is a function key corresponding to the virtual machine you want
to use. The key combination to use for a virtual machine is shown in the
VMware Workstation title bar when that virtual machine is active and in
normal (windowed) mode.
Windows hosts: For an additional similar functionality, see Using Full
Screen Switch Mode.
IP-36
INSTRUCTOR
PREFACE
Student Introductions
Name
Company
Position
Product Experience
Administrative Items
Sign-in sheet
Smoking
Messages
Telephones
Washrooms
Refreshments
Turn off cell phones
and pagers
Class Format
lecture with slides
student guides as reference
material
hands-on demos to learn and
practice
independent workshop
exercises for more practice
IP-37
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
Post-Class Agenda
If you brought any hardware or course media, take them with you
when you leave. Erase any files copied to the hard disks of the
computers in the classroom. Change the Preferences back to their
initial settings.
Make notes for yourself about what went well during the course and
what needs improvement. When you are preparing for your next
teach, you can refer to these.
IP-38
INSTRUCTOR
PREFACE
IP-39
IBM
COGNOS
BI
DATA
MANAGER:
BUILD
DATAMARTS
WITH
ENTERPRISE
DATA
(V8.4)
When to use
Location
Taskoriented
Books for
Printing
(.pdf)
Start/Programs/Cognos
Product/Documentation
IP-40
http://support.cognos.com
Online support
http://support.cognos.com
http://www.cognos.com
SI
Setup Instructions
IBM Cognos 8 BI
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
SI-2
SETUP
INSTRUCTIONS
1 min
5 mins
Install Microsoft SQL Server 2000 SP4. See steps on page SI-7.
15 mins
Ensure you have Internet Information Services (IIS) installed. See steps
on page SI-8.
1 mins
5 mins.
15 mins.
10 mins
Create the IBM Cognos 8 content store and restore SQL Server
databases. See steps on page SI-11.
5 mins
2 mins
5 mins
1 mins
15 mins
Ensure that Simple File Sharing is off. See steps on page SI-19.
1 min
Stop the default SMTP virtual server. See steps on page SI-20.
1 min
1 min
1 min
Complete
84 minutes
SI-3
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
6. Click Create a new instance of SQL Server, and then click Next.
7. Edit the Name, Co., etc., and then click Next.
SI-4
SETUP
INSTRUCTIONS
10. Click Server and Client Tools, and then click Next.
11. Select Default as the Instance Name, and then click Next.
13. For Services Accounts, click Use the Local System account.
SI-5
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
15. For Authentication Mode, click Mixed Mode, and type Education1! in
the Enter password and Confirm password boxes.
16. Click Next.
17. Click Next again.
The installation continues, and the Microsoft Data Access Components are
installed. The complete installation may take a few minutes.
18. Once the install is complete, click Finish.
SI-6
SETUP
INSTRUCTIONS
SI-7
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
SI-8
SETUP
INSTRUCTIONS
SI-9
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
SI-10
SETUP
INSTRUCTIONS
SI-11
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
14. Repeat steps 7 to 12 to create the following databases (both of the database
files are in the C:\Program Files\cognos\c8\
webcontent\samples\datasources\sqlserver folder.
GOSALES
GOSALESDW
15. Close SQL Server Enterprise Manager.
SI-12
SETUP
INSTRUCTIONS
SI-13
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
SI-14
SETUP
INSTRUCTIONS
12. Click Close to close the Cognos Configuration dialog box after the
configuration is saved and all items have green check marks beside them.
13. Click Start
to start the IBM Cognos 8 service. If you receive a warning
due to the mail server not being tested, click the OK and Continue buttons
to continue the start process.
14. When the service is started, click Close.
15. Close IBM Cognos Configuration.
2008, Cognos ULC (formerly Cognos Incorporated)
Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,
or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).
SI-15
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
SI-16
SETUP
INSTRUCTIONS
7. Click Next, select the Samples folder, and then click Next.
8. Ensure that the options appear as shown below:
SI-17
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
SI-18
SETUP
INSTRUCTIONS
Instructional Tips
Note: Use Simple File Sharing
(recommended) may already be
deselected.
3. Click OK.
4. Close Control Panel.
SI-19
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
Note: the Default SMTP Virtual
Server might already be stopped.
SI-20
Introduction
IBM Cognos 8 BI
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Intro-2
INTRODUCTION
Objectives
In this course, we will:
examine dimensional modeling with Data Manager
develop a Data Manager catalog
Intro-3
This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated
into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Getting Started
Create a Catalog
Create Hierarchies
Create Basic Builds
Create Derivations
Create Conformed Dimensions
Customize Reference Structures
Developers
Required prerequisites:
Intro-4
INTRODUCTION
Intro-5
This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated
into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Intro-6
INTRODUCTION
Intro-7
This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated
into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Business Scenario
You are a Data Manager administrator for The Great Outdoors
Company. You are tasked with creating, testing, and administering a
data warehouse environment using Data Manager.
You will be responsible for:
To ensure that objectives of the course are met, we will implement a task-based
learning environment by following the business scenario described above. This
scenario will be developed as we proceed through the demos and workshops in the
course.
Intro-8
INTRODUCTION
Additional Training
After completing this course, please visit
http://support.cognos.com/training to find more information about:
Intro-9
This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated
into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Intro-10
Getting Started
IBM Cognos 8 BI
1-2
(V8.4)
GETTING
STARTED
Objectives
In this module, we will:
1-3
(V8.4)
Extract
OLTP
OLTP
Transform
Data
Data
Text
ERP
ERP
Load
+
x/y
Data
Integrated
Data Marts
Text
Metadata
Data Manager is an ETL (extract, transform, and load) tool that you can use to
create data warehouses.
Data Manager:
1-4
extracts operational data from multiple sources (both relational and nonrelational)
delivers the transformed data to coordinated data marts that make up the
data warehouse
can create metadata for use with IBM Cognos 8 BI (business intelligence)
tools, such as Query Studio and Analysis Studio
Instructional Tips
Elaborate on the meaning of an ETL tool
and discuss how Data Manager
distinguishes itself from the many other
ETL tools that exist. Specifically, discuss
the integration of data marts and the ways
in which Data Manager produces valuable
data, block by block, on a regular basis.
The data marts that make up a data
warehouse usually pertain to different
subject areas within the company (for
example, sales and inventory).
GETTING
STARTED
To Users
Data In
Data Warehouse
The data warehouse is used as a source of reporting data for the whole organization.
A well-designed data warehouse can:
1-5
(V8.4)
2.
3.
4.
3
2
HR
Sales
Production
1-6
The data staging area is where the raw operational data is acquired,
transformed, cleaned, and combined so that it can be reported on and
queried by users. This area lies between the operational source systems and
the data warehouse and is typically not accessible to users.
The data warehouse contains the data that is organized and stored
specifically for direct user queries and reports. The data warehouse differs
from an OLTP database in that it is designed primarily for reads, not writes.
Instructional Tips
For example, a data warehouse for a
retail chain may be constructed
incrementally from individual data
marts dealing with separate subject
areas, such as product sales.
GETTING
STARTED
The data marts that make up a data warehouse usually have a star
structure that consists of dimension tables and fact tables:
1.
2.
1
SalesStaff
Product
Order
Fact
Customer
Time
In a star schema, numeric measure data (such as revenue) is stored in a central fact
table. This fact table is linked to dimension tables through foreign keys. These
dimension tables contain primarily textual information about business components,
such as the products a company sells.
Instructional Tips
In the slide example, data about
each product order is stored in the
Order Fact table. Each order
references a customer, a
salesperson, a product, and the date
and time when the order was made.
Detailed data about each of these
business components is stored in the
appropriate dimension table. For
example, we can find a detailed
description about each product in the
Product dimension table.
1-7
(V8.4)
Information
Systems and
Technology
Project Management
(Business Intelligence
Experts)
Data
Warehouse
Developers
Implementation Phase
Data
Warehouse
Developers
Information
Systems and
Technology
Project Management
(Business Intelligence
Experts)
User Community
Instructional Tips
The IBM Cognos approach to building a
data warehouse is based on the approach
of Ralph Kimball.
Ralph Kimball developed the concept of
conformed dimensions. Kimball's
dimensional design technique makes it
possible for you to build a data warehouse,
one data mart at a time. These techniques
are most thoroughly discussed in his book,
The Data Warehouse Toolkit.
In most cases, it is important that the data warehouse and operational system be
kept separate because their characteristics are so different. The warehouse must
not be a mirror image of the operational system.
1-8
GETTING
STARTED
What is a Dimension?
Business dimensions are the core components or categories of a
business, anything that you want to analyze in reports.
Business dimensions are fundamental to data organization and
provide context for numeric data items (measures).
Product
Product
Widgets sold in
all locations in July
July
Widgets sold in
Montana in July
July
Widgets
Widgets
100
Time
California
Nebraska
Oklahoma
Montana
Delaware
Kentucky
New Jersey
Montana
Location
Location
Time
Dimensions provide context for the key performance indicators (KPIs) that a
business uses to measure its performance.
Instructional Tips
For example, a retail chain store may
categorize its sales data by the products
that it sells, by its retail outlets, and by
fiscal periods. This organization has the
business dimensions Product, Location,
and Time. The measures of the business,
such as how much it sells, lie at the
intersection of these dimensions.
The slide example shows these dimensions
as the axis of a three-dimensional space.
The cube at the center of this space
represents 100 units of widgets sold in
Montana during July.
You can derive summary information by
aggregating data along one or more
dimensions. The slide example on the right
shows the aggregation of data along the
Location dimension to give the total sales
of widgets during July.
1-9
(V8.4)
Sales
Distr.
Mkting
HR
XXXX
X
X
X X
XX
X X
X
X
X
Branches
Sales
Fact
HR
fact
Products
Channels
Distribution
fact
Customer
Marketing
fact
Time
Training
Shipping
Promotion
Various business topics become natural data marts. A fully integrated data
warehouse will have data marts that use conformed dimensions and each data
mart will have a set of measures (fact table).
Separating data by subject makes the warehouse flexible and easy to maintain.
Therefore, it is important to identify the conformed dimensions in the beginning
phases of warehouse design and subsequent data mart development.
1-10
Instructional Tips
For example, a conformed dimension table
may contain product data that can be
referenced by multiple fact tables, such as
tables containing sales and forecast data.
Overall, you can create two types of data
marts:
1. self-contained ("private") data marts,
where dimensions are not shared
among multiple fact tables
2. conformed data marts, where
dimensions can be shared among
multiple fact tables
GETTING
STARTED
Sales
Products
HR
Customer
Sales
Fact
Channels
Time
Inventory
is difficult to maintain
Manufacturing
Instructional Tips
The danger of data marts is that if they are
not integrated, they can become "islands of
information," where each subject area is
isolated from the others. The way to
address this situation is to use conformed
dimensions, which are addressed later in
this course.
1-11
(V8.4)
Customer
Type
Sales Area
Product
Type
Customer
Sales Rep
Product
Order
Header
Products
Order
Fact
Customer
Time
Order
Line
An OLTP system is different from a data mart in that it is designed for writing data,
not querying or reporting. OLTP systems are normalized, which means that the data
to be written is broken down into its simplest form, removing all redundancy from
the data. All of these tables are related through referential integrity, which makes
writing new data to the OLTP database fast and efficient.
However, reporting against such a structure is difficult because the data in it is
constantly changing. Also, most queries against an OLTP database require going
through several related tables, which makes any complex queries very slow.
The biggest difference between a typical data mart and the OLTP system from
which it is built is the number of tables.
Instructional Tips
The slide depicts a typical "star
schema". The "star schema"
structure is discussed later in this
course.
In the slide example, the Orders data
mart has only one central table
containing mostly numeric data,
along with four other tables with
detailed information relating to these
numbers.
The Products table, for example, is
constructed through "collapsing" the
referential integrity legs of the
Product Line, Product Type, and
Product tables. The data in these
tables is combined into one
dimension table.
As a result, any query relating to
Products and Customers in the
Orders data mart has to go through a
maximum of three tables, rather than
as many as seven as in the Orders
OLTP system.
1-12
GETTING
STARTED
DM-Designer (Windows)
Design
DM-Engine (Windows/UNIX)
Execute
DM-Network Svc (Windows/UNIX)
Remote execute
DB-Client (See Support Site)
DB2, MS-SQL, ....
(DM-SAP/R3-Connector (Windows))
optional
SAP/R3-GUI
The two main parts to the Data Manager architecture are a design client (Data
Manager Designer, which runs on the Windows operating system) and a server
engine (which runs on UNIX and Windows). In a typical production
environment, the two components are deployed on separate machines.
You create designs using the graphical user interface of Data Manager Designer.
The design metadata is stored in any RDBMS (relational database management
system). The server engine then reads this metadata at run time.
Technical Information
During the development process, it is
common to run both Data Manager
Designer and the engine on the same
machine. In production, you would
typically devote one or more machines
to perform the actual data extraction,
transformation and loading using the
server engine component.
Both an application programming
interface (API) and scripting language
are available to drive the server engine.
The API and scripting language make it
possible to create data mart building
jobs once through Data Manager
Designer and then schedule them to run
on a regular basis.
For the most up-to-date information on
supported environments for Data
Manager and other IBM Cognos 8
components, see the IBM Cognos
Support Web site
(http://support.cognos.com).
1-13
(V8.4)
Dimensions, Lookups
Builds, Jobstreams
Output Connections
Text
Execute
C8 Package
Builds
RDBMS
(Loader/Table)
C8 Data Source
Jobstreams
RDBMS
Optional (extra)
SAP/R3
CIS (XML, JDBC, ...)
Text
C8 Data Source
Publish
FM-Metadata
Data Movement Job
IBM Cognos Connection
Audit, Notification
Timing, Delivery ...
1-14
GETTING
STARTED
Data Manager can document the contents of a catalog in HTML format and
open it in your Web browser. You can then view and print it.
You can generate a text backup of a complete Data Manager catalog or catalog
tables, including all the catalog components. This is useful for backup or change
control as the text file can be stored in a file management system. It is also useful
if you want to move from one DBMS environment to another.
Additional Information
Facts builds are referred to as data
builds in the generated document.
If you want to create a partial backup, you can select the components that you
require and then save them as a component package.
You can use component packages to:
1-15
(V8.4)
OLAP Modeling
Design
Publish
Event Management
Metadata Modeling
Author (QS/AS/RS/ES)
Execute
Design (Relational)
Automate
Schedule
1-16
GETTING
STARTED
Data Sources
FM
Tr
Frmwrk.
Manager
Web-Server / C8-Gateway
DM - Engine
Tr
DM - Catalog
C8-Server
C8 - Content Store
1-17
(V8.4)
Multi-Developer Community
Local DM Catalog
Local DM Catalog
Local DM Catalog
Local DM Catalog
Storing a Data Manager catalog in a source code control system allows multiple
developers concurrent access. A master Data Manager catalog is added to the
source code control system, and each developer then creates a personal catalog that
is connected to the source code control repository, as illustrated in the slide
example.
Instructional Tips
For more information on source code
control, see Appendix B, "Work in a
Multi-Developer Environment," or the
Data Manager User Guide.
To use source code control, you must have an external source code control system
already set up and you must be connected to it.
Using source code control allows all connected users to view all the contents of the
catalog, execute builds and JobStreams, and create components. To maintain
existing catalog components, you must first check them out of the source code
control system.
1-18
GETTING
STARTED
Schedule/Batch
Workstation (Win)
Command-Line
DM-Designer
Interactive
Web-Clients
DM-Network
DB-Client
C8-Server
Local Start
C8-Server
Schedule/Batch
DM-Engine
Command-Line
JobStream/Build
DM-Network
DB-Client
DB-Servers
Source-DB
DWH
DM - Catalog
C8 - Content Store
1-19
(V8.4)
2.
3.
Although you can deliver fact data and dimension data by executing a single fact
build, it is best practice to deliver the dimension data in a separate process, by using
dimension builds. This is because it is very difficult to maintain both fact and
dimension data in the same delivery process.
Instructional Tips
Dimension builds, fact builds, and
JobStreams are examined later in
this course.
Once the dimension data has been delivered, it can be referenced by the fact data.
For example, if the fact data consists of sales transactions, each incoming row will
be validated against the Product dimension table, to ensure that each transaction
references a valid product.
JobStreams are used to automate the tasks involved in constructing and maintaining
a data warehouse.
1-20
GETTING
STARTED
2.
3.
4.
5.
6.
7.
Create JobStreams.
1-21
(V8.4)
Demo 1
Explore the Data
Manager Interface
1-22
GETTING
STARTED
Technical Information
A catalog is a repository (typically in a
database) for storing specifications for
builds, reference structures, connections,
and other Data Manager components.
From Data Manager, you can customize
your system environment. From the Tools
menu, click Options to modify the look
and feel of Data Manager. From the
Options dialog box, you can:
have the Welcome dialog box
appear when the application starts
have the transformation model
elements and build details appear in
the Visualization pane by default (it
is best practice to have these options
selected)
clear the recent catalogs list
Instructional Tips
This may be a good time to point out to
students where they can access the
online documentation from outside of
Data Manager. Have the students
navigate from the Start menu to:
All Programs/IBM Cognos 8/
Documentation/Data Manager.
1-23
(V8.4)
11. Click the plus sign (+) to expand the SalesFact build.
12. Click the plus sign (+) to expand Delivery Modules.
You can see the SalesFact build in the Visualization pane.
13. Click the Catalog
You can again see all the objects contained in the catalog.
Task 3. Explore the menus and SQLTerm, and then close the
catalog.
1. Click the File menu.
This menu contains all the actions you can perform on a catalog.
2. Repeat step 1 to examine the other Data Manager menu items.
3. From the Tools menu, click SQLTerm.
The SQLTerm window opens.
4. In the Database list, click DS_Sources, and then in the Database objects
pane, click the plus sign (+) to expand the DS_Sources database.
There are nine tables in this data source.
1-24
Instructional Tips
If your catalog contains a long list of
builds and JobStreams, you can make
it easier to use by organizing these
components into intuitive user-defined
folders.
Technical Information
SQLTerm is a Data Manager utility that
allows you to:
build SQL statements to access
source data
obtain information about database
objects, DBMS drivers, and data
sources
examine the contents of database
tables
test SQL extracts from source
databases
tune SQL extracts
GETTING
STARTED
5. Close SQLTerm.
6. From the File menu, click Close Catalog (do not save changes if
prompted) and then from the File menu, click Exit.
Results:
You have become familiar with Data Manager by examining a
catalog, the Help files, and the Data Manager and SQLTerm
interfaces.
1-25
(V8.4)
Summary
In this module, we have:
1-26
Create a Catalog
IBM Cognos 8 BI
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
2-2
CREATE
CATALOG
Objectives
In this module, we will:
create a catalog
2-3
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
In this module, we will complete the first three steps in the standard data mart
development process.
2-4
CREATE
CATALOG
What is a Catalog?
A Data Manager catalog provides a central repository for the
information that defines how Data Manager extracts,
transforms, and delivers data.
Technical Information
You can start multiple instances of Data
Manager Designer.
You cannot use Data Manager unless you first select and open a catalog or create a The catalog may take the form of a text file
catalog. Only one catalog can be open at a time by a single instance of Data
(with a .ctg file extension) if it is a
backed-up version of another catalog.
Manager Designer.
When you make a change in Data Manager, it is not permanent until you save the
catalog.
Note: The catalog does not contain the data that Data Manager will manipulate
and deliver. It holds the configuration details that determine where the
source data is coming from and how it will be transformed and loaded into
the target data mart(s).
2-5
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Development
Catalog
Tables
Quality Control
Catalog
Tables
Production
Catalog
Tables
Data Manager
Target
Connection
Source
Connection
Source
Connection
Target
Connection
Instructional Tips
As the slide indicates, it is common to
have a separate catalog for each stage
of the development process. In this
slide, there is a separate catalog for the
Development stage, Quality Control
stage, and Production stage. Each of
these catalogs is stored in a separate
database.
The catalog tables are not guaranteed
to remain the same version to version
and so it is not advisable to create
reports or scripts directly against them.
Instead, if you want to summarize or
provide detailed information about the
contents of a catalog (builds,
connections, and so on) to other users,
you can produce HTML documentation
for that catalog (File\Document Catalog).
Technical Information
If you choose to store a catalog in a
database that is not in the list of
supported native connections, Data
Manager must use ODBC to connect to
it. As a result, you must create an ODBC
Data Source Name (DSN) for the
database before you create the catalog.
Select ODBC Administrator from the
Tools menu within Data Manager or
Settings/Control Panel/Administrative
Tools/Data Sources (ODBC) from the
Start menu in Windows.
We recommend that you create system
DSNs. These DSNs are available to
everyone who can access the computer,
including users with administrative
privileges.
2-6
CREATE
CATALOG
Dimensions
Connections
Functions
Each catalog contains a library, which holds the dimensions that make up the
dimensional framework, connections to various data sources, and user-defined
functions.
Items in the library may be used throughout the catalog in different fact builds,
dimension builds, and JobStreams. The components stored in the library are used
throughout the catalog, enabling the reuse of these components. You can build
multiple projects using the same supporting library components, which shortens the
development time for these projects.
2-7
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Create a Catalog
First, create an empty database to hold the catalog (outside of Data
Manager). Then, create the catalog from within Data Manager.
Empty Database
After you create the database, you can create the catalog. You must specify a name
for the new catalog and (if preferred) a business name and description.
Instructional Tips
If a catalog is already open, a message
appears informing you that the current
You must select the physical database (that you previously created) that will hold the catalog will be disconnected. Click Yes to
catalog tables. The New Catalog dialog box will show fields that are appropriate for acknowledge this message.
the type of database that you have selected (such as ODBC or SQL Server).
2-8
CREATE
Targets
Sources
Data Manager
Flat Files
Databases
Flat Files
Databases
Each connection provides information so that Data Manager can link to a data
source or target. The connection:
CATALOG
Technical Information
Many data sources can be used with
Data Manager, but not every connection
method may be available on your
computer. If you do not have a specific
connection method, Data Manager will
indicate this in the Connection Properties
dialog box.
Cognos SQL is an extension of SQL 99.
Using Cognos SQL, you have a greater
degree of portability between mixed
database environments because a
common dialect can be used.
By default, a connection accepts any
vendor-specific SQL SELECT statement
in a data source, including nonstandard
SQL extensions and hints. A connection
or data source can optionally use
Cognos SQL. You cannot use Cognos
SQL for SQLTXT connections.
Flat files are described in definition files
(.def) by using the SQLTXT Designer
tool and then accessed in the same way
as regular relational databases. You can
define several different connections
within a catalog, including ones to DB2,
Oracle, and Microsoft SQL Server data
sources. You can deliver the transformed
data to various targets, including
databases and flat files.
specifies the connection method that must be used to connect to the data
specifies the dialect of SQL used by the connection (either native SQL or
Cognos SQL)
The connections are contained within the Data Manager catalog and are specific to
that catalog.
The source data may come from relational databases, flat files, and published
Framework Manager Packages.
2-9
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
1.
2.
3.
Technical Information
IBM Cognos 8 supports authenticated and
anonymous users. To use IBM Cognos 8
as an authenticated user, you must
successfully log on by providing your
credentials. Anonymous users do not log
on.
There are two types of credentials:
Designer credentials: used while you
are working in Designer, and are
obtained from the IBM Cognos
Connection log on window.
Catalog credentials: used when you
execute a build or JobStream, and are
read from the catalog.
For more information on managing
credentials, see the Data Manager User
Guide.
For information on accessing the IBM
Cognos 8 Gateway URI and Dispatcher
URI, see the Data Manager Installation and
Configuration Guide.
Before you can create a Published FM Package connection, you must configure
Data Manager to access the IBM Cognos 8 Gateway URI (uniform resource
identifier) and the Dispatcher URI.
2-10
CREATE
Before you can create a IBM Cognos Data Source connection, you
must configure Data Manager to access the:
Dispatcher URI
CATALOG
Instructional Tips
For more information on configuring
Data Manager to access the IBM
Cognos 8 Gateway URI and the
Dispatcher URI, see the Data
Manager Installation and
Configuration Guide.
2-11
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Data Source
RETAILER
_CODE
RETAILER
_NAME
COMPANY
_NAME
234
ActiForme
16
229
SportsClub
Results
Because you can view the data itself, SQLTerm can give you greater insight into
what each data source contains and what it can be used for.
The SQLTerm interface shows a list of the data source connections. You select a
connection from this list and then run the SQL operations that you need. You can
have SQLTerm return just the first row of data, or all the selected rows in the data
source.
Using SQLTerm, you can compose and run different types of SQL statements by
using:
Technical Information
To open SQLTerm, you can either click
SQLTerm from the Tools menu, or click
the Open the SQLTerm window button
on the toolbar.
To create an SQL statement for
execution, you can construct the entire
statement by hand. You can also rightclick a table or column in the Database
Objects pane and click one of the most
commonly used options, such as Select
rows, from the shortcut menu. This will
automatically produce a statement in the
SQL Query pane that selects all the rows
from a table.
You can also use any of several "clickdrag" options to create your SQL
statement. For example, using the "Ctrlclick-drag" option on a table object will
create an SQL SELECT statement that
explicitly includes all columns from the
table.
You can also create an SQL statement in
any query tool (for example, Microsoft
SQL Query Analyzer ) and then copy and
paste it into SQLTerm.
You can specify that you want to use
Cognos SQL when you construct the
SQL statement. If you do not use
Cognos SQL, you must use native SQL
for the database you are accessing.
The default for the Cognos SQL check
box is determined by whether you
selected the Cognos SQL check box in
the properties of the data source
connection. You can modify this setting if
necessary.
If you are using a published Framework Manager package, you can specify which
query subjects you want to examine and which filters (if any) you want to apply.
2-12
CREATE
CATALOG
When you pass a SQL statement to SQL Helper, you have the option to:
accept it as it is
Technical Information
When you create a query (for example, to
populate a hierarchy) in SQL Helper, the
SQL statement can be parsed or
prepared.
Prepare is the recommended method. It
sends the SQL statement to the database
and returns the result set columns.
Database specific syntax can be used.
Parsing does not send the SQL statement
to the database, so it can be used when
you are unable to connect to the
database. Data Manager parses the SQL
statement and returns the result set of
columns as written in the SQL statement.
When you use parse, the SQL statement
must begin with SELECT. Parse may not
evaluate database specific syntax
correctly and, as it looks for commas to
separate columns, may produce incorrect
results.
Using parse is quicker than using prepare.
However, it can fail if the SQL is too
complex.
2-13
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Demo 1
Create a Catalog and
Register
Data Sources
2-14
CREATE
CATALOG
Instructional Tips
You can also access the ODBC Data
Source Administrator in Windows through
the Start menu. Click Control Panel, and
then double-click Administrative Tools and
Data Sources (ODBC).
In this course, we will use a combination of
Microsoft Access and Microsoft SQL
Server databases (mostly the latter).
If you prefer, you can store the catalog in a
SQL Server database. You would first
create an empty database in Enterprise
Manager, and then specify this database in
Task 2 of this demo.
You could use the SQL Server (OLE-DB)
connection method to connect to this
database. Alternatively, you could complete
the steps in Task 1 to create an ODBC
DSN that points to the SQL Server
database (in step 4, you would select SQL
Server instead of Microsoft Access Driver),
and then select the ODBC connection
method in Task 2.
You have successfully created the data source that will hold your catalog.
Task 2. Create the catalog and connect to the Day1Catalog
data source.
1. In Data Manager, from the File menu, click New Catalog.
The New Catalog dialog box appears.
2. In the Name box, type Day1Catalog.
3. In the Business name box, type Day1Catalog, and then click Next.
4. In the left pane, click ODBC.
2008, Cognos ULC (formerly Cognos Incorporated)
Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,
or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).
2-15
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
5. In the Data Source Name list, click Day1Catalog, and then click Test
Connection.
A message appears, indicating that the connection was successful.
6. Click OK, and then click Finish.
Day1Catalog opens in Data Manager.
You have successfully created a catalog and connected it to the database
that will hold it. The result appears as shown below:
2-16
CREATE
CATALOG
6. In the OLE DB Provider box, ensure that sqloledb (SQL Server 2000
OLEDB) is selected.
The results appear as shown below:
Instructional Tips
You can also type any valid SQL
statement in the SQL Query window
and run it in the same fashion.
SQLTerm opens.
2. Maximize the window if necessary, and in the Database list, ensure that
Sales is selected.
3. In the Database objects pane, click (+) to expand Sales, and then expand
dbo.
The tables dm_forecast and dm_sales are now available for analysis.
2-17
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
7. Repeat steps 4 through 6 to view the data in the dm_forecast table, and
then close SQLTerm.
8. From the File menu, click Save Catalog.
Results:
In order to create a simple data mart prototype for presentation
to senior management, you created a Data Manager catalog. You
then connected to a database that contains transactional data.
2-18
CREATE
CATALOG
SQLTXT
Flat Files
.def file
With the SQLTXT DBMS driver, you can access data in text format through SQL. Instructional Tips
This is especially important because, in many cases, much of the data to be stored in For more information on SQLTXT, see the
Data Manager User Guide.
the warehouse must be obtained from individual flat files instead of relational
databases.
SQLTXT restrictions are:
no updates
no sorting or grouping
Technical Information
You cannot use the JOIN clause within
SQLTXT. Therefore, use single table
SELECT statements. Also, you cannot use
the GROUP BY or ORDER BY clauses. Use
the SELECT DISTINCT clause instead.
Data Manager cannot be used to directly
access mainframe files (such as those
existing on an MVS computer). However,
this is not necessarily a bad thing, because
we usually do not want users to have such
direct access anyway. Mainframe files can
be exported to text and transferred
elsewhere by using FTP (file transfer
protocol). The files can then be accessed
with SQLTXT like other text files.
2-19
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Demo 2
Configure a Text File
Using SQLTXT
2-20
CREATE
CATALOG
2-21
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
CREATE
CATALOG
Technical Information
Notice the double quotation marks around
the Additional_Sales table in the SELECT
statement. This is a convention of the
SQLTXT syntax of SQL. They are not
necessary, but they will be inserted
automatically when you choose one of the
options from the shortcut menu in the
Database objects pane.
5. Close SQLTerm.
6. From the File menu, click Save Catalog.
Results:
You have configured a flat file to produce a definition file,
accessed this file within Day1Catalog through a data source
connection, and then viewed its contents by using SQLTerm.
2-23
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Summary
In this module, we have:
2-24
created a catalog
CREATE
CATALOG
Workshop 1
Define Connections to Data Sources
2-25
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Create connections that point to the dm_stock, dm_ref and dm_out SQL
Server databases. In Data Manager, name these connections Stock,
Reference, and Output, respectively. Specify sa as the username,
Education1! as the password, and your local server.
Use SQLTerm to view the data in the Stock and Reference data sources.
This will give us some idea of what you have to work with. Make sure you
save your catalog when you are finished.
For more detailed information outlined as tasks, see the Task Table on the next
page.
For the final query results, see the Workshop Results section that follows the Task
Table.
2-26
CREATE
CATALOG
WHERE TO WORK
HINTS
Username: sa
Password: Education1!
Right-click a table or
column to obtain a
SELECT statement.
SQLTerm
If you need more information to complete a task, see the Step-by-Step instructions
at the end of this workshop.
2-27
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Workshop 1: Results
2-28
CREATE
CATALOG
2-29
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
2-30
Create Hierarchies
IBM Cognos 8 BI
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
3-2
CREATE
HIERARCHIES
Objectives
In this module, we will:
3-3
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
3-4
CREATE
HIERARCHIES
Dim
Data
Sources
Data
Source
DataStream
Time
Location
Dimension
Delivery
DataStream
Data
Source
Product
Fact
Delivery
After you identify the required data sources and create the catalog, the next step in
developing a data mart is to build the dimensional framework.
The dimensional framework:
represents the way the organization thinks about its data, rather than the
way the data is physically stored
Dimensions provide the context through which you analyze your business.
Examples of dimensions include products, customers, and sales staff.
3-5
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
3-6
Instructional Tips
Emphasize to students that the end result
of a Data Manager hierarchy is typically a
dimension table.
Hierarchies in Data Manager aid in ETL
processing, but they are not derived from
user-based reporting hierarchies (for
example, those created in Framework
Manager or Transformer).
Surrogate key substitution is an important
topic that is discussed in detail later in this
course.
CREATE
HIERARCHIES
hierarchies
auto-level hierarchies
lookups
Instructional Tips
Hierarchies are the focus of this module.
Auto-level hierarchies and lookups are
discussed in greater detail later in this
course.
Example of an auto-level hierarchy: a Staff
structure may contain employees who report
to managers who, in turn, may report to
other managers (also known as a recursive
relationship).
Example of a lookup: a Location structure
which ensures that each incoming state or
provincial code is correct.
3-7
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Name of hierarchy
Levels in hierarchy
3-8
CREATE
HIERARCHIES
ID
caption
parent
other descriptive characteristic
The attribute names are important because they are used for column names in the
dimension tables of the data mart.
Typically, the caption value is what the end user will see in a report (such as the
name of a state instead of its ID code).
Instructional Tips
The names of attributes in each
hierarchy level are defined in
templates. Templates are discussed
later in the course.
3-9
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
State Level
3-10
CREATE
HIERARCHIES
When you create a hierarchy using the Hierarchy wizard (as we will do in this
module), Data Manager automatically adds the required data sources for you, in the
correct locations.
If you are manually creating a hierarchy or modifying an existing hierarchy, you can
insert data sources in several different places, including above the top level of the
hierarchy. However, you must follow these rules:
If all the columns from a query only provide information to a single level,
then the data source may reside at that level. The columns in this query will
not be visible at any other level.
Instructional Tips
In order for the columns in a top-level
data source to be available to all
levels of the hierarchy, these
columns must be included in that
hierarchys template. Templates are
discussed later in this course.
3-11
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
3-12
multiple tables
Instructional Tips
Point out that constructing a hierarchy from
the rows of one table will usually result in
unbalanced hierarchies. Unbalanced
hierarchies are covered later in this course.
Creating a hierarchy from multiple tables
(also known as a snowflake schema)
usually implies that the source data is very
well normalized.
CREATE
Year
Quarter
Year
Quarter
Period
2009
2009Q1 200901
2009
2009Q1 200902
2009
2009Q1 200903
2009
2009Q2 200904
Period
HIERARCHIES
Instructional Tips
The slide example shows a fiscal hierarchy
based on the relationship between columns
in the same data row.
The source table includes year, quarter,
and period columns. Each year contains
quarters, and each quarter contains
periods. The ascending hierarchical order
is therefore period-quarter-year.
Each data row identifies the year, quarter,
and period to which it relates.
The example in the slide is not standard for
an operational system. However, an earlier
attempt at a data model might present the
data in this manner.
This is also the structure you might see in
the result set of complex SQL queries that
join multiple tables.
3-13
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
3-14
Type
Parent
Location
REGION
n/a
West
STATE
West
California
CITY
STATE
CITY
CREATE
HIERARCHIES
Family
Class
Household
Product
Family
Product
Dictionary Books
Instructional Tips
In the slide example, one family of
products may consist of many
products, but a product must belong
to only one family. A class of
products may consist of many
product families, but a product family
may belong to only one product
class. Three tables contribute to this
hierarchy.
3-15
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Demo 1
Examine Source Data
for Hierarchies
3-16
CREATE
HIERARCHIES
3-17
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Level View
Instructional Tips
When you test a hierarchy, the
Reference Explorer runs the SQL to
temporarily populate the hierarchy.
3-18
CREATE
HIERARCHIES
Demo 2
Create a Hierarchy
from Multiple
Tables and Examine its
Properties
3-19
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
The list on the left side of the Hierarchy
wizard indicates where you are in the
hierarchy creation process.
3-20
CREATE
HIERARCHIES
3-21
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
You can see that the Location hierarchy (which you created and added to
the Location dimension) consists of two levels: Timezone and State.
Task 4. Examine some of the Location hierarchy attributes
and properties.
1. Right-click the Location hierarchy, and then click Explore.
A message appears, prompting you to save your changes to the catalog.
2. Click OK.
The Reference Explorer dialog box appears, with Location (H) selected by
default in the Reference Item list.
3. Click OK, and then examine the attributes of the hierarchy by expanding
various levels (for example, you can see the ID and caption values for
members of the State level).
4. Close Reference Explorer.
5. Right-click the Location hierarchy, and then click Properties.
The Hierarchy Properties window opens.
6. Click the Features tab.
You can see the default property settings for this hierarchy. These will be
discussed further in this course.
7. Click OK.
8. Right-click State, and then click Properties.
9. Click the Attributes tab.
You can see the various attributes that you assigned to this level.
10. Click OK.
Task 5. Examine the State level.
1. Expand the State level, right-click DataStream, and then click Properties.
The DataStream Properties window opens. You can see the data source
mapping for this level.
2. Click OK.
3-22
CREATE
HIERARCHIES
3. Under the State level, expand DataStream, and then double-click the State
data source.
The State Data Source Properties window opens.
4. Click the Query tab.
You can see the SQL statement that retrieves the data from the
dm_location table. The Hierarchy wizard created this SQL statement for
you.
5. Click OK, and then save the catalog.
Results:
You have developed a Location hierarchy so that you can look at
your business from a geographical point of view.
3-23
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
When you use the Date Hierarchy wizard, the hierarchy is not based on source data. Instructional Tips
Therefore, all members are static and are physically stored in the catalog. You can When you create the levels of a static date
hierarchy, you can specify the:
then use this static date hierarchy with multiple fact tables.
3-24
CREATE
HIERARCHIES
34
September
Week 35
Week 36
Sept
35 36 37
38
Week to Start
Aug
34
Week 37
Sept
35 36 37
Week 38
Aug
38
Week to End
34
Sept
35 36 37
38
3-25
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Demo 3
Create and Examine a
Static Date
Hierarchy
3-26
CREATE
HIERARCHIES
Instructional Tips
You can also use the left and right arrow
keys to move between fields, and the up
and down arrow keys to change the values
in each field. In addition, you can use the
calendar control to select a specific start
date and end date by clicking the down
arrows in both the Start date and End date
list boxes.
3-27
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
In the Reference Item list, the (H)
indicates that the structure is a
hierarchy (as opposed to a lookup).
Reference Explorer runs and returns the static values in the Date_static
hierarchy.
4. Expand 2007 (2007), and then expand 2007Q1 (20071).
The result appears as shown below:
3-28
CREATE
HIERARCHIES
Summary
In this module, we have:
3-29
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Workshop 1
Create a Hierarchy from the Columns of One
Table and Examine its Properties
3-30
CREATE
HIERARCHIES
Use the dm_fiscal table to create a hierarchy called Fiscal. You do not
require a static ALL level.
Level
Name
Source
Table
Source Column
for Id
Source Column
for Caption
Year
dm_fiscal
fiscal_yr
fiscal_yr_desc
Quarter
dm_fiscal
fiscal_qtr
fiscal_qtr_desc
Month
dm_fiscal
period_no
period_no_desc
View the properties and mappings of the Fiscal hierarchy to ensure that it is
structured correctly.
For more detailed information outlined as tasks, see the Task Table on the next
page.
For the final query results, see the Workshop Results section that follows the Task
Table.
3-31
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
WHERE TO WORK
Build tree
HINTS
Build tree
Reference Explorer
If you need more information to complete a task, see the Step-by-Step instructions
at the end of this workshop.
3-32
CREATE
HIERARCHIES
Workshop 1: Results
When you have finished creating the Fiscal hierarchy, the Visualization pane
appears as shown below:
When you view the hierarchy in Reference Explorer, the result appears as shown
below:
3-33
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
3-34
CREATE
HIERARCHIES
3-35
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
CREATE
HIERARCHIES
3-37
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Workshop 2
Create a Hierarchy from the Rows
of One Table and Examine its
Properties
3-38
CREATE
HIERARCHIES
Create the Class and Product levels for the Product hierarchy:
Source Column
for Id
Source Column
for Caption
product_cd
product_name
parent_product_cd
product_type
View the properties and mappings of the Product hierarchy to ensure that it
is structured correctly.
For more detailed information outlined as tasks, see the Task Table on the next
page.
For the final query results, see the Workshop Results section that follows the Task
Table.
3-39
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
WHERE TO WORK
Build tree
Hierarchy wizard
Reference Explorer
HINTS
If you need more information to complete a task, see the Step-by-Step instructions
at the end of this workshop.
3-40
CREATE
HIERARCHIES
Workshop 2: Results
When you have finished creating the Product hierarchy, the Visualization pane
appears as shown below:
When you view the hierarchy in Reference Explorer, the result appears as shown
below:
3-41
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
3-42
CREATE
HIERARCHIES
fostering.
You can now see the five different types of products within the Kitchen
class. The result appears as shown below:
3-43
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
3-44
IBM Cognos 8 BI
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
4-2
CREATE
BASIC
BUILDS
Objectives
In this module, we will:
document a catalog
4-3
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
4-4
CREATE
BASIC
BUILDS
What is a Build?
A build is a named unit of work that goes through the process of:
data extraction
data transformation
data delivery
Builds are the foundation of the data warehouse, which is designed to provide
structured and clean data to users.
The build process is iterative in scope. A build can be tested, implemented, modified,
and then re-implemented to further fine-tune the eventual structure of a data mart. It
is this iteration that determines the final shape of the data marts and conformed
dimensions that will compose the data warehouse.
4-5
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Types of Builds
Dimension builds are used to deliver data to dimension tables
in data marts.
Fact builds are used to:
4-6
CREATE
BASIC
BUILDS
Reference
structure to
be delivered
Dimension
Build
Template Outlining
the Columns of the
Dimension Table
and the Behavior
of these Columns
Dimension
table
created
Target
Data Mart
A dimension build acquires dimension data from the hierarchy that you specify and
loads it into the data mart in the form of one or more dimension tables.
In Data Manager it is best practice to use a dimension build to deliver dimension
data. It is possible to deliver dimension data in a fact build, but you would typically
only do this if you are creating a single, private data mart that is not going to be
integrated with any other data marts.
You would use dimension builds if you have a number of fact tables that share the
same set of dimension tables (conformed dimensions). You can use dimension
builds to create and populate the dimension tables, even if the related fact data is
not yet ready to be delivered.
Instructional Tips
As we shall see in later modules, it is
very common in the data warehouse
development process to create the
dimension builds first, particularly when
using conformed dimensions. We will
cover this topic further in Module 6,
"Create Conformed Dimensions."
In general, you should not deliver
dimension data in a fact build. However,
there are exceptions to this rule:
demos or proof of concepts (POCs)
you want to spin off individual data
marts from a data warehouse to
local servers. For example, you may
want to use a single fact build (with
dimension deliveries) to push out a
data mart that contains data from
the Northeast Region of your
company. This data mart would
include both fact table(s) and
dimension table(s).
4-7
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
4-8
2.
Define the schema that you want to use and the dimension
that you want to deliver.
3.
Define how the tables and columns of the dimension tables will
be named.
4.
5.
CREATE
BASIC
BUILDS
Demo 1
Create a Dimension
Build
4-9
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
6. In the tree, ensure that the Location build is selected, and then on the
toolbar, click Execute
4-10
CREATE
BASIC
BUILDS
7. Click OK.
The Location dimension build runs in a separate command window and
delivers 52 rows to the D_Location table of the data mart.
8. Press Enter to close the command window.
Task 3. View the data in the D_Location dimension table.
1. On the toolbar, click Open the SQLTerm window.
SQLTerm opens.
2. In the Database list, click Output.
3. In the Database objects pane, expand Output and dbo, right-click
D_Location, and then click Add table select statement.
4. A SELECT statement is added to the Query pane.
5. Click Return all rows.
The query executes and returns 52 rows. The result appears as shown
below:
6. Close SQLTerm.
Results:
You created a simple dimension build based on the existing
Location hierarchy. You then ran the build to deliver one
dimension table to the data mart.
4-11
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Dim
Data
Sources
Data
Source
DataStream
DataStream
Data
Source
Product
Time
Location
Dimension
Delivery
Fact
Delivery
In a fact build, the columns extracted from the transactional data (through SQL)
map to elements in the build's transformation model. Data Manager uses build
elements as a transformation area in memory to manipulate the source data before it
is delivered to the target.
After the data has been transformed, Data Manager organizes its delivery to two
types of modules: fact and dimension. Each delivery, in turn, may subscribe to some
or all of the build elements.
4-12
CREATE
BASIC
BUILDS
Product
DataStream
10100101
Data
Source
DataStream
Delivery
Transformation Model
1. First, the hierarchies are populated with reference data, which is then stored
in memory. This reference data is used to check the data integrity of the
incoming fact data.
2. Next, Data Manager reads the fact data, which consists of the transactional
information acquired through queries (usually from OLTP systems).
3. After Data Manager reads the fact data, this data can be transformed,
merged, and aggregated as necessary, and then delivered to the data mart.
Instructional Tips
1. For example, you want make
sure that each sale (from the
fact data) refers to a legitimate
product (from the dimension
data).
2. For example, the fact data for a
department store chain includes
sales figures, such as the
number of products sold by
location during the month of
July. These figures are obtained
mainly from the transactions
recorded by the cash registers
in each store. However,
additional sales data may exist
in separate data stores on other
systems.
4-13
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
dimension
2.
derived dimension
3.
measure
4.
attribute
5.
derivation
Element
Description
Dimension Contains data that is used to give context to a measure (for example,
Product gives context to Price). The values of incoming fact
dimension elements are checked against members of related
hierarchies.
Derived
Allows you to use a calculated expression as the source for a
Dimension dimension attribute. This expression can be the result of another
dimension element that exists in the transformation model.
Measure
Attribute
Derivation
4-14
Technical Information
A derivation can be composed of many
objects, including string literals (for
example, "FRANCE"), calculation formulas
defined in terms of measures or other
derivations (for example, 'Revenue'
'Cost'), or even an attribute of one of the
dimensions (such as the Unit Weight
attribute of the Product dimension).
You can manually add derivations to the
data source and the DataStream, as well
as to the transformation model of the fact
build.
You cannot specify derivation and derived
dimension elements in the Fact Build
wizard. However, you can insert these
elements into an existing fact build by rightclicking the transformation model node.
CREATE
BASIC
BUILDS
The Fact Build wizard guides you step-by-step through the process
of creating a fact build:
1.
2.
3.
4.
5.
6.
4-15
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
A star schema is the most common and
usually the most efficient choice for
creating fact builds. The star schema is,
therefore, the focus of this module.
Relational Datamart
Data Transfer
Each fact build type provides default settings for the data mart
delivery.
You want to
Relational Datamart
Data Transfer
4-16
Technical Information
In a star schema, a single fact table is
created, and all the data from each
dimension is stored in its own separate
table. The primary key of this table is the
key (either business or surrogate) of the
lowest level in the dimension. For
example, a Product dimension table has
a primary key of Product Id, not Product
Type Id (because that is the unique Id of
the next-highest level). The schema can
therefore be viewed as a fully
denormalized representation of the
dimension.
A single fact table is also created in a
snowflake schema. However, a separate
table is created for each level of each
dimension. The primary key of each table
is the key (either business or surrogate)
of each level. Each table, except the
top-level table, has a foreign key to link it
to the table of the level above it. For
example, a Product Type dimension
table has Product Type Id as its primary
key. It also has Product Line Id as a
foreign key linking it to the Product Line
table.
If you want the Fact Build wizard to give
you the option of creating aggregate fact
tables, you must select the Allow
Aggregation on Build Dimensions
check box.
Aggregation is discussed later in this
course.
CREATE
BASIC
BUILDS
By default, when you select the data transfer option, the Fact Build wizard creates all Instructional Tips
transformation model elements as attributes. The Fact Build wizard does not create In the slide example, a data transfer
fact build was created using the Fact
dimension data.
4-17
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Demo 2
Create a Fact Build
4-18
CREATE
BASIC
BUILDS
Instructional Tips
The IBM Cognos BI Mart (Star) type of
fact build is selected automatically.
5. In the left pane, expand dbo, and then select the dm_stock check box.
4-19
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
2. In the list, double-click Fiscal, and then click the Fiscal hierarchy.
3. Repeat steps 1 and 2 for the state_cd and product_cd elements.
These will use the Location and Product hierarchies, respectively, as the
reference structures.
The result appears as shown below:
4. Click Next.
You must now define the fact and dimension deliveries for the Stock fact
build.
Task 4. Set the properties of the Stock build's fact data and
dimension data deliveries.
1. Click Next to accept the default properties of the fact delivery.
2. Click Next to accept the defaults for the fact delivery's table and column
names.
3. Click Next to accept the summary of the fact delivery.
4. Click Next to accept the default properties of the dimension delivery.
5. Click Next to accept the defaults for the dimension delivery's table and
column names.
6. Click Next to accept the summary of the dimension delivery.
7. Click Finish to accept the summary of the fact build.
4-20
CREATE
BASIC
BUILDS
8. In the left pane, under the Builds and JobStreams folder, ensure that the
Stock build is selected.
The results appear as shown below:
4-21
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
4-22
CREATE
BASIC
BUILDS
Transactional
data sources
Fact and
dimension tables
After a fact build has been created, you can see an easy-to-understand graphical
representation of everything the build contains. By clicking the first tab of the Build
Visualization pane, we can view the build's components.
Instructional Tips
You can see this visualization by clicking
the first tab of the Build Visualization pane.
This tab contains the name of the build.
Click the Copy to clipboard button on the
toolbar to copy the contents of the
Visualization pane to the Windows
clipboard. You can then paste the contents
into another application.
4-23
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
You can see this visualization by
clicking the Mapping tab in the Build
Visualization pane.
4-24
CREATE
BASIC
BUILDS
Instructional Tips
You can see this visualization by clicking
the Transformation Model tab in the Build
Visualization pane.
In the slide example, the period_no
dimension element maps to the Fiscal
hierarchy, the state_cd dimension element
maps to the Location hierarchy, and the
product_cd dimension element maps to the
Product hierarchy.
Technical Information
Attribute, derivation, and measure elements
do not map to reference structures.
Therefore, these elements will not be
visible on the Transformation Model tab.
4-25
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
You can see this visualization by
clicking the Fact Delivery tab in the
Build Visualization pane.
4-26
CREATE
BASIC
BUILDS
fact
dimension
Fact delivery modules deliver the fact data that a build produces. A build may have
multiple fact deliveries, and each fact delivery may subscribe to some or all of the
build elements. You can also restrict the fact data to be delivered using a level or
output delivery filter. If your fact data contains columns that are only occasionally
used in queries, you can partition the data so that these columns are stored in a
separate, but linked table.
Technical Information
Subscribing to elements in the fact build's
transformation model involves delivering
the elements to different delivery modules.
For example, you may want to deliver the
Product dimension element and related
measures to a relational table and the other
elements to a text file.
Dimension delivery modules deliver data that describes a single dimension (such as
Product) to the target database. Data Manager lets you send the data to a single table
Adding filters determines which data rows
(star schema) or multiple tables (snowflake schema). There can also be more than
Data Manager will deliver to which areas of
one dimension delivery per dimension, for example, two star schemas.
4-27
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
database tables
files
Teradata Fastload
Teradata Multiload
Teradata Tpump
Netezza NZLoad
Sybase ASE BCP Command
Sybase IQLoad
4-28
CREATE
BASIC
BUILDS
Instructional Tips
You can access the Execute Build dialog
box by first selecting the build and then
clicking Actions/Execute. From here you
can modify the default options.
To bypass the dialog box, click the Execute
button on the toolbar.
Status messages
are output to the
command line.
Description
Normal
Object
Creation
Creates the delivery modules but does not implement the fact
build. This mode will create the physical delivery structures but will
not deliver the data into those structures. This mode is generally
used when developing a new build.
Check
Only
Technical Information
The command line code is typically used in
a batch file that is run at regular intervals to
keep the data warehouse up to date. In this
case, it will be necessary to remove the -P
command from the code, which ensures
that Data Manager does not prompt the
user to press Enter when the build is
finished running, halting the entire process.
4-29
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Type of Information
Description
Progress
Detail
Internal
SQL
ExecutedSQL
User
4-30
Technical Information
You specify the log information by clicking
the appropriate boxes in the Trace list
section of the Fact Build Properties
window.
By default, only Progress messages are
written to the command window and the
log file.
CREATE
BASIC
BUILDS
Demo 3
Execute a Fact Build
and View the
Resulting Log File
4-31
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
4-32
CREATE
BASIC
BUILDS
Document a Catalog
You can document the contents of a catalog in HTML (hypertext
markup language) format for viewing in your Web browser.
You can then examine and print this documentation.
You can generate:
full documentation
Full documentation provides full component details with SQL statements and also
includes information about all configured delivery modules. If you include business
names and descriptions for any objects (for example, a fact build), these will be
included in the documentation as well.
Usage Summary documentation just provides a list of all catalog components.
Technical Information
You can enter the name of a master
document to use as a template for
the generated documentation. This
master document must have HTML
tags within it and an <INSERT> tag
to mark the point of insertion for the
generated document.
4-33
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Demo 4
Document a Catalog
4-34
CREATE
BASIC
BUILDS
4-35
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
4-36
CREATE
BASIC
BUILDS
When you create a catalog, Data Manager automatically creates the tables it requires. Technical Information
Use the buttons at the bottom of the
However, for some installations where a database administrator must set up the
tables manually, you can use the database schema function to specify the tables that Database Schema window to:
have to be created.
4-37
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Summary
In this module, we have:
4-38
documented a catalog
Create Derivations
IBM Cognos 8 BI
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
5-2
CREATE
DERIVATIONS
Objectives
In this module, we will:
examine derivations
5-3
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
What is a Derivation?
A derivation is a value that Data Manager calculates rather than
obtaining it from the data source.
A derivation can be derived from other Data Manager objects.
A derivation can be used as:
Using Data Manager, you can create a derivation to perform complex calculations
and, where required, output the result in the data mart.
Instructional Tips
To get a string literal, such as FRANCE,
the CONCAT or any other text functions
can be used.
5-4
a string literal
CREATE
DERIVATIONS
you have more than one data source, but the derivation is only to be
performed on one
same calculation is used for each of the data sources, that is, the data for
each data source must undergo the same derivation
values are only available after the data has been merged
data uses input values that are stored from reference structures
5-5
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
A derivation is a calculated value that can contain numeric and character constants,
operators, functions, and the names of other Data Manager objects. The simplest
expression is either a literal value or the name of a Data Manager object. Data
Manager has a rich library of built-in functions to assist you with calculating
derivations.
5-6
Instructional Tips
Calculations stored in the data mart
assist in standardization, where all users
apply the same formulas. This produces
consistency in the organization's use of
the data mart because all users apply
one standardized calculation. For
example, if the same definition may
always need to be used for net profit or
commission.
CREATE
DERIVATIONS
Generally, mathematical operators combine numeric values to produce numeric Technical Information
Regarding mathematical operators,
results.
Binary logical operators compare two values. Single logical operators operate on a
single value. The result of a logical operation is either TRUE or FALSE.
5-7
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Technical Information
Because member functions are only valid
within the context of Data Manager builds,
you cannot use them when acquiring data
from a SQLTXT database.
Examples
Conversion
Control
Logical
If(), IfNull()
Mathematical
Member
Text
Date
You can use functions in calculations to provide values for derivations (data
source, DataStream, and transformation model) and derived dimensions, for
filters, and in SQLTXT Designer.
5-8
Control functions give some control over how Data Manager executes a
build.
CREATE
DERIVATIONS
Add
Calculate
Test
Because a derivation does not come from the data source directly, you do not have
to modify the data source SQL statement. However, the fact build or dimension
build must contain the Data Manager objects that are included in the calculation.
To create a data source derivation:
1. Add a derivation to the data source of the fact build or reference structure
(for a dimension build).
2. Provide a name for it and create a calculated expression using operators,
functions, and other components.
3. Test the expression. If you do not get the correct or any result, the
expression is invalid.
5-9
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Add
Calculate
Test
5-10
CREATE
DERIVATIONS
Calculate
Test
Technical Information
You can only add a transformation model
element to a fact table delivery.
3. Test the expression. If you do not get the correct or any result, the
expression is invalid.
5-11
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
AverageRevenue
Quantity * UnitCost
MEASURE
MEASURE
Revenue
(Quantity*UnitCost)
DERIVATION
AVGRevenue
AGGREGATION
Aggregate the data first, and then calculate the derivation. This method
makes it possible to more quickly process the data.
If you select the Calculate at Source box, Data Manager calculates a derivation as
soon as data is retrieved from the query (and pivoted and merged, if applicable),
and then aggregates the derived values. The derivation is calculated using detail
data (for example, product sales instead of product line sales) and aggregated as
though it was a measure element. It is the equivalent of performing a calculation in
the SQL query and then treating the resulting column as a measure. By selecting
the Calculate at Source box, you do not have to go to the trouble of modifying the
source SQL and creating additional measure elements in your transformation
model.
5-12
Instructional Tips
Aggregation is the process of taking data
across one hierarchical level and
summarizing it to higher levels of detail.
Aggregation is discussed in more detail
later in this course.
To aggregate a derivation element, you
must select the Calculate at Source
check box to enable the Aggregation tab.
You must then select a function from the
list of functions on the Aggregation tab.
In the slide example, we created a
derivation named AverageRevenue that
first calculates revenue for each product
by multiplying Quantity by UnitCost. We
then specified that we want to aggregate
(summarize) the result to the higher
level, Product Type, using the AVG
function. As a result, the derivation
calculates the average revenue
generated by each product type.
CREATE
DERIVATIONS
Pivot
Merge
Lookup
Stream
1. Data Source
Derivation Calculated with
each row
Aggregation
Validation
2. DataStream
Derivation
3. Transformation Model
Derivation - Calculated
at Source
4. Transformation
Model Derivation Calculated postAggregation
Where you create a derivation determines when the derivation is calculated in the
fact build process:
1. A derivation created in the data source is calculated as each row is retrieved
from the data source.
Technical Information
Any derivation created in a data source,
DataStream, or transformation model can
reference other derivations that were
created previously in the same place.
For example, you can create a derivation in
2. A derivation created in the DataStream is calculated after the source data is the DataStream that references another
pivoted, but before it is merged and aggregated.
derivation that was created previously in
3. A derivation created in the transformation model and calculated at the
source is calculated after the source data is pivoted and merged, but before
it is aggregated.
4. A derivation created in the transformation model and not calculated at the
source is calculated after the source data has been pivoted, merged, and
aggregated.
data source to the DataStream) in order to get the values that you want.
5-13
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Demo 1
Add Derivation
Elements to a Fact
Build
5-14
CREATE
DERIVATIONS
Instructional Tips
In this demo, we are using a different
catalog than the one we used for the first
four modules. This catalog already includes
a partially built dimensional framework and
a fact build.
3. In the left pane, click SQL Server (OLE-DB), in the Username box, type
sa, and then in the Password box, type Education1!.
4. In the Server Name list, select (local), and then in the Database Name box,
type GO_Catalog.
5. In the OLE DB Provider list, ensure that sqloledb (SQL Server 2000
OLEDB) is selected, and then click OK.
GO_Catalog opens in Data Manager Designer.
6. In the left pane, expand DemoSales.
7. Right-click Transformation Model, and then click Insert Derivation.
The Derivation Properties window opens.
8. In the Name box, type SalesTotal.
Task 2. Add the calculation formula for the derivation.
1. Click the Calculation tab.
2. In the left pane, double-click the Elements folder, and then double-click
Quantity.
The Quantity element is added to the right pane.
3. In the left pane, double-click the Operators folder, double-click the
Mathematical folder, and then double-click * (multiply).
The multiplication sign is added to the right pane, next to the Quantity
element.
5-15
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
4. In the left pane, double-click the Elements folder, and then double-click
UnitSalePrice.
The result appears as shown below:
Check marks to the left of Quantity and UnitSalePrice indicate that Data
Manager has located a definition for each of these objects. The scope of
these definitions (shown in the Immediate box) is the DemoSales fact build.
2. In the Input values section, double-click the Value column to the right of
Quantity to select the empty cell, type 5, and then press Enter.
5-16
CREATE
DERIVATIONS
3. Double-click the Value column to the right of UnitSalePrice, type 25, and
then press Enter.
4. Click the Type column to the right of Quantity, and then click the ellipsis.
The Data Type dialog box appears.
5. In the Data type list, click NUMBER, and then click OK.
6. Repeat steps 4 and 5 for UnitSalePrice.
7. Click Calculate.
The result appears as shown below:
8. Click Close, click OK, and then click Yes to add the element to existing
delivery modules.
Task 4. Add a second derivation element that references the
SalesTotal derivation.
1. Under the DemoSales fact build, right-click Transformation Model, and
then click Insert Derivation.
The Derivation Properties window opens.
2. In the Name box, type ProfitTotal, and then click the Calculation tab.
3. In the left pane, double-click Elements, and then double-click SalesTotal
to add it to the right pane.
2008, Cognos ULC (formerly Cognos Incorporated)
Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,
or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).
5-17
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
5-18
CREATE
DERIVATIONS
9. Click Close, click OK, and then click Yes to add the element to existing
delivery modules.
10. In the Visualization pane, right-click DataStream, and then click Properties.
11. Ensure that the DataStream Items tab is selected, and then ensure that the
result appears as shown below (if necessary, drag items from the
DataStream Items pane to the appropriate rows in the Maps To column):
12. Click the Input tab, in the Maximum input rows to process box, ensure
that 100 is entered, and then click OK.
5-19
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
5-20
CREATE
DERIVATIONS
Summary
In this module, we have:
examined derivations
5-21
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
5-22
IBM Cognos 8 BI
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
6-2
CREATE
CONFORMED
DIMENSIONS
Objectives
In this module, we will:
6-3
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
D_Stock_Fiscal
period_no
period_no_desc
fiscal_qtr
fiscal_qtr_desc
fiscal_yr
fiscal_yr_desc
F_Stock
period_no
state_cd
product_cd
stock_units
D_Stock_Product
product_cd
product_name
product_cd1
product_name1
product_cd2
product_name2
D_Stock_Location
state_cd
state_name
timezone_cd
timezone_name
all_id
all_caption
It is possible to deliver a single, private data mart using a fact build. To deliver this,
you must include a fact delivery and one or more dimension deliveries.
However, what if we want to track a new fact (such as sales) that will use the same
dimension tables? Or what if we want to make a change to the D_Stock_Location
table? Any changes that we make will be overwritten when the fact build is executed
again.
To deal with these issues, we must create our dimension tables using a separate
process. We must design our dimension tables so that several fact tables can
reference them.
6-4
Instructional Tips
Previously, we used the Fact Build
wizard to create one fact delivery
and three dimension deliveries.
When we executed the fact build,
Data Manager delivered one fact
table and three dimension tables to
the data mart.
CREATE
CONFORMED
DIMENSIONS
Location
Sales Fact
Time
Customer
Distribution Fact
Distributor
Product
Order Fact
Promotion
Conformed Dimensions
Conformed Dimensions
Because most companies have integrated business operations, they have a strong
requirement for an integrated enterprise data warehouse that mimics the business
structure. Conformed dimensions are an important part of this data warehouse.
In a production environment, you will typically create each dimension table in a
separate process by running dimension builds, rather than using dimension
deliveries in a fact build. If you deliver your dimension tables using fact build
dimension deliveries, you will continually overwrite the dimension data each time
you execute the fact build. This inhibits the development of conformed
dimensions.
Instructional Tips
In the slide example, three fact
tables retrieve reference information
from six dimension tables: Location,
Customer, Product, Time, Distributor,
and Promotion. However, each
dimension table is created only once,
and data inside the tables is
standardized.
6-5
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Branches
Products
Sales
HR
Customer
Sales
Fact
Time
Channels
Inventory
Manufacturing
Data Warehouse
Conformed dimensions:
1. reduce overall time for data warehouse development, because each
dimension is analyzed, designed, and created only once
2. enable you to make changes to the data warehouse as business requirements
evolve
3. provide a consistent view of your business, which makes it possible for you
to drill from one area of your business to another
6-6
Instructional Tips
Example for #2: you may need to
periodically add new fact tables to
existing data marts.
Example for #3: if your company
does not have a single definition for
product, you cannot compare
production to sales.
CREATE
CONFORMED
DIMENSIONS
Instructional Tips
Example for #2: If sales are
summarized to the monthly level,
then you cannot analyze sales by
day of the week.
Surrogate keys will be examined
later in this module.
Example for #4: Once application
may refer to a client as a "customer,"
while another application refers to
the client as a "prospect."
6-7
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
In the architecture phase that precedes
the implementation of any of the data
marts, the goals are to produce a master
suite of conformed dimensions and to
standardize the definitions of facts. The
resulting set of standards is called the
"Data Warehouse Bus Architecture." For
more information on this, see Ralph
Kimball's et al's The Data Warehouse
Lifecycle Toolkit.
6-8
Distribution
Fact
Order Fact
Promotion
Time
Sales Fact
Distributor
Product
Facts
Location
Customer
Dimensions
X
X
CREATE
CONFORMED
DIMENSIONS
D_Product
Product Id
Description
Product Type
Type
Description
Product Line
Line Description
Order Fact
Day Id
Product Id
Customer Id
Cost
NumberOrdered
D_TimeDay
Day Id
Day
Month
Year
D_Customer
Customer Id
Last Name
First Name
Address
To provide maximum flexibility for business users, populate the fact tables with
atomic-level or transaction-level data. You should also define the conformed
dimension tables at the lowest level of granularity.
This absolute lowest level of granularity ensures that all business questions are
answered at any level of summarization. It provides flexibility for users who can
add new reference data, or extract information on each individual product,
customer, or location.
The low level of granularity does not eliminate the rolled-up fact and dimension
tables. On the contrary, it is good practice for any data warehouse to have both
transaction and snapshot fact tables.
Instructional Tips
In the slide example, the grain of the
Product dimension is a single product,
the grain of the Customer dimension is
an individual customer, and the grain of
the Time dimension is a single day.
Point out to the students that, in this
example, even the Product Id column
may not represent the lowest level of
granularity. A product tracked by this
dimension table may be made up of
individual components that must be
tracked in a separate Components
dimension table.
Example of a summary table: a company
wants to have a snapshot of fact data on
monthly (as opposed to daily) orders. In
this situation, it is better to create a
summary table on orders, which
references the month level of the Time
dimension.
6-9
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Product
Product Id
Description
Product Type
Product Line
Order Fact
Day Id
Product Id
Customer Id
Cost
NumberOrdered
Sales Fact
Month Id
Product Id
Customer Id
AmountSold
Revenue
Time(Day)
Day Id
Day
Month Id
Month
Period
Time(Month)
View
Month Id
Month
Period
By having a combination of atomic-level fact and dimension data, you can support
queries that can report and summarize across any combination of dimension
attributes. Most contemporary reporting and analysis tools are designed for exactly
this type of database.
Some situations, where users require different levels of detail in their reports, require
multiple levels of detail within a single dimension.
6-10
Instructional Tips
For example, if it is known that the
Time dimension will be queried by
Month and Day on a regular basis, a
designer has two options:
1. create a monthly view of the
Time dimension (as
recommended by Kimball); you
create this view by writing a
SELECT DISTINCT statement
against the Time(Day) table that
will retrieve only monthly data
2. create a separate physical
(snowflake) monthly table
CREATE
CONFORMED
Surrogate keys are numeric keys that can replace business keys in
the context of a data mart.
numeric
2.
unique
3.
4.
Cust
Cust
Key
Key
11111
1/1/1999
12345
11111 1/1/200812345
11111 2/1/200812345
2/1/1999 12345
11111
11112 3/1/200812345
11112 4/1/200812345
Office Eff
RepSur Rep Name
Office
Key
Key
(Type 2) Date
11111 00128 Mary Smith Dallas 200801
11112 00128 Mary Smith NYC 200803
1. Surrogate keys tend to be smaller than the keys from operational systems,
which are typically text-based. If keys from operational systems are used to
join tables, the table sizes can be unnecessarily large.
DIMENSIONS
Instructional Tips
In the slide example, Mary Smith is a
sales rep, and her information (such
as her name) is stored in the Sales
Rep dimension table.
Mary Smith has a rep key of 00128.
However, as shown in the Sales Rep
dimension table, she has moved
from the Dallas office to the one in
New York City.
We want to track all of Mary Smith's
sales in the Sales Fact table, and
associate each sale to the
appropriate office (in this case, either
Dallas or New York).
To correctly tie the rows together, we
assign surrogate key values to Mary
Smith in the Sales Rep dimension
table. The row where she was a
member of the Dallas office has a
surrogate key of 11111. The row
where she was a member of the
NYC office has a surrogate key of
11112.
2. Operational keys may be unique within the database in which they reside.
However, they may not be unique across a build that accesses data from
multiple databases. To track changes to dimensions over time, the keys
must be unique.
3. Using surrogate keys, you can combine data from tables with incompatible
keys.
4. Because surrogate keys have no intrinsic meaning, they are not subject to
the same changes as operational keys. For example, product codes may
expand to accommodate additional information.
6-11
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
OrderDate
SalesRepCode
Quantity
SalesRepName
Revenue
SalesBranchCode
...
The surrogate key replaces a business key in a dimension; hence the term
surrogate.
Each fact table joins to one or more dimension tables. The join columns consist of
surrogate keys.
Each surrogate key acts as a primary key in the dimension table and as a foreign
key in the fact table.
6-12
Instructional Tips
In the slide example, the Product
dimension table is linked to the fact
table by the ProductKey column. The
SalesRep dimension table is linked
to the fact table by the SalesRepKey
column. Both ProductKey and
SalesRepKey are surrogate keys.
Each of these columns serves as a
foreign key in the fact table.
CREATE
CONFORMED
DIMENSIONS
Because the data warehouse is expected to hold data for several years, it must
contain the most current dimension data, in addition to all the changes it has
undergone over time, in response to the changing structure of the business. Slowly
changing dimensions let you track these historical changes in the data warehouse.
6-13
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Type2
Type2
Normal
Type2
Position
Hire
Date
Salary
Name
Branch
10001
Jack
OTA
VP
Jan1998
100K
10002
Jane
ARL
MK
Jan2002
80K
10003
Tom
NY
SS
Jan2003
60K
10001
Jack
SJ
VP
Jan1998
100K
**
10001
Jack
SJ
S-VP
Jan1998
100K
***
10001
Jack
SJ
S-VP Jan1998
130K
Emp. No
Normal
(Emp. No + Branch)
SCDs are used to manage historical data. They are dimensions where non-key
attributes can change over time without corresponding changes in the business key.
For example, employees may change their department without changing their
employee number, or the specification for a product may change without the
product code changing.
SCDs require that the data warehouse developer has a way of tracking the data
warehouse members and their status without making the issue unnecessarily
complex. The solution is to replace these cumbersome keys with efficient surrogate
keys.
The maintenance of SCDs and surrogate keys is automated in Data Manager.
6-14
CREATE
CONFORMED
DIMENSIONS
Type 1 - Overwrite the old value with the new value (do not
track the changes).
The choice of method largely depends on the business's need to track changes. By
far, the most commonly accepted methods are:
A single row may consist of attributes in any combination of the three types. Often,
if a single column is Type 2, the entire dimension is referred to as a Type 2 slowly
changing dimension (SCD).
To track Type 2 SCDs, you must use surrogate keys.
6-15
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
For example, the Product table exists
in two data sources, an Oracle
database and a Sybase database.
P_112
Tent
Canvas 2 man pup
D_Product
Oracle
...
ProductId
Sybase
Product
Product
Tent
Name
Description Canvas 2 pers
ProdKey
Name
Desc
1212
Tent
Canvas 2 person tent
Product
120
6-16
CREATE
CONFORMED
DIMENSIONS
Sales
(Gross)
Profit
Gross Profit
Profit
SalesFact
(Gross Profit)
(Net Profit)
Net Profit
Finance
(Net)
Profit
Instructional Tips
According to Kimball, setting up the
conformed dimensions takes 80
percent of the up-front architectural
effort. Establishing standards for fact
definitions uses the remaining 20
percent.
For example, Sales and Finance may
both use the term Profit, but Sales
defines it as Gross Profit and Finance
defines it as Net Profit. Using the term
Profit in the data warehouse would be
inaccurate and misleading. Ensure
that both measures have unique
names to represent their appropriate
values in the fact table.
6-17
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
6-18
Instructor Note
JobStreams are examined later in this
course.
To create and deliver the data marts you designed, use Data
Manager to complete the following steps:
1.
Create hierarchies.
2.
3.
4.
5.
CREATE
CONFORMED
DIMENSIONS
After you establish the conformed dimensions and create the dimensional
framework, deliver the dimension data into the dimension tables. Each dimension
build references and delivers one dimension into one or more tables.
Although it is physically possible to create dimension tables as part of a fact build, it
is not recommended. Almost all dimensions must be incrementally updated. It is
very difficult to develop and debug fact builds that simultaneously deliver fact data
and incrementally maintain dimension data.
Instructional Tips
In the slide example, the Product
dimension build was created. This
dimension build will deliver a conformed
dimension table called D_ProductH to the
data warehouse.
Therefore, you should deliver conformed dimensions before executing the fact
builds. It is also recommended that you maintain all dimensions by using dimension
builds, not fact builds.
6-19
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Demo 1
Create Conformed
Dimension Builds
6-20
CREATE
CONFORMED
DIMENSIONS
Additional Information
The underlying Product hierarchy
(which we are delivering using the
D_ProductH dimension build) has a
parent-child structure. The products
roll up into classes, and each row of
the underlying source table identifies
both the product itself and the class
that it belongs to.
If we did not select Level and
Attribute in the Column naming
strategy list:
the IDs and captions at the
product level would be named
Product_cd and Product_name.
the IDs and captions at the
class level would be named
Class_product_cd1,
Class_product_name1.
By specifying Level and Attribute in
the Column naming list, the resulting
column names will be more intuitive:
the IDs and captions at the
product level will be named
Product_product_cd, and
Product_product_name.
the IDs and captions at the
class level will be named
Class_product_cd and
Class_product_name.
6-21
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
You will now rename the skey attribute in the template for each dimension
build to more accurately reflect the level to which the surrogate key relates.
10. In the left pane, ensure that the D_LocationH dimension build is selected,
and then in the Visualization pane, double-click the D_Location1 template.
11. Click the Attributes tab, in the Attribute Name column, double-click skey,
and then type state_skey.
The result appears as shown below:
6-22
CREATE
CONFORMED
DIMENSIONS
2. When the build has finished executing, press Enter, and then repeat step 1
for the D_LocationH dimension build.
A dialog box appears, indicating that the existing D_Location table (which
you delivered in Demo 4-1) does not contain a surrogate key column called
state_skey. You will allow Data Manager to drop this table and replace it
with a new dimension table that includes the surrogate key column.
3. Click Drop Tables, and then click Yes to confirm.
The build runs and delivers 52 rows to the D_Location table.
4. When the build has finished executing, press Enter, and then repeat step 1
for the D_ProductH dimension build.
16 rows are delivered to the D_Product table.
5. When the build has finished executing, press Enter, and then open
SQLTerm.
6. In the Database list, click Output, and then in the Database objects pane,
expand Output and dbo.
7. Right-click D_Fiscal, click Add table select statement, and then click
Return all rows.
The query runs and returns 36 rows of data. The result appears as shown
below:
6-23
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Lookup
AllProducts
Product Line
Product Type
Product
Each surrogate key column of a fact table can reference either type of structure. The You cannot have an "All" level in a
type of structure that you reference depends on how you want to process the
lookup. This is because a lookup
consists of only one level. Therefore,
incoming fact data.
6-24
CREATE
CONFORMED
DIMENSIONS
data integrity
checking
surrogate key
substitution
Each surrogate key column of a fact table can link to either a hierarchy or a lookup. Instructional Tips
However, the type of reference structure that you use will depend on what you want In the top slide example, we are only
performing data integrity checking and
to do with the fact data.
6-25
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Product
Product(H)
Product
Hierarchy
Lookup
D_Product
D_Product
ProductNumber
ProductNumber
ProductKey
ProductKey
----------------------------------------Product
Product(L)
F_Sales
F_Sales
Transactions
Sales
ProductNumber
Quantity
Instructional Tips
This slide is one of the most important in
the entire course. It gives a high-level
outline of why conformed dimensions
and templates are so important and how
they are used for checking the validity of
incoming fact data.
ProductKey
ProductKey
Quantity
Quantity
When checking data integrity, a fact table usually only needs to reference a single
level in each dimension. For performance reasons, it is often best to use a lookup
instead of a hierarchy in these cases. Lookups usually require fewer columns in the
data source and less memory to process.
Unless you want the reference attributes to be available for calculations, the data
integrity lookup usually needs no more than two attributes: the business key and
the surrogate key.
6-26
CREATE
CONFORMED
DIMENSIONS
Technical Information
In general, any time that you access data
from a dimension table in the data
The attributes of the template that is used to create the dimension table also provide warehouse, you should use a template
the column names for that table. Because the attributes and column names match, rather than a DataStream to access the
data.
Data Manager automatically maps the table columns to the template attributes.
If the attribute or column names have
been changed, you must use data source
access and map the column manually.
In the properties of the fact build's
dimension element (for example,
ProductNumber), you must select the Use
surrogates when available box. The new
fact rows being inserted into the data mart
must use the surrogate keys instead of the
existing business keys.
6-27
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Demo 2
Create Data Integrity
Lookups
6-28
CREATE
CONFORMED
DIMENSIONS
6. Click the Data Access tab, select Use Template for data access, and
then in the Connection list, click Output.
7. Beside the Table name box, click Browse.
The Select Table dialog box appears.
6-29
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
6. Click the Data Access tab, select Use Template for data access, and
then in the Connection list, click Output.
7. Beside the Table name box, click Browse.
The Select Table dialog box appears.
8. Double-click dbo, click D_Location, and then click OK.
9. Click OK to close the Lookup Properties window.
The result appears as shown below:
6-30
CREATE
CONFORMED
DIMENSIONS
6. Click the Data Access tab, select Use Template for data access, and
then in the Connection list, click Output.
7. Beside the Table name box, click Browse.
The Select Table dialog box appears.
8. Double-click dbo, click D_Product, and then click OK.
9. Click OK to close the Lookup Properties window.
The result appears as shown below:
6-31
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
6-32
CREATE
CONFORMED
DIMENSIONS
Demo 3
Create a Fact Build that
References Data
Integrity Lookups
6-33
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
6-34
CREATE
CONFORMED
DIMENSIONS
12.
13.
14.
15.
6-35
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
The rejected fact rows have a state_cd
value of NX, which does not exist in the
LocationL lookup. At this point, you may
want to open the Sales.rej reject file to
show the students where this data is
stored and indicate that it can be
reprocessed into the system once it has
been cleansed. You may also want to
point out that these kinds of rejected rows
could also be delivered to their own
database table.
6-36
CREATE
CONFORMED
DIMENSIONS
Conformed Dimensions
Reference
Data
Reference
Sources
Data Sources
Product
Updates
Customer
Dimension Builds
Product
Customer
D_Customer
D_Customer
Customer
Product
D_Product
D_Product
Data Warehouse
6-37
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Conformed Dimensions
D_Customer
D_Customer
Transactions
Updates
F_Returns
F_Returns
D_Product
D_Product
Sale
ProductNumber
Returns
CustomerCode
.ProductNumber
CustomerCode
Fact Builds
6-38
D_Customer
F_Sale
F_Sale
Data Warehouse
...
CREATE
CONFORMED
DIMENSIONS
Summary
In this module, we have:
6-39
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Workshop 1
Create a Lookup and a Fact Table
that Use Conformed Dimensions
6-40
CREATE
CONFORMED
DIMENSIONS
Create a lookup called QuarterL that references data at the quarter level of
the D_FiscalH conformed dimension table. This lookup will only include
the fiscal_qtr attribute, which must be specified as the ID attribute. Ensure
that a SELECT DISTINCT statement is used to retrieve the data.
Create a new build called Forecast that retrieves data from the dm_forecast
source table. Ensure that this build includes a dimension element that
references the QuarterL lookup, as well as elements that reference the
LocationL and ProductL lookups. Rename the relevant DataStream items
and transformation model elements so that they match the attributes that
they will be referencing in the underlying lookups (fiscal_qtr, state_skey,
and product_skey).
Execute the Forecast fact build and view the results in SQLTerm.
For more detailed information outlined as tasks, see the Task Table on the next
page.
For the final query results, see the Workshop Results section that follows the Task
Table.
6-41
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
WHERE TO WORK
HINTS
Connection: Output
Table: D_Fiscal
Use DISTINCT in
template table SELECT
statement.
SQLTerm
If you need more information to complete a task, see the Step-by-Step instructions
at the end of this workshop.
6-42
CREATE
CONFORMED
DIMENSIONS
Workshop 1: Results
When the Forecast fact build is complete, the Forecast tab of the Visualization pane
appears as shown below:
When the Forecast fact build is complete, the Transformation Model tab of the
Visualization pane appears as shown below:
After the Forecast fact build is executed, the results in SQLTerm appear as shown
below:
6-43
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
6-44
CREATE
CONFORMED
DIMENSIONS
12. Click Next, click Next, and then click Next again.
13. Click Next, clear the Deliver Dimensions check box, and then click
Next.
14. Click Finish.
Task 3. Execute the fact build and view the results.
1. Save the catalog, in the tree, ensure that the Forecast fact build is selected,
and then on the toolbar, click Execute.
The fact build executes and delivers 9,792 rows of data to the F_Forecast
table.
2. Press Enter, and then open SQLTerm.
3. In the Database list, click Output, and then in the Database objects pane,
expand Output and dbo.
4. Right-click F_Forecast, click Add table select statement, and then click
Return all rows.
The query runs and returns 9,792 rows of fact data. Each row includes
values in the fiscal_qtr, state_skey, and product_skey columns. The values
in the state_skey and product_skey columns are surrogate key values, while
those in the fiscal_qtr column are not.
5. Close SQLTerm, and then close Data Manager.
2008, Cognos ULC (formerly Cognos Incorporated)
Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,
or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).
6-45
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
6-46
IBM Cognos 8 BI
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
7-2
CUSTOMIZE
REFERENCE
STRUCTURES
Objectives
In this module, we will:
examine literals
examine fostering
7-3
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
Q: Why you would want to add an attribute
to an existing hierarchy?
A: A table may require modification if
additional source data can be added that
would increase the value of the dimension
table.
3
6
When you define a hierarchy using the Hierarchy wizard, the wizard only generates
those attributes that are fundamental building blocks in the hierarchy definition.
These attributes include ID, caption, and parent.
When you create a hierarchy manually, you specify the attributes that you want to
include, as well as their usage. You also specify where to get the data for these
attributes. When you have finished creating the hierarchy, you can explore it using
the Reference Explorer tool.
Even if you create a hierarchy using the Hierarchy wizard, you can enhance data
analysis by manually adding other attributes. You define the properties of these
additional attributes in the template for that level.
You can add attributes to a single level of a hierarchy, or to multiple levels in the
same hierarchy.
7-4
Technical Information
You can add attributes to a single level of
a hierarchy. For example, in the Product
hierarchy, only members at the Product
level will have a Color attribute.
You can also add attributes to multiple
levels in the same hierarchy. For example,
in the Location hierarchy, the members at
the Country, Region, and City levels may
have a Population attribute. The attributes
that you choose to include in your
hierarchies will reflect your specific data
analysis requirements.
If you create a hierarchy manually, you
must specify a template to use for each
level of the hierarchy before you can add
that level to the hierarchy. You can
choose an existing template, or create
one.
If you choose an existing template, it must
reside in the Templates folder of the
dimension to which the hierarchy level is
being added.
When creating a hierarchy with multiple
levels, you have two options regarding
templates:
Create the template first, add the
level to the hierarchy, and then use
the template that you just created to
define the attributes for that level.
When using this method, you do not
have to add any attributes before you
save the template.
Insert the level into the hierarchy and
create the template that will hold the
required attributes for that level at the
same time. The template must
contain at least one attribute. You
must define at least one attribute
from the list of attributes in the
template as the ID before you can
create the level.
CUSTOMIZE
REFERENCE
STRUCTURES
Technical Information
If you enter a value of zero when
specifying the number of warning
messages, no warnings are written to the
log file. As a result, you have no indication
of why a row was rejected.
If you are using Transformer to create
PowerCubes against your data
warehouse, keep in mind that the category
codes within a PowerCube must be
unique in all the levels of each dimension.
This uniqueness is also necessary if you
are using another OLAP tool to create a
cube.
Your situation
Option
Accept
You want to accept the item, but write a message to the log file.
Warn
Reject
You want to reject the item and write a message to the log file.
Reject/Warn
You want to write an error message to the log file and stop
executing the build at the current item.
Error
7-5
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Create Literals
Use a literal to return a value that is constant for every row that a
data source returns.
Golf
Other
Products
Golf
Other
Focus Group
Literal values are static pieces of data that the DataStream can return. The literal
values remain constant for every row that is returned. Use a literal value to flag a
piece of data that is returned from the data source.
You can also use a literal value when accessing two data sources in the DataStream
to provide data for a hierarchy level. An example of a literal value might be the
letter C for Current and H for Historical. In this case, use the literal to represent
whether a value comes from current data or historical data.
Instructional Tips
In the slide example, we want to find
information regarding a range of sports
equipment. The DataStream references
two different data sources: Golf
Equipment and Other Equipment. Each
data source returns values that fall within
a certain range, which is determined by
the SQL code. We create a literal called
Golf to flag any equipment that the first
data source returns. We flag any
equipment that the second data source
returns with another literal called Other.
As another example, two different data
sources are used to produce dimension
data. One source uses French data,
while the other uses German data. You
define a literal that indicates which
source the data came from: the French
data source or the German data source.
Inserting a constant in the SQL SELECT
statement achieves the same result as
adding a literal. Using a constant,
however, is less efficient because the
database adds the constant to the row
before sending it to Data Manager. For a
million rows of data, adding a constant
such as "Golf" to the SQL would equate
to four million additional bytes of data
being transmitted across the network.
7-6
CUSTOMIZE
REFERENCE
STRUCTURES
Demo 1
Manually Create a
Hierarchy
7-7
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Attributes
Source Columns
ProductLine
Id: ProductLineCode
Caption: ProductLineName
ProductLineCode (Key)
ProductLine
ProductType
Id: ProductTypeCode
Caption: ProductTypeName
Parent: ProductLineCode
ProductTypeCode (Key)
ProductLineCode (Foreign Key)
ProductType
Id: ProductCode
Caption: ProductName
Parent: ProductTypeCode
Other attributes:
ProductIntroductionDate
ProductProductionCost
ProductMargin
ProductPicture
ProductPictureURL
ProductDescription
ProductNumber (Key)
IntroductionDate
ProductName
ProductTypeCode (Foreign Key)
ProductionCost
Margin
Picture
PictureURL
Description
Product
Source Tables
GOSProductLine
GOSProductType
GOSProduct
Dimension: ProductD
Hierarchy: ProductH
Template: ProductT
7-8
CUSTOMIZE
REFERENCE
STRUCTURES
7-9
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
7. Repeat step 6 to rename the other attributes so that the results appear as
shown below:
8. Click OK.
Task 3. Insert the ProductLine level and select its
attributes.
1. Right-click the ProductH hierarchy, and then click Insert Level.
The Level Properties window opens.
2. In the Name box, type ProductLine, click the Attributes tab, and then in
the Template list, click ProductT.
3. In the Available attributes pane, double-click ProductLineCode and
ProductLineName to add them to the Chosen attributes pane.
4. In the ProductLineCode row, select the Id check box, and then in the
ProductLineName row, select the Caption check box.
The result appears as shown below:
5. Click OK.
7-10
CUSTOMIZE
REFERENCE
STRUCTURES
5. Click OK, in the Visualization pane, right-click DataStream, and then click
Properties.
The DataStream Properties window opens.
6. Click Auto Map.
The columns of the data source are mapped to DataStream items.
7. Click OK, in the Visualization pane, right-click the ProductLine level, and
then click Mapping.
The Level Mapping window opens.
8. Drag and drop ProductLineCode from the Level Attributes pane to the
row beside the ProductLineCode DataStream item.
9.
Drag and drop ProductLineName from the Level Attributes pane to the
row beside the ProductLine DataStream item.
The result appears as shown below:
7-11
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
5. Click OK.
7-12
CUSTOMIZE
REFERENCE
STRUCTURES
10. Click OK, and then save the catalog (click Save my version if prompted).
11. In the Visualization pane, right-click the ProductH hierarchy, and then
click Explore.
Reference Explorer opens.
7-13
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
5. Click OK.
7-14
CUSTOMIZE
REFERENCE
STRUCTURES
9. Click OK, and then save the catalog (click Save my version if prompted).
10. In the Visualization pane, right-click the ProductH hierarchy, and then
click Explore.
Reference Explorer opens.
7-15
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
11. Click OK, and then expand Camping Equipment and Cooking Gear.
The result appears as shown below:
7-16
CUSTOMIZE
REFERENCE
STRUCTURES
a template
You can access data for each level of a hierarchy using either:
Instructional Tips
Slowly changing dimensions (SCDs) are
discussed elsewhere in this course.
a template
7-17
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Product(H)
D_Product
D_Product
ProductNumber
ProductNumber
ProductKey
ProductKey
-----------------------------------------
Product
Lookup
Source template
Reference template
Product
Product(L)
Sales
ProductKey
7-18
F_Sales
F_Sales
Instructional Tips
In the slide example, the Product
hierarchy references a template,
which lists the attributes used by the
hierarchy, such as ProductNumber
and ProductName. The Product
hierarchy will be delivered to the data
warehouse through the D_Product
dimension table.
The dimension table, in turn,
references a second template that
lists the columns of the table as well
as their behavior (such as surrogate
key). This second template
automatically generates surrogate
key values (in this case,
ProductKey).
The second template is also
important for slowly changing
dimensions, which are discussed
later in this course.
CUSTOMIZE
REFERENCE
STRUCTURES
Static
member
Product
Classes
Product
Families
Dynamic
members
Products
Stock-keeping unit
Class
table
Family
table
Product
table
SKU
table
Instructional Tips
Q: What is the difference between a
literal and a static member?
to populate the hierarchy level using SQL statements that extract data from A: A literal adds a column to a member,
while a static member adds a new
reference tables in the database
the members at the hierarchy level to change as reference data changes
you want the members to be predefined, not derived from SQL statements
the members you require do not exist explicitly in the source data
7-19
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Examine Fostering
Fostering addresses inconsistencies with hierarchies where:
members do not have a parent
an explicit foster parent does not exist at the next highest level
Explicit foster parent (static member)
ALL
Europe
Unknown Continent
(?Continent)
Automatically created foster parents
France
England
John
Smith
Jim
White
Sue
Jones
Unknown Country
(?Country)
Tom
Green
By default, Data Manager provides a foster parent for any member that has a
missing or unknown parent. This is known as fostering.
In a typical hierarchy, each level contains a set of members. At every level except
the highest, each member is related to a member at the next-highest level: the
parent of the member. Each member is also related to members at the
next-lowest level: the children of the member.
A foster parent is an artificially introduced member that acts as a parent for
members that either have no defined parent or whose defined parent cannot be
found at the next highest hierarchy level.
When a member does not have a parent, Data Manager automatically creates a
foster parent and gives it a default name consisting of the name of the level
prefixed with "Unknown." Where the ID is entirely numeric, Data Manager
names this foster member by prefixing a minus sign (-) to the level number.
Instructional Tips
In the slide, there are three levels, Region,
Country, and Employee.
The example shows Tom Green being
fostered.
When Tom Green is added to the
hierarchy, it has no parent level.
It is therefore fostered under the
?UnknownCountry level, which in turn is
fostered under the ?UnknownContinent
level, and finally under the ALL level.
You can rename a foster member,
substituting the default name assigned by
Data Manager with a name of your choice.
You rename foster members by using static
members.
For each level of a hierarchy, you can set
one static member as the foster member.
You can either create a static member that
serves specifically as the foster member, or
use an already existing static member.
7-20
CUSTOMIZE
REFERENCE
STRUCTURES
2.
3.
Instructional Tips
DataStream derivations are processed
before the data is merged. Therefore,
DataStream derivations cannot calculate
values across different data sources.
In the slide example, we created a
derivation called SalesStaffName by
concatenating two columns in the data
source (SalesFirstName and
SalesLastName). We can map this
derivation to a DataStream item, and then
map the DataStream item to the
appropriate level attribute.
7-21
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Each hierarchy and level in a hierarchy can have multiple data sources, which means
that data can be input from more than one connection. This can be useful when
you want to perform data cleansing using different queries.
Unlike a fact build, when data is merged in a hierarchy, you cannot specify how the
merge is performed. When you merge rows in a fact build, you can select the first
non-null value, the maximum value, and so on.
7-22
CUSTOMIZE
REFERENCE
STRUCTURES
Instructional Tips
Although you cannot create a derivation
that uses multiple data sources, you can
resolve this problem by creating a fact build
to retrieve and merge the data to a staging
area, and then use the data from the
staging area to create the hierarchy.
In the slide example, the nProduct data
source has a DataStream item called
ProductionCost, and the nProductMargin
data source has a DataStream item called
Margin. A derivation calculated from these
two items will produce no results.
7-23
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Demo 2
Create a Hierarchy that
Includes a
Derivation
7-24
CUSTOMIZE
REFERENCE
STRUCTURES
Attributes
Id: SalesCountryCode
Caption: SalesCountryName
(for example, France)
Others:
SalesISOThreeLetterCode
SalesISOTwoLetterCode
SalesISOThreeDigitCode
SalesCurrencyName
SalesEuroInUseSince
SalesBranch
Id: SalesBranchCode
Caption: SalesBranchName
(for example, Paris)
Parent: SalesCountryCode
Others:
SalesStaff
SalesManagerCode
SalesAddress1
SalesAddress2
SalesRegion
SalesPostalZone
Id: SalesStaffCode
Caption: SalesStaffName
(for example, Denis Pag)
Parent: SalesBranchCode
Others:
Source Columns
SalesCountryCode (Key)
Country
ISOThreeLetterCode
ISOTwoLetterCode
ISOThreeDigitCode
CurrencyName
EuroInUseSince
SalesBranchCode (Key)
CountryCode (Foreign Key)
ManagerCode
Address1
Address2
City
Region
PostalZone
SalesStaffCode (Key)
SalesBranchCode (Foreign Key)
FirstName (for example,
Denis)
LastName (for example, Pag)
Position
WorkPhone
Extension
Fax
Email
DateHired
Source Tables
GOSCountry
GOSSalesBranch
GOSSalesStaff
Dimension: StaffD
Hierarchy: StaffH
Template: StaffT
7-25
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
5. Click OK.
Task 3. Create the SalesCountry level.
1. In the tree, right-click the StaffH hierarchy, and then click Insert Level.
The Level Properties window opens.
2. In the Name box, type SalesCountry, click the Attributes tab, and then in
the Template list, click StaffT.
3. In the Available attributes pane, double-click the SalesCountryCode and
the SalesCountryName attributes to add them to the Chosen attributes
pane.
4. In the SalesCountryCode row, select the Id check box, and then in the
SalesCountryName row, select the Caption check box.
5. Click OK.
7-26
CUSTOMIZE
REFERENCE
STRUCTURES
Instructional Tips
For step 4, you can copy the code from
the source_code.txt file (in the <install
drive>:\Edcognos\B2480\Source Code
folder) instead of typing it.
The source_code.txt file contains
complex or lengthy fragments of code
that are used in the demos and
workshops throughout the course.
SELECT
"SalesCountryCode",
"Country" AS SalesCountryName,
"ISOThreeLetterCode" AS
SalesISOThreeLetterCode,
"ISOTwoLetterCode" AS SalesISOTwoLetterCode,
"ISOThreeDigitCode" AS SalesISOThreeDigitCode,
"CurrencyName" AS SalesCurrencyName,
"EuroInUseSince" AS SalesEuroInUseSince
FROM
"dbo"."GOSCountry"
5. Click the Result columns tab, ensure that Prepare is selected, and then
click Refresh.
The columns are prepared for use in the SalesCountry level.
6. Click OK.
Task 5. Perform the mapping for the SalesCountry level.
1. In the Visualization pane, right-click DataStream, and then click
Properties.
The DataStream Properties window opens.
2. Click Auto Map.
Each data source column is mapped to a separate DataStream item.
3. Click OK, in the Visualization pane, right-click the SalesCountry level, and
then click Mapping.
The Level Mapping window opens.
4. In the Level Attributes pane, click and drag SalesCountryCode beside the
SalesCountryCode DataStream item, and then click and drag
SalesCountryName beside the SalesCountryName DataStream item.
5. In the DataStream Item column, click and drag
SalesISOThreeLetterCode to the Level Attributes pane.
The Add Attribute dialog box appears.
6. In the Create a new attribute box, type SalesISOThreeLetterCode, and
then click OK.
2008, Cognos ULC (formerly Cognos Incorporated)
Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,
or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).
7-27
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
7. Repeat steps 5 and 6 for the remaining DataStream items, ensuring that
you give each attribute the same name as the DataStream item from which
it is created.
The result appears as shown below:
7-28
CUSTOMIZE
REFERENCE
STRUCTURES
FROM
"SalesBranchCode",
"ManagerCode" AS SalesManagerCode,
"Address1" AS SalesAddress1,
"Address2" AS SalesAddress2,
"City" AS SalesBranchName,
"Region" AS SalesRegion,
"PostalZone" AS SalesPostalZone,
"CountryCode" AS SalesCountryCode
"dbo"."GOSSalesBranch"
5. Click the Result columns tab, ensure that Prepare is selected, and then
click Refresh.
The columns of the data source are prepared for use in the SalesBranch
level.
6. Click OK.
Task 8. Perform the mapping for the SalesBranch level.
1. In the Visualization pane, double-click the DataStream for the SalesBranch
level.
The DataStream Properties window opens.
2. Click Auto Map.
Each data source column is mapped to a separate DataStream item.
3. Click OK, in the Visualization pane, right-click the SalesBranch level, and
then click Mapping.
The Level Mapping window opens.
4. In the Level Attributes pane, click and drag SalesBranchCode beside the
SalesBranchCode DataStream item.
5. In the Level Attributes pane, click and drag SalesBranchName beside the
SalesBranchName DataStream item, and then click and drag
SalesCountryCode beside the SalesCountryCode DataStream item.
7-29
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
9. Click OK, and then save the catalog (click Save my version if prompted).
10. In the Visualization pane, right-click the StaffH hierarchy, and then click
Explore.
The Reference Explorer window opens.
11. Click OK., and then expand France.
France has two child members (Lyon and Paris). Notice that Denmark and
Euroland have no child members.
12. Close Reference Explorer.
Task 9.
7-30
CUSTOMIZE
REFERENCE
STRUCTURES
Task 10. Create the data source for the SalesStaff level and
introduce the attribute names.
1. In the tree, expand the SalesStaff level, right-click the DataStream, and
then click Insert Data Source.
The Data Source Properties window opens.
2. Click the Query tab.
3. In the Database objects pane, expand SourceConnect and dbo, right-click
GOSSalesStaff, and then click Add table select statement.
4. Modify the SQL so that it appears as shown below:
SELECT
FROM
"SalesStaffCode",
"FirstName" AS SalesFirstName,
"LastName" AS SalesLastName,
"Position" AS SalesPosition,
"WorkPhone" AS SalesWorkPhone,
"Extension" AS SalesExtension,
"Fax" AS SalesFax,
"Email" AS SalesEmail,
"DateHired" AS SalesDateHired,
"SalesBranchCode"
"dbo"."GOSSalesStaff"
5. Click the Result columns tab, ensure that Prepare is selected, and then
click Refresh.
The columns of the data source are prepared for use in the SalesBranch
level.
Task 11. Create and test the SalesStaffName derivation.
1. Click the Derivations tab, and then click Add.
The Derivation Properties window opens.
2. In the Name box, type SalesStaffName, and then click the Calculation
tab.
3. Double-click Functions, Text, and Concat, and then delete the text within
the brackets.
4. Double-click Columns and SalesFirstName, and then double-click
Columns and SalesLastName to add the columns to the expression.
5. Modify the expression so that it appears as shown below:
Concat( SalesFirstName,' ',SalesLastName )
6. Click Test.
The Values for Expression window opens.
7-31
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
7. Double-click the top Value box, type Denis, and then press Enter.
8. Double-click the bottom Value box, type Page, and then press Enter.
9. Click Calculate.
The full name is returned, with first and last names separated by a space.
10. Click Close, click OK, and then click OK again.
Task 12. Perform the mapping for the SalesStaff level.
1. In the Visualization pane, to the left of the SalesStaff level, right-click
DataStream, and then click Properties.
The DataStream Properties window opens.
2. Click Auto Map.
Each data source column is mapped to a separate DataStream item.
3. Click OK, in the Visualization pane, right-click the SalesStaff level, and
then click Mapping.
The Level Mapping window opens.
4. In the Level Attributes pane, click and drag SalesBranchCode beside the
SalesBranchCode DataStream item, click and drag SalesStaffCode beside
the SalesStaffCode DataStream item, and then click and drag
SalesStaffName beside the SalesStaffName DataStream item.
5. In the DataStream Item column, click and drag SalesFirstName to the
Level Attributes pane.
The Add Attribute dialog box appears.
6. In the Create a new attribute box, type SalesFirstName, and then click OK.
7. Repeat steps 5 and 6 for the remaining DataStream items, ensuring that you
give each attribute the same name as the DataStream item from which it is
created.
The result appears as shown below:
7-32
CUSTOMIZE
REFERENCE
STRUCTURES
8. Click OK, and then save the catalog (click Save my version if prompted).
9. In the Visualization pane, right-click the StaffH hierarchy, and then click
Explore.
The Reference Explorer window opens.
10. Click OK.
11. Expand France and Paris.
The Paris office has four employees.
Notice that Denmark and Euroland have no child members.
12. Close Reference Explorer.
Results:
You manually created the StaffD dimension and the StaffH
hierarchy. In the process, you added a derivation to the lowest
level of the hierarchy to concatenate the first and last name of
each employee.
7-33
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Summary
In this module, we have:
7-34
examined literals
examined fostering
CUSTOMIZE
REFERENCE
STRUCTURES
Workshop 1
Create Dimension Builds
7-35
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Create a dimension build for the ProductH hierarchy using the Dimension
Build wizard. Call the build D_ProductH, and ensure that you add
surrogate keys and change tracking attributes to the resulting dimension
table.
Create a dimension build for the VendorH hierarchy using the Dimension
Build wizard. Call the build D_VendorH, and ensure that you add surrogate
keys and change tracking attributes to the resulting dimension table.
Create a dimension build for the TimeH hierarchy using the Dimension
Build wizard. Call the build D_TimeH. Ensure that you add surrogate keys,
but DO NOT add change tracking attributes to the resulting dimension
table.
7-36
CUSTOMIZE
REFERENCE
Create a dimension build for the StaffH hierarchy using the Dimension
Build wizard. Call the build D_StaffH, and ensure that you add surrogate
keys and change tracking attributes to the resulting dimension table. Open
the Dimension Table Properties window for the D_StaffH table and
exclude partially populated rows.
STRUCTURES
For more detailed information outlined as tasks, see the Task Table on the next
page.
For the final query results, see the Workshop Results section that follows the Task
Table.
7-37
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
WHERE TO WORK
HINTS
Deliver into
TargetConnect.
Rename skey as
product_skey.
product_skey start
value=1000.
SQLTerm
Deliver into
TargetConnect.
Rename skey as
vendorsite_skey.
vendorsite_skey start
value=1000.
SQLTerm
7-38
CUSTOMIZE
REFERENCE
TASK
WHERE TO WORK
HINTS
Deliver into
TargetConnect.
SQLTerm
Deliver into
TargetConnect.
Rename skey as
salesstaff_skey.
SQLTerm
STRUCTURES
If you need more information to complete a task, see the Step-by-Step instructions
at the end of this workshop.
7-39
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Workshop 1: Results
After construction, the D_ProductH dimension build appears in the Visualization
pane as shown below:
After construction, the D_StaffH dimension build appears in the Visualization pane
as shown below:
7-40
CUSTOMIZE
REFERENCE
STRUCTURES
7-41
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
3. Double-click the Value box beside Start Value for the product_skey
attribute, type 1000, and then press Enter.
The result appears as shown below:
7-42
CUSTOMIZE
REFERENCE
STRUCTURES
7-43
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
4. Double-click the Value box beside Start Value for the vendorsite_skey
attribute, type 1000, and then press Enter.
The result appears as shown below:
7-44
CUSTOMIZE
REFERENCE
STRUCTURES
7-45
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
4. Click OK, and then in the Visualization pane, double-click the D_TimeH
dimension build.
The Dimension Build Properties window opens.
5. Click the Logging tab, select the Detail and ExecutedSQL check boxes
(leave the Progress check box selected), and then click OK.
Task 9. Execute the D_TimeH dimension build and examine
the dimension table in SQLTerm.
1. Save the catalog (click Save my version if prompted), in the tree, click the
D_TimeH dimension build, and then on the toolbar, click Execute.
The build executes and delivers 3,652 rows to the D_TimeH dimension
table.
2. Press Enter, and then open SQLTerm.
3. In the Database box, click TargetConnect, and then in the Database
objects pane, expand TargetConnect and dbo.
4. Right-click D_TimeH, and then click Add table select statement.
7-46
CUSTOMIZE
REFERENCE
STRUCTURES
7-47
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
5. Click OK, and then in the Visualization pane, double-click the D_StaffH
dimension build.
The Dimension Build Properties window opens.
6. Click the Logging tab, select the Detail and ExecutedSQL check boxes
(leave the Progress check box selected), and then click OK.
7-48
CUSTOMIZE
REFERENCE
STRUCTURES
7-49
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Workshop 2
Create Data Integrity Lookups
7-50
CUSTOMIZE
REFERENCE
STRUCTURES
Create the D_DayL lookup. Specify the D_TimeH template and include
day_skey as the surrogate and DayId as the Id. Examine the lookup using
Reference Explorer.
For more detailed information outlined as tasks, see the Task Table on the next
page.
For the final query results, see the Workshop Results section that follows the Task
Table.
7-51
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
WHERE TO WORK
HINTS
Surrogate: product_skey.
Reference Explorer
Id: ProductNumber.
Surrogate: vendorsite_skey.
Reference Explorer
Id: VendorSiteCode.
Surrogate: day_skey.
Reference Explorer
Id: DayId.
Surrogate: salesstaff_skey.
Reference Explorer
Id: SalesStaffCode.
2. Create the
D_VendorSiteL lookup.
3. Create the D_DayL
lookup.
4. Create the D_SalesStaffL
lookup.
If you need more information to complete a task, see the Step-by-Step instructions
at the end of this workshop.
7-52
CUSTOMIZE
REFERENCE
STRUCTURES
Workshop 2: Results
When viewed in Reference Explorer, the D_ProductL lookup appears as shown
below:
When viewed in Reference Explorer, the D_DayL lookup appears as shown below:
7-53
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
7-54
CUSTOMIZE
REFERENCE
STRUCTURES
7-55
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
7-56
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
8-2
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Objectives
In this module, we will:
8-3
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Because the data warehouse is expected to hold data for several years, it must
contain the most current dimension data, in addition to all the changes it has
undergone over time, in response to the changing structure of the business. Slowly
changing dimensions let you track these historical changes in the data warehouse.
Instructional Tips
It is unnecessary - and probably
counterproductive - to track a sales
representatives past personal
history in an OLTP system.
For example, a sales
representatives old office is
irrelevant when recording that reps
most recent order. Keeping the old
office in the OLTP system will just
take up unnecessary space and
reduce transaction-processing time.
However, because the data
warehouse is expected to hold data
for several years, it may be important
to know all the sales offices in which
a sales representative has worked
(and when).
Users of the data warehouse may
need to query data as of any
particular date. For example, at
which office(s) did Mary Smith work
between January, 2005 and
December 2005? If Mary Smith
changes offices, to which office do
her sales apply - the old one or the
new one?
Situations where a dimension is
completely changed over a short
period of time are rare. Drastic
changes are usually caused by
design modifications or, less often,
by a complete reorganization of the
relationships among members in the
dimension.
Deleting data from a data warehouse
is a rare occurrence, but it can
happen. For example, a company
must disband a department and must
remove all references to that
department.
8-4
PROCESS
DIMENSIONAL
HISTORY
AND
Surrogate keys have existed for years in OLTP systems to uniquely identify things
like employees, invoices, and so forth. These operational surrogate keys are also
known as "business keys."
Although surrogate keys can be passed from an OLTP system into a data
warehouse, usually a new surrogate key is assigned within the data warehouse.
There are a number of reasons for assigning a data warehouse-only surrogate key:
LATE
ARRIVING
FACTS
Instructional Tips
Emphasize that manually creating and
maintaining surrogate keys in a data
warehouse can be an onerous task. By
using templates, Data Manager automates
the generation and management of
surrogates.
A business key in an OLTP system is
often mnemonic. For example, "OTA" may
be used to uniquely identify the Ottawa
office.
Example of first bullet: a single "customer"
in a "banking" data warehouse may exist
as a checking account, a savings account,
and an insurance policy in three
underlying OLTP systems. Instead of
using three account numbers to identify
the customer, a new surrogate key may be
assigned, and the three account numbers
may become alternate business keys.
Example of second bullet: where an OLTP
database may have millions of rows, a
data warehouse may have billions or even
trillions of rows in a single fact table. A
business key from an OLTP system may
be many bytes long. If business keys are
used to join the tables, the table sizes can
be unnecessarily large. The small size of
data warehouse-assigned surrogate keys
can often save large amounts of space.
Surrogate keys are never used in reports.
often, entities will be merged from several OLTP systems to form a single They are used to link dimension tables to
fact tables in a data warehouse.
data mart entity
you may want to track changes to the data warehouse (not the OLTP
system(s)) over time
8-5
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Customer Dimension
Prod Code
Name
Cust Code
Name
PR X 002 39
Soup
SA 1 11
Store X
PR X 003 40
Beans
LO 2 22
Store Y
PR Y 003 40
Peas
SE 5 55
Store Z
Instructional Tips
The slide example illustrates using
business keys to join dimension
tables to a fact table. A fact table can
be joined to many dimensions. Using
business keys in the fact table can
take up large amounts of physical
space, both in terms of table
structure and indexes. This is one of
several reasons to avoid using
business keys to join dimension and
fact tables.
Fact Table
8-6
Prod Code
Cust Code
PR X 002 39
SA 1 11
PR X 003 40
LO 2 22
PR Y 003 40
SE 5 55
Measures
PROCESS
DIMENSIONAL
HISTORY
Customer Dimension
Prod Sur
Prod Code
Name
Cust Sur
Cust Code
Name
PR X 002 39
Soup
10
SA 1 11
Store X
PR X 003 40
Beans
20
LO 2 22
Store Y
PR Y 003 40
Peas
30
SE 5 55
Store Z
Fact Table
Prod Sur
Cust Sur
10
20
30
Measures
AND
LATE
ARRIVING
FACTS
Instructional Tips
The slide example illustrates using
two surrogate keys, Prod Sur (in the
Product dimension table) and Cust
Sur (in the Customer dimension
table). The business key is still
available to users in the dimension
table, but joins are implemented
through these surrogate keys.
Although the surrogate keys are not
used in reports, including them in the
fact table instead of business keys
saves space. For example, in the
previous slide, each measure is
identified by a unique combination of
a product code and a customer code.
By contrast, in the slide example on
this page, each row of fact data is
uniquely identified by a combination
of two surrogate keys (Prod Sur and
Cust Sur). If there are several million
rows of data in the fact table, using
surrogates makes implementing the
joins to dimension tables more
efficient.
8-7
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
You specify surrogate keys at more than
one level by adding one or more
attribute(s) to a template and specifying
their behavior as Surrogate Key. Then set
the value for the associated business key
to the appropriate level.
As shown in the slide example, you can
also set the starting value (in this case, 1)
for the surrogate key.
If you use the Hierarchy wizard, the
resulting template will contain a surrogate
key with a default name of skey, which
you can change.
Technical Information
If you use the Fact Build wizard to deliver
dimension tables (which is only
recommended if you are building a selfcontained, "private" data mart with no
conformed dimensions), the dimension
tables will not include surrogate keys.
The Fact Build wizard assumes that all
dimension elements must use surrogates
when they are available. If you add a
dimension element to an existing fact
build, you must select the Use
surrogates when available check box in
the Properties dialog box for the
dimension element.
To use surrogates when they are
available, the hierarchy or lookup that is
associated to the dimension element must
use a template for data access.
If the Use surrogates when available
box is deselected, Data Manager will use
business keys to link the fact tables to
dimension tables.
8-8
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Instructional Tips
The slide example outlines how this
process works:
Surrogate Key Substitution in a Fact Table
1. Each row from the source system has
a ProductNumber column that holds
Fact Table
Dimension Table
natural key values (such as PR X 002
Rows With
with Surrogates
for Beans).
Surrogate Keys
ProductNumber
2.
Each value in the ProductNumber
ProductKey
ProductKey
column is mapped to a separate value
in the ProductKey column. The values
in the ProductKey column are
contained in the Product dimension
3.
table.
2.
3. Each fact row uses the ProductKey
column as part of its primary key,
4.
instead of the natural key. The values
Fact Table
in the ProductKey column are linked
1.
Rows With
to the corresponding values in the
Replace
Product IDs
Load fact table
ProductNumber
same column of the Product
ProductNumber
rows into
with surrogate
dimension table.
DBMS
ProductKey
4. Each row of fact data is loaded into
the target data mart. The original key
(ProductNumber) is no longer used to
join the fact table to the Product
dimension table. The more efficient
Once you have added surrogate keys to a dimension table, you can assign the keys
surrogate key (ProductKey) is used
to fact table rows that reference the dimension table. This process links each row of
instead.
the fact table to the correct row in the corresponding dimension table.
8-9
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Demo 1
Manually Add a
Surrogate Key to a
Dimension Table
8-10
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
10.
Instructional Tips
If necessary, refer to the setup
instructions to ensure that the
connections refer to the correct data
sources.
Stress to the students that, in the
majority of cases, using the Dimension
Build wizard is the most effective way to
create a dimension build. We are
constructing it manually in this demo to
show what the wizard does
automatically.
8-11
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
8-12
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
8-13
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
8-14
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Notice that each value of VendorSiteCode (the primary key for the table) is
associated with a separate surrogate key. For example, VendorSiteCode 4 is
associated with a value of 4 in the Surrogate column.
6. Close SQLTerm.
Results:
You manually created a dimension build that is based on the
VendorCustomerH hierarchy. You then executed the dimension
build to deliver the data to a single conformed dimension table.
This dimension table includes a surrogate key.
8-15
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Normal
Type2
Type2
Normal
Type2
Emp. No
Name
Branch
Position
Hire
Date
Salary
10001
Jack
OTA
VP
Jan1998
100K
10002
Jane
ARL
MK
Jan2002
80K
10003
Tom
NY
SS
Jan2003
60K
10001
Jack
SJ
VP
Jan1998
100K
SJ
S-VP
Jan1998
100K
SJ
S-VP Jan1998
130K
Surrogate
**
10001
Jack
***
10001
Jack
(Emp. No + Branch)
SCDs are used to manage historical data. They are dimensions where non-key
attributes can change over time without corresponding changes in the business key.
For example, employees may change their department without changing their
employee number, or the specification for a product may change without the
product code changing.
SCDs require that the data warehouse developer has a way of tracking the data
warehouse members and their status without making the issue unnecessarily
complex. The solution is to replace these cumbersome keys with efficient surrogate
keys.
The maintenance of SCDs and surrogate keys is automated in Data Manager.
Instructional Tips
In the slide example, the original row
changes when Jack changes location.
To keep track of the change, a new row
is added. The new row would have the
same Employee Number, which means
that the key is no longer unique. To
make it unique, the key must be the
combination of Employee Number and
Branch.
For the next change, Jack is promoted.
Again, a new row is added, and again,
the key is no longer unique. To make it
unique, the key must be the
combination of Employee Number,
Branch, and Position.
These steps continue for every change
to Jack's status within the company. As
you can see, the unique key eventually
becomes quite long. This problem is
repeated for each dimension that is
referenced by the fact table.
8-16
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Type 1 - Overwrite the old value with the new value (do not
track the changes).
Ralph Kimball maintained that there are three typical ways to handle changing
dimension data; he called them Type 1, Type 2, and Type 3. The industry has
adopted these terms.
The choice of method largely depends on the businesss need to track changes. By
far, the most commonly accepted methods are:
Technical Information
As noted in Ralph Kimball and Richard
Merz's The Data Webhouse Toolkit (Wiley,
2000), "Type 3 SCD occurs when an
alternate, simultaneous description of
something is available. In this case an
extra 'old value' field is added in the
affected dimension."
Data Manager does not automatically
support Type 3 surrogate keys.
A single row may consist of attributes in any combination of the three types. Often,
if a single column is Type 2, the entire dimension is referred to as a Type 2 slowly
changing dimension (SCD).
To track Type 2 SCDs, you must use surrogate keys. Creating and maintaining
surrogates is discussed later in the module.
8-17
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
As with Type 1 and Type 2 changes, you specify Type 0 changes in the Dimension
Table Properties dialog box.
8-18
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Surr_key
Prod_Code
Prod_Type
Prod_Desc
Eff_Date
End_Date
Curr Ind
P1
002
Blue pen
2007/02/10
2008/12/15
P2
001
Green pen
2007/03/15
P1
001
Blue pen
2008/12/15
A single dimension build is used to load the following source data into the dimension table.
Prod_Code
Prod_Type
Prod_Desc
Date
P1
001
Orange pen
2008/12/22
A type 0 change is applied to the Prod_Desc attribute for record 3, by overwriting the previous value with the
value Orange pen.
Surr_key
Prod_Code
Prod_Type
Prod_Desc
Eff_Date
End_Date
Curr Ind
2008/12/15
P1
002
Blue pen
2007/02/10
P2
001
Green pen
2007/03/15
P1
001
Orange pen
2008/12/15
8-19
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Rep Name
Phone
Office
Key
number
00128 Mary Smith 613-5423 Dallas
Sales Fact Table
Rep
Order Date
Key
00128
1/1/2008
00128
2/1/2008
Cust
Key
12345
12345
Rep
Name
Phone
Office
Key
Number
00128 Mary Smith 613-4444 Dallas
In a Type 1 SCD, the data fields are overwritten with the new values. If the only
changes in data are to Type 1 fields, the existing row can be updated in place. No
new rows are inserted into the dimension table.
It is important to understand that Type 1 changes cannot be tracked over time.
Once the change is made, the prior information is lost. Kimball estimates that
approximately half of all attributes are Type 1.
Type 1 SCD is the default for Data Manager.
Instructional Tips
The original data could be incorrect. In the
slide example, the type of change is just a
correction. There is rarely a legitimate
business need to track data that was
originally recorded incorrectly. For this
reason, any data field could, in theory, be
eligible for a Type 1 change.
The most common reason for a Type 1
change, however, is lack of relevancy.
Although the original data was correct, there
is no business reason to track the change.
In the slide example, the Mary Smith has
changed her telephone number. Since her
previous telephone number is no longer
relevant in the Sales Rep dimension table,
the previous value in the Phone Number
column is overwritten with the most current
value.
8-20
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Cust
Key
12345
12345
12345
12345
RepSur Rep
Key
Key
Name
Office
Office Eff
Eff
Date
Date
Usually, when a Type 2 change is detected, you must find the existing, current row
for the entity and update it as "no longer current." This existing row will include a
value for the Effective End Date attribute. The new row will then have a value for
the Effective Begin Date and a null value for the Effective End Date.
If no attributes are checked as Type 2, the entire dimension is treated as a Type 1
SCD.
Instructional Tips
In the slide example, the advantage of
using Type 2 functionality is that the user
can report all combinations of sales. In the
slide example, all of Marys sales can be
found by constraining (filtering) on Mary's
Sales Rep Key (00128). All Dallas sales
(including Marys while she was there) can
be found by filtering on the business key
for the Dallas office.
If it is possible for Mary Smith to report to
both Dallas and New York at the same
time, then the information should be
modeled as two dimensions.
8-21
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Data Manager automatically generates and manages surrogates and determines the Instructional Tip
next surrogate value to be used. Managing these surrogates and SCDs takes place Even with Type 1 SCDs, it is a good idea
to have a column that indicates the date
in the properties of the related template and dimension table.
Data Manager determines what rows need to be inserted or updated based on
Type 1 SCDs by:
8-22
inserting a new copy of the existing member with the new changes
and generating a new surrogate key, thereby preserving the prior
version
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Attributes marked as business keys are from the original operational system. If you
have several levels in your hierarchy, you may have several business keys. These
business keys are IDs from the related hierarchy levels.
You can mark only one of these business keys as the primary key of the dimension
table (Value = True).
A business key with a primary key value of True cannot be a Type 2 attribute. Data
Manager uses this business key to locate existing members in the dimension. If you
change this key, you have effectively created a new dimension member.
Each surrogate key is related to a particular business key (usually the primary key of
the table). This means that each separate business key value will have a separate
surrogate key value.
Instructional Tips
In the slide example, the D_ProductH
template has three business keys, each of
which is the ID of the associated hierarchy
level: Product, ProductType, and
ProductLine.
The lowest level is Product, and the
business key for this level is
ProductNumber. As a result,
ProductNumber is designated as the
primary key.
ProductNumber is a business key that has
values such as 648, 4732, and 1190. This
business key is related to the "key"
attribute (which has a behavior of
Surrogate). Each value of ProductNumber
will have a corresponding value for key
(for example, 1, 2, and 3). As indicated on
the right side of the slide example, we
cannot track changes to the
ProductNumber column in the dimension
table, since it is the primary key.
8-23
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Demo 2
Apply SCDs to a
Dimension Build
8-24
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Instructional Tips
We are adding a connection to a new data
source in order to simulate updates from
the source system. This data source will
allow us to show how Data Manager deals
with slowly changing dimensions.
8-25
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
The columns of the modified data source (listed on the left side) may be in
a different order than the one shown. However, each column must be
mapped to the appropriate DataStream item, as indicated by the screen
capture.
11. Click OK to close the DataStream Properties window.
8-26
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
You have specified that you want to track changes to the values in two of
the columns in the D_StaffH dimension table. Therefore, whenever an
incoming row of source data with an existing SalesStaffCode has a different
value in either of these columns, a new row of data will be inserted into the
dimension table.
8-27
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
8-28
Instructional Tips
Alternatively, you could allow null
values by performing the following
steps:
1. Right-click the D_StaffH table,
and then click Show DDL.
2. On the Create Table tab, modify
the DDL for the SalesFirstName,
SalesLastName, and
SalesDateHired columns (for
example, change "SalesFirstName"
NVARCHAR(25) NOT NULL to
"SalesFirstName" NVARCHAR(25)
NULL).
3. Once the DDL has been modified
as necessary, copy it to the
clipboard.
4. Open SQLTerm, paste the
modified DDL statement, and then
execute the statement against the
TargetConnect database (click the
Execute statement(s) button, not
the Return all rows button).
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Notice that the changes were only applied to the SalesStaff level, because
that is where we added the new data source.
6. Press Enter to close the command window, and then open SQLTerm.
7. In the Database list, click TargetConnect.
8. In the Database objects pane, expand TargetConnect and dbo, right-click
D_StaffH, and then click Add table select statement.
A SELECT statement appears in the Query pane.
9. Click Return all rows.
107 rows are returned.
This data set includes five new rows to reflect the changed values of the
Type 2 attributes that we set previously.
You can see new values for the SalesBranchCode column, as well as blank
values for the SalesDateHired column. The hire dates for each of these
employees are in their previous rows and will not change in the future.
8-29
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
10. Click the arrow at the lower right corner of SQLTerm to scroll the entire
data set to the right side of the screen.
By scrolling vertically in the pane, you can see that five rows have todays
date as a value in the end_date column. This indicates that these rows of
data are no longer current.
Other rows have new values in the udt_date column, which indicate when
each row was last updated. They also have values in the curr_ind column,
which indicate whether each row is the most current. The result appears as
shown below:
8-30
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Type 1
Type 2
Surrogate
Key
A dimension that contains Type 1 and Type 2 attributes changes all the rows with
the same business key when you perform a Type 1 update. Data Manager assumes
that when you have a Type 1 attribute, you want to maintain consistency in all the
rows.
Instructional Tips
In the slide example, ProductName
changed from Tea to Chai Tea, so Data
Manager updates all occurrences of Tea
to Chai Tea.
The previous value of the Type 1 attribute is updated, as well as the values in all the
previous versions of the row.
To update the Type 1 change, Data Manager must locate all the affected rows. To
speed up this process, correct indexing must be used. For star schemas, you should
index the business key at each level. This is important when a Type 1 attribute is
updated at a higher level, since the number of rows updated is increased.
8-31
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
You can use the build log to see what happens when you execute a build containing Instructional Tips
In the slide example, there is one Type 1
updates.
To make the updating more efficient, it is recommended that you index your
business key.
8-32
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Data Manager can load the history into a dimension table in the data warehouse.
This is useful if:
you want to load the fact rows and take advantage of late arriving facts
functionality
Instructional Tips
Late arriving facts are discussed later in
this course.
Using effective date attributes solves problems that may occur when loading
historical data in the warehouse. Initial loads are usually required if you want to load
data for a number of years.
8-33
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Reference Template
Technical Information
In the Dimension Table Properties window,
you assign a column from the hierarchy data
as the effective start date attribute.
When you execute the dimension build, the effective start date is initialized from
the source data, and the effective end date is generated automatically.
8-34
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Product Code
P1
P1
P1
Surrogate Key
1
2
3
Specification
Blue pen
Black pen
Red pen
By default, Data Manager assumes that changes to dimension data that are fed into Instructional Tips
In the slide example, changes to the
the data mart arrive in chronological order.
When Data Manager encounters a change in a Type 2 attribute such as
Specification, it normally only checks the current dimension row for that member
when it updates the dimension table.
8-35
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Product Code
P1
P1
P1
Surrogate Key
1
2
3
Specification
Blue pen
Black pen
Red pen
Technical Information
For the Dimension History Options tab to
be enabled, the following conditions
must be met:
there must be a column in the
source data that supplies the
effective date (for example,
Effective_Begin_Date in a Product
table)
this column must be referenced by
an attribute in a template, and this
attribute must be assigned a
behavior of Effective Start Date
in the target dimension table,
ensure that you have a column that
is mapped to this attribute that has
Effective Start Date behavior; we
do not want Data Manager to
automatically generate the effective
start date in the template, we want
to derive it from the source data
Late arriving dimension details are a
procedural problem that is not handled
automatically by Data Manager. If you
have Data Manager write the information
to a .rej file, you will have to manually
process the dimension details back into
the system.
To save the late arriving dimension details to a reject file, specify the name and
location of the file on the Dimension History Options tab of the Dimension Table Late arriving dimension details present
the following problems:
Properties window. If you do not specify a reject file, the late arriving dimension
Further work is required to insert
details are lost.
Instructional Tips
What if the change from a black pen to a red pen had not taken place on Feb. 10, 2008, but on
Feb. 10, 2005, several months before the effective date of the most current row of data? This type
of change is an example of a late arriving dimension detail.
The data at the bottom of the slide example includes two changes to the specification of product
P1. Both of these changes occurred prior to the effective date of the current row in the dimension
table for product P1. The product was an orange pen on May 14, 2004, and a mauve pen on April
27, 2007. But on Feb. 10, 2008 (the date of the most current row for P1), it was a red pen. We can
choose to either accept (i.e., write to a file or a table) or reject (i.e., discard entirely) these late
arriving dimension details.
8-36
PROCESS
DIMENSIONAL
HISTORY
If you use the template to set the effective date for the initial rows of distinct
dimension members, you can further specify how this date is set.
Your situation
Option
Variable
Null
AND
LATE
ARRIVING
FACTS
Instructional Tips
You set the effective start date on the
Dimension History Options tab of the
Dimension Table Properties window.
In the slide example, there are two
dimension members. Product P1 is a blue
pen and product P2 is white paper. These
are the first rows that represent each of
these products. Because of this, there is
no value in the End Date column: no new
rows have arrived that render any old
rows out of date.
You can specify that the effective start
date must be the date specified for each
dimension member in the data. Or you
can have the template set the effective
date automatically.
In the slide example, we have overridden
the template settings. We have instead
used the date specified in the dimension
data for individual dimension members as
the effective start date for initial rows.
As a result, the data for both products
became effective at different times.
Product P1 was identified as a blue pen
on Nov. 1, 2003, while P2 was identified
as white paper on Nov. 1, 2006.
Technical Information
If you choose to use a variable, the
variable must be defined on the Variables
tab of the Dimension Build Properties
window.
8-37
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Specification
Effective Date
End Date
P1
P1
Blue pen
Red pen
2007-11-01 24:00:00
2008-11-10 24:00:00
2008-11-09 23:59:59
1
2
A dimension table must reference a template. The template lists attributes that
represent the columns in the table, as well as the behavior of these columns. For
example, only one attribute in the template can represent a primary key column in
the dimension table.
Technical Information
In the Effective End Date in current records
box, indicate how Data Manager should set
the effective end date when the template
detects a change in the incoming
dimension data. You can either use a null
If you use a template to set the effective start date for the initial row of a dimension value (the default), a variable, or an explicit
member, you can control how Data Manager sets these start dates, as well as the
date and time.
effective end dates. In the Effective Date granularity box, specify the format to use
for both the effective start date and the effective end date columns. You can use
either the date and time (the default) or just the date. The option you choose
depends on your reporting requirements.
If you use a timestamp that includes both the date and time, you have more
flexibility when you create reports. For example, you can specify a BETWEEN
clause to retrieve only rows that have been modified during a particular time period
The option in the Set previous record
in one day.
8-38
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Demo 3
Load Dimensional
History
8-39
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
8-40
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
4. In the Name box, type Category, click the Attributes tab, and then click
New.
The Template Properties window opens.
5. In the Name box, type ProductHistoryT, and then click the Attributes
tab.
6. Click Add, and then type CategoryID.
7. Click Add, type CategoryName, and then click OK.
We return to the Level Properties window.
Task 3. Add attributes to the Category level, insert a data
source, and perform mapping.
1. Click Add all attributes
attributes pane.
2. In the CategoryID row, select the Id check box, and then in the
CategoryName row, select the Caption check box.
3. Click OK to close the Level Properties window.
4. In the tree, expand the Category level, right-click DataStream, and then
click Insert Data Source.
The Data Source Properties window opens.
5. Click the Query tab, and then in the Database list, click DM_Additional.
6. In the Query pane, type the following code:
SELECT
FROM
CategoryID,
CategoryName
Categories
7. Click the Result columns tab, ensure that Prepare is selected, and then
click Refresh to prepare the columns for use by the level.
8. Click OK to close the Data Source Properties window.
9. In the Visualization pane, right-click DataStream, and then click
Properties.
The DataStream Properties window opens.
10. Click Auto Map, and then click OK.
11. In the Visualization pane, right-click Category, and then click Mapping.
The Level Mapping window opens.
8-41
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
12. Drag and drop the level attributes from the right pane so that the result
appears as shown below:
8-42
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
8. In the Behavior list for ProductID, click Business Key, and then in the
Value list, click True.
The result appears as shown below:
8-43
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
FROM
WHERE
a.ProductID,
b.ProductName,
a.UnitPrice,
a.Effective_Begin_Date,
a.CategoryID
Product_Unit_Price a, Products b
a.ProductID = b.ProductID
8. Click the Result columns tab, ensure Prepare is selected, and then click
Refresh.
9. Click OK to close the Data Source Properties window.
Task 7. Perform mapping for the Product level, and then
explore the ProductHistoryH hierarchy.
1. In the Visualization pane, right-click the bottom DataStream (to the left of
the Product level), and then click Properties.
The DataStream Properties window opens.
2. Click Auto Map, and then click OK to close the DataStream Properties
window.
3. In the Visualization pane, right-click the Product level, and then click
Mapping.
4. Drag and drop the level attributes from the right pane so that the result
appears as shown below:
5. Click OK to close the Level Mapping window, and then save the catalog
(click Save my version if prompted).
6. In the Visualization pane, right-click the ProductHistoryH hierarchy, and
then click Explore.
The Reference Explorer window opens.
7. Click OK, and then click OK again to dismiss the warning message
regarding non-unique IDs.
8-44
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
8-45
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
8-46
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
8-47
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
8. Close SQLTerm.
Results:
You added a connection to a new database. You then created a
hierarchy that shows the entire history of the product data in
this database, including changes to product names and prices.
Finally, you constructed and executed a dimension build to
deliver this product history to a dimension table and viewed the
results in SQLTerm.
8-48
PROCESS
DIMENSIONAL
HISTORY
AND
RepSurKey
11111
11111
11112
11112
11111
11112
OrderDate
01/01/2002
01/01/2008
02/01/2008
02/01/2002
03/01/2008
03/01/2002
04/01/2008
04/01/2002
02/12/2002
02/12/2008
02/12/2002
CustKey
12345
12345
12345
12345
12345
12345
LATE
ARRIVING
FACTS
Instructional Tips
In the slide example, the Sales Rep
dimension table contains two instances
of business key 00128, with a unique
surrogate key for each instance.
The sales fact row dated February 12,
2008 is processed after April 1, 2008. By
default, if we do not enable the late
arriving fact processing option, the value
of the surrogate key will be 11112, which
is the current row.
However, if we do enable the late
arriving fact processing option, the value
of the surrogate key will be 11111.
Technical Information
There are three types of late arriving
facts:
you perform an initial load which includes historical fact data
1. Initial load late facts - when you
create a data warehouse, the initial
load may include historical
fact data is processed after the transaction date to which it relates
dimension data. Where dimension
history is loaded, fact history should
multiple changes occur in the reference data between each fact data load
also be loaded.
2. True late facts - a data load may
An example when late arriving facts are likely to occur is credit card transactions.
include transactions that are being
processed after the transaction
These transactions (for example, the payment of a bill) may occur after the close of
date to which they relate. This may
a month. Each credit card transaction must be correctly associated with the rows in
occur when a process has failed to
the related dimension tables (for example, those tables containing date and
transfer data or a transaction is
customer data).
entered after the fact.
3. Loading late facts - late facts can
result from multiple Type 2 changes
occurring in a dimension between
each fact data load. Without late
arriving fact processing,
outstanding facts default to using
the current dimension member,
which may not be correct.
8-49
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
the fact build must not include any dimension deliveries for the
dimension
8-50
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Demo 4
Create a Lookup and a Fact Build to
Process Late Arriving Facts
8-51
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
First, we will create a lookup in the
Product dimension that retrieves the
rows from the D_ProductHistoryH table.
This lookup will use the business key,
ProductID, as the ID attribute. This
lookup must also retrieve the Effective
Start Date and the surrogate key and
use template data access.
We will then create and execute a fact
build with surrogate key substitution
and late arrival fact processing enabled
for the ProductID dimension element.
The transaction date element will be
OrderDate. On execution, the fact build
will substitute the business key of each
fact row with the appropriate surrogate
key, using the ProductID and
OrderDate elements to search for the
matching ProductID and Effective Start
Date in the lookup.
By completing this demo, we will have
both dimension and fact tables that will
enable us to analyze product sales in
the context of dimensional changes
over time. We can perform this analysis
in SQLTerm by joining the fact and
dimension tables using the surrogate
key and selecting the appropriate
columns from both tables.
8-52
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
6. In the Select the connection from which the data source is to read list, click
DM_Additional, and then click Next.
7. In the right pane, type the following SQL code:
SELECT
FROM
WHERE
b.OrderID,
b.CustomerID,
b.EmployeeID,
b.OrderDate,
a.ProductID,
a.UnitPrice,
a.Discount,
a.Quantity
Orders b, "Order Details" a
a.OrderID = b.OrderID
8-53
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
8-54
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
8-55
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
You can see the changes to the value of each product's unit price, as well as
each product's assignment to a category.
9. Close SQLTerm, and then close Data Manager.
Results:
By executing only one fact build, you delivered all of the product
sales fact data into the data warehouse. Each fact table row now
references its related row from the dimension table.
8-56
PROCESS
DIMENSIONAL
HISTORY
AND
LATE
ARRIVING
FACTS
Summary
In this module, we have:
8-57
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
8-58
IBM Cognos 8 BI
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
9-2
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
Objectives
In this module, we will:
9-3
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
9-4
2.
3.
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
9-5
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
9-6
Instructional Tips
In Demo 1, we will create a translation
lookup that will convert values from one
currency into another currency.
Mark a transformation model element
(such as a dimension) as Never Output
if you do not want to output it to the fact
table.
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
Demo 1
Convert Currency Data
Using a
Translation Lookup
9-7
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
9-8
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
a.OrderCode,
ProductNumber,
Quantity,
UnitPrice,
OrderDate,
CountryCode
FROM
GOSOrderDetail a, GOSOrderHeader b,
GOVVendorSite c
WHERE
a.OrderCode = b.OrderCode
AND
c.VendorSiteCode = b.VendorSiteCodeGO
11. Click Finish, in the Transformation Model column, right-click
ProductNumber, and then click Rename.
12. Type product_skey, and then press Enter.
13. In the Transformation Model column, right-click OrderDate, and then
click Rename.
14. Type day_skey, and then press Enter.
Task 2. Finish creating the TranslationLookup fact build.
1. Click Next, and then click OrderCode.
2. Click Change Type, click To Attribute, and then click Next.
3. Click the Use reference box beside product_skey, and then click the
ellipsis.
4. Double-click ProductD, and then click D_ProductL.
5. Repeat steps 3 and 4 to associate the day_skey dimension element to the
D_DayL lookup (in the TimeD dimension).
6. Click Next four times, and then clear the Deliver Dimensions check box.
7. Click Next, and then click Finish.
The TranslationLookup fact build is added to the tree.
Instructional Tips
Task 3. Create the CurrencyD dimension and the CurrencyL You may want to create the CurrencyL
lookup BEFORE creating the
lookup based on a new template.
TranslationLookup fact build. You
could then associate the CountryCode
1. In the tree, under the Library folder, right-click Dimensions, and then click dimension element to the CurrencyL
Insert Reference Dimension.
lookup in the Fact Build wizard, at the
same time as you associate the
The Dimension Properties dialog box appears.
product_skey and day_skey elements
to their respective lookups.
2. In the Name box, type CurrencyD, and then click OK.
9-9
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
FROM
WHERE
"CountryCode",
"ConversionYear",
"ConversionMonth",
"ConversionToLocal",
"Country"
"dbo"."GOSConversionRate", "GOSCountry"
"CountryCode" = "SalesCountryCode"
9-10
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
3. Click OK, in the Visualization pane, right-click the CurrencyL lookup, and
then click Mapping.
The Level Mapping window opens.
4. Drag the attributes from the Level Attributes pane to the Maps To pane so
that the mapping appears as shown below:
9-11
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
6. In the Visualization pane, right-click the CurrencyL lookup, and then click
Explore.
The Reference Explorer window opens.
7. Click OK
The 504 members contained in the lookup are shown.
8. Close Reference Explorer.
Task 7. Associate the CountryCode dimension element in
the TranslationLookup build to the CurrencyL
lookup.
1. In the tree, click the TranslationLookup build, in the Visualization pane,
right-click CountryCode, and then click Properties.
The Dimension Properties window opens.
2. Select the Never Output check box.
This step excludes the dimension element from delivery.
3. Click the Reference tab, in the Dimension list, click CurrencyD, and then
in the Structure list, click CurrencyL (L).
Notice that no levels appear in the Level column.
We want all transaction rows to be delivered to the table, even those rows
that do not match the existing reference data. Therefore, we must accept
unmatched member identifiers.
4. Click the Unmatched Members tab, and then select the Accept
unmatched member identifiers check box.
This option prevents any incoming rows from being rejected.
5. Click OK.
6. In the tree, expand TranslationLookup and Transformation Model,
right-click CountryCode, and then click Move Up.
7. Repeat step 6 until the result appears as shown below:
9-12
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
9-13
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
3. In the Data Source column, click the CountryCode column (not the data
source derivation), and then click Clear.
The result appears as shown below:
9-14
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
9-15
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
The rows with a value of zero in the RevenueLocal column do not refer
to an existing conversion rate in the CurrencyL lookup. Therefore,
converted revenue values could not be supplied for these rows and zeros
were used instead. Values other than zero represent revenues converted
into the appropriate local currency.
10. Close SQLTerm.
Results:
You converted revenue data into local currencies through the
use of a translation lookup. You delivered all the incoming rows
to the fact table, even those that did not have the conversion
rate specified. The rows without a conversion rate have zero
values in the converted revenues column.
9-16
Instructional Tips
You may also want to include the
original value of revenue in the table to
compare it to the converted value in the
RevenueLocal column. You can add
this column by creating a transformation
model derivation that has a formula of
Quantity * UnitPrice.
Notice that the ProductNumber and
OrderDate columns reference surrogate
key values from the appropriate
lookups.
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
Instructional Tips
As shown in the slide, the fact table
has the "found" column that stores Y
for matching state codes and N for
non-matching codes (in this case,
"NX", which is not a valid state code.
Technical Information
To find matched and unmatched
data, we must accept unmatched
member identifiers (see Demo 2). To
accept unmatched member
identifiers, you must use a template
to access the source data, not a
DataStream. This is because a
template automatically creates the
correct INSERT and SELECT
statements required to accept the
unmatched member identifiers.
9-17
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Demo 2
Flag Invalid Data Using
an Optional
Lookup
9-18
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
Instructional Tips
In this demo, we will create an
optional lookup to detect and flag
unmatched state codes. We will then
create a fact build that references
the optional lookup. This fact build
will include a derivation that flags
each incoming fact row as having a
valid or invalid state code.
9-19
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
"state_cd",
"state_name"
dbo."dm_location"
5. Click the Result columns tab, ensure that Prepare is selected, and then
click Refresh to prepare the columns for use in the lookup.
6. Click the Literals tab.
7. Double-click the top row, type Y, and then click OK.
Task 3. Perform the necessary mapping for the optional
lookup, and then explore the lookup.
1. In the Visualization pane, right-click DataStream, and then click
Properties.
The DataStream Properties window opens.
2. Click Auto Map.
The data source columns and the literal are mapped to DataStream items.
3. Click OK, in the Visualization pane, right-click StateLookupOptionalL,
and then click Mapping.
The Level Mapping window opens.
4. Drag the level attributes from the right pane to the Maps To column so
that the result appears as shown below:
5. Click OK.
6. Save the catalog, in the Visualization pane, right-click
StateLookupOptionalL, and then click Explore.
The Reference Explorer dialog box appears.
7. Click OK.
All 51 members of the lookup are shown in Reference Explorer.
8. Close Reference Explorer.
9-20
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
9-21
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
9-22
TRANSFORM
DATA
USING
LOOKUPS
AND
Derived
dimension
Before you create a derived dimension, you must have created the required data
sources and DataStream, performed mapping between them, and created the
required reference structures.
DERIVED
DIMENSIONS
Technical Information
In the slide example, we have a table
that contains sales of, among other
things, packs of tent pegs. The
"Product Code" column of this table
(which identifies the product sold in
each specific sales order) is
referenced by a lookup (a singlelevel hierarchical structure that will
be discussed in greater detail later in
this course). The lookup ensures that
each incoming sale references a
product that the company actually
sells.
Based on the data in this table, how
can we find out the number of
individual tent pegs that were sold
overall, regardless of how they were
packaged?
In this example, we have another
table that contains a unit of measure
and a multiplier that we could use to
calculate the total number of tent
pegs that were sold. Although this
table and the sales table are not
directly joined, we can use a derived
dimension to link them, using a
reference attribute that exists in both.
We will do this in a demo.
When Data Manager executes a fact
build, dimension elements in the
transformation model are validated
first. Then the derived dimensions
are validated, based on the order in
which they appear in the user
interface.
9-23
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
2. Add a
calculation.
Technical Information
The calculation can refer to any
measure, attribute, or dimension
element in the transformation model,
and any derived dimension that is before
it in the transformation model. However,
you cannot use a derivation element in
the calculation because derivation
elements are calculated after merging.
Therefore, derivations are not available
on the Calculation tab.
When defining the derived dimension,
you can also specify if unmatched
members are to be accepted, if late
arriving facts are to be added, and any
domain information.
Unmatched members, late arriving facts,
and domains are discussed later in the
course.
9-24
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
Demo 3
Use a Derived
Dimension Element in a
Fact Build
9-25
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
In this case, "UOM" stands for unit
of measurement.
In order for this demo to work, you
must have completed the setup
instructions to create the
ProductSales fact build.
The DerivedDimensionsExample fact
build represents a completed version
of this demo.
ProductUOMLookup retrieves data
from the ProductUOMLookup table in
the DS_Sources connection.
9-26
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
You can see that this product has a value of Triple for PRODUCT_UOM_CODE.
As you saw in the related ProductUOMLookup, a value of Triple indicates that the
product is sold in a three-pack.
9-27
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
9-28
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
9-29
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
5. When the build has finished executing, press Enter, and then open
SQLTerm.
6. In the Database list, ensure that DS_Advanced_out is selected, and then in
the Database objects pane, expand DS_Advanced_out.
7. Right-click ProductSales, and then click Select rows.
8. Delete the semi-colon, and then under the SELECT statement, type the
following:
WHERE QUANTITY <> TOTAL_UNITS_SOLD
ORDER BY PRODUCT_CODE
9. Click Return all rows.
The query executes and returns all the rows in the table, sorted by the
product code.
10. In the Test pane, scroll to the right until you can see the
TOTAL_UNITS_SOLD column.
The result appears as shown below (your rows may be in a slightly different
order, but the values in the PRODUCT_CODE column will be sorted in
ascending order):
9-30
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
11. In the Test section, scroll down until a value of 24 is visible in the
PRODUCT_CODE column.
The result appears as shown below (your rows may be in a slightly different
order, but the values in the PRODUCT_CODE column will be sorted in
ascending order):
9-31
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Summary
In this module, we have:
9-32
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
Workshop 1
Avoid Joins in a Data Source by using
Derived Dimensions
9-33
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
9-34
OrderCode
ProductNumber
VendorSiteCodeGO
SalesStaffCode
OrderDate
OrderMethodCode
Use the Fact Build wizard to create a fact build called Returns. Query all the
columns of the GOSReturnedItems table. Specify ReturnCode as an
attribute element in the transformation model. For the ReturnDate
dimension element, use D_DayL as the reference structure. For the
OrderDetailCode dimension element, use OrderDetailsL as the reference
structure. Do not associate the ReturnReasonCode dimension element with
a reference structure.
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
Add the following derived dimension elements to the F_Returns fact build
(use surrogates when available):
Modify the F_Returns table delivery so that the columns are named and
ordered as follows: DateOrder, DateReturn, VendorSiteKey, StaffKey,
OrderCode, OrderDetailCode, ReturnCode, ReturnReasonCode,
ProductKey, ReturnQuantity.
Execute the Returns fact build and view the F_Returns table in SQLTerm.
For more detailed information outlined as tasks, see the Task Table on the next
page.
For the final query results, see the Workshop Results section that follows the Task
Table.
9-35
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
WHERE TO WORK
HINTS
Dimensions folder
Add OrderDetailCode,
OrderCode, and
ProductNumber to the lookup,
specifying OrderDetailCode as
the ID attribute.
In the OrderHeaderT
template, import all the
columns of the
GOSOrderHeader table.
Ensure that each of the
attributes in the template
match those in the table (press
Enter after changing any
values).
Add OrderCode,
VendorSiteCodeGO,
SalesStaffCode, OrderDate,
and OrderMethodCode to the
lookup, specifying OrderCode
as the ID attribute.
9-36
OrdersD dimension
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
TASK
WHERE TO WORK
HINTS
Change ReturnCode to an
attribute element in the
transformation model.
ReturnDate points to
D_DayL.
OrderDetailCode points to
OrderDetailsL.
ProductNumber (uses
OrderDetailCode.
ProductNumber)
OrderCode (uses
OrderDetailCode.OrderCode)
DateOrder (uses
OrderCode.OrderDate)
VendorSiteCode (uses
OrderCode.
VendorSiteCodeGO)
SalesStaffCode (uses
OrderCode.SalesStaffCode).
DateOrder, DateReturn,
VendorSiteKey, SalesStaffKey,
OrderCode, OrderDetailCode,
ReturnCode,
ReturnReasonCode,
ProductKey, ReturnQuantity
DIMENSIONS
9-37
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
TASK
WHERE TO WORK
HINTS
Execute button
If you need more information to complete a task, see the Step-by-Step instructions
at the end of this workshop.
9-38
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
Workshop 1: Results
After you have created the OrderDetailsL lookup, the result appears as shown
below:
After you have created the OrderHeaderL lookup, the result appears as shown
below:
After you have created the Returns fact build and added the derived dimensions, the
result appears as shown below:
9-39
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
After you have renamed and reordered the columns of the table delivery and
executed the Returns fact build, the result appears as shown below:
9-40
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
Instructional Tips
If you do not perform step 12 (if you
click OK to close the Template
Properties window instead), you may
receive the following error message:
13. Click OK to close the Template Properties window, and then double-click
OrderDetailCode, OrderCode, and ProductNumber to add them to the
Chosen attributes pane.
1. ERROR
DM-HDL-0100 The handle is null or
not valid.
14. In the OrderDetailCode row, select the Id check box, and then click the
Data Access tab.
15. Select the Use Template for data access button, in the Connection list,
select SourceConnect.
16. Next to Table name, click Browse.
17. Expand dbo, click GOSOrderDetail, and then click OK.
18. Click OK to close the Lookup Properties window, and then save the
catalog.
The result appears as shown below:
9-41
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
If you do not perform step 6 (if you
click OK to close the Template
Properties window instead), you may
receive the following error message:
1. ERROR
DM-HDL-0100 The handle is null or
not valid.
If you receive this error message,
click OK to dismiss it. The attributes
will still be added to the template as
expected.
9. Select the Use Template for data access button, in the Connection list,
select SourceConnect.
10. Next to Table name, click Browse.
11. Expand dbo, click GOSOrderHeader, and then click OK.
9-42
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
12. Click OK to close the Lookup Properties window, and then save the
catalog.
The result appears as shown below:
9-43
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
10. Click Next, click Next, and then click Next again.
11. Click Next, deselect the Deliver dimensions check box, and then click
Next.
12. Click Finish.
The result appears as shown below:
9-44
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
9-45
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
9-46
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
9-47
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
5. Click ReturnCode, and then click Move Down until it is fourth from the
bottom in the list.
6. Repeat step 5 to reorder the columns of the table delivery so that the result
appears shown below:
7. Click OK, and then in the Visualization pane, click the Fact Delivery tab.
The result appears as shown below:
9-48
TRANSFORM
DATA
USING
LOOKUPS
AND
DERIVED
DIMENSIONS
Task 6. Execute the Returns fact build and view the results
in SQLTerm.
1. Save the catalog (click Save my version if prompted), in the left pane, click
the Returns fact build, and then on the toolbar, click Execute.
The build executes and delivers 706 rows to the F_Returns fact table.
2. Open SQLTerm, and then in the Database list, select TargetConnect.
3. In the Database objects pane, expand TargetConnect and dbo, right-click
F_Returns, and then click Add table select statement.
4. Click Return all rows.
The result appears as shown below:
9-49
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
9-50
10
IBM Cognos 8 BI
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
10-2
CUSTOMIZE
DATA
DELIVERY
Objectives
In this module, we will:
10-3
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Fact Build
Delivery Modules
Delivery Target
Dimension
Delivery
Data Mart
Fact
Delivery
There are various options for delivering data using a fact build.
If you must create a private data mart that does not use conformed dimensions, you
can define the deliveries for fact data and dimension data within the fact build.
However, when you are developing a data warehouse that uses conformed
dimensions, the fact build is used only to deliver fact data.
10-4
CUSTOMIZE
DATA
DELIVERY
Reference
Sources
Data Sources
Updates
Product
Dimension Builds
Product
D_Product
D_Product
Dimension Build
Hierarchies/Lookups
ProductLevel
Fact Builds
Transactional
Data Sources
Updates
Sales
ProductNumber
Quantity
UnitCost
AverageRevenue
F_Sales
F_Sales
When the target database is a data warehouse, the best practice is to deliver and
maintain the reference data through dimension builds. Fact builds are responsible
for the delivery and maintenance of fact data.
In a production environment, a dimension element does not have to reference all
columns in the corresponding dimension table. In most cases, the dimension
element has to check data integrity at a single level. Therefore, an additional, much
simpler hierarchy or lookup must be created. The new hierarchy or lookup will
reference the dimension table in the data warehouse.
Instructional Tips
Because the course emphasizes the
importance of delivering dimension data
through dimension builds, the current
module only briefly describes the delivery
of dimension data using a fact build.
The slide shows that the Product
dimension build delivers the Product
dimension table, which is based on the
Product hierarchy.
The Sales fact build, which includes the
ProductNumber dimension element and
some fact columns, references the
Product dimension through the
ProductNumber dimension element.
The ProductNumber dimension element
references the D_Product table through
the new ProductLevel hierarchy, which
stores the lowest-level attributes of the
Product dimension.
10-5
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Technical Information
Table delivery modules
The DB2 LOAD delivery module
delivers data to IBM DB2 databases
using the DB2 bulk loader.
Fact Delivery Modules
The Informix LOAD delivery module
delivers data to an Informix database
You can deliver fact data into:
using the Informix DBACCESS
database tables
command.
The Microsoft SQL Server BCP
files
Command delivery module delivers
Table delivery modules
data directly to Microsoft SQL Server
DB2 LOAD
databases using the Microsoft SQL
Informix LOAD
Server BCP bulk load utility.
Non-table delivery modules
Microsoft SQL Server BCP Command
Text File
ORACLE SQL *Loader
The ORACLE SQL*Loader delivery
Essbase Direct Feed
Red Brick Loader (TMU)
module delivers data to an Oracle
Essbase File Feed
Relational Table
database using the Oracle Bulk Load
TM1 Turbo Integrator
SQL Server Bulk Copy via API
utility.
Teradata Fastload
Teradata Multiload
The Red Brick Loader (TMU) delivery
Teradata Tpump
module delivers data to a Red Brick
Netezza NZLoad
database using the Red Brick Bulk
Sybase ASE BCP Command
Loader utility.
Sybase IQLoad
The Relational Table delivery module
is discussed later in this course.
The SQL Server Bulk Copy via API
delivery module supports bulk copying
to Microsoft SQL Server and Sybase
SQL Server. It uses a programmatic
interface supplied by your DBMS
vendor.
The Teradata delivery modules deliver
data to the Teradata bulk loader
Technical Information (cont'd)
utilities.
If you want to update existing fact rows, you must use the Relational Table delivery module.
The Netezza NZLoad delivery module
delivers data directly to a Netezza
The next few pages focus on the relational table delivery module (in the "Table delivery modules"
database using the NZLoad utility.
box in the slide) and the text file delivery module (in the "Non-table delivery modules" box). These
are two of the most commonly used fact delivery modules.
The Sybase ASE BCP Command
delivery module delivers data directly
to Sybase ASE databases using the
Sybase ASE Server BCP bulk load
utility.
The Sybase IQ LOAD delivery module
delivers data directly to Sybase IQ
databases.
Non-table delivery modules
The Text File delivery module is
discussed later in this course.
The Essbase Direct Feed delivery
module delivers data into an Essbase
server.
The Essbase File Feed delivery
module delivers data into flat files that
can then be loaded into Essbase.
The TM1 Turbo Integrator delivery
module creates flat files for loading
into TM1 cubes. It also creates the
TM1 process required to the load data
and runs the process, if required.
10-6
CUSTOMIZE
DATA
DELIVERY
Technical Information
On the Table Properties tab of the Table
Delivery Properties dialog box for the fact
table delivery:
specify the target database and
target tables (mandatory)
specify how indexing is to be
performed (optional)
create keys for columns and change
the column names (optional)
subscribe to and define the
properties for the elements
(optional)
indicate if a column should be
updated when an update operation
is performed (optional)
specify the control attributes to use:
Create Date is the date on
which a new row was inserted
Last Update Date is the date
on which an existing row was
updated
Record Identity is used when
performing table partitioning.
specify how partitioning is to be
performed (optional)
By default, when you add a relational table delivery to a fact build, the refresh type
(selected on the Module Properties tab of the Table Delivery Properties window) is
set to APPEND. If you use this refresh type, any incoming data that is successfully
On the Module Properties tab of the
processed by the fact build will be appended to the target table.
Table Delivery Properties dialog box:
The APPEND refresh type is useful if you want to create a fact build that fetches a
daily "snapshot" of data. For example, you may have a fact build that retrieves data
from an order system, and this build may use a query that only retrieves orders that
have been processed on the most current system date. In this scenario, the use of
the APPEND refresh type ensures that a "snapshot" of new data is continually
added to the existing rows in the target fact table on a daily basis.
10-7
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
By using the Update/Insert or Update delivery method, you can control the way in
which existing fact rows are updated (and for the Update/Insert method, the way
that new rows are inserted into the target table). By using these delivery methods,
you can more efficiently process fact rows where it is not known if a row with the
same key exists in the target table.
Data Manager uses the key settings to override how the Relational Table delivery
module identifies unique rows. These key columns are then used to form the
WHERE clause for the update.
Instructional Tips
Overall, performance depends not only on
the delivery method that you choose, but
also on other considerations, such as the
logging options and indexing.
We recommend that you index the fact
tables, as this will dramatically improve
performance when you use the Update or
Update/Insert delivery methods.
If no key is used and there are no dimension elements in the transformation model, For more information on using the
Update/Insert and Update methods, see
then when the Update/Insert delivery method is selected, Data Manager always
the Data Manager User Guide.
performs an insert. If the Update delivery method is selected, Data Manager
produces an error message and the fact build fails.
10-8
CUSTOMIZE
DATA
DELIVERY
Instructional Tips
The Create Date control attribute is
inserted once into the target table, and
never changes.
The way in which the Last Update Date
control attribute changes depends on the
update detection method that you are
using:
If you select the Update or Select
detection methods, Data Manager
sets the Last Update Date each
time an update is performed, even if
no data has changed in a row. This
happens because Data Manager
refreshes the entire row without
checking individual columns.
If you select the Select/Compare
detection method, Data Manager
only sets the Last Update Date
when specific columns in a row
have changed.
10-9
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Update
Select
Key Cache
Select/Compare
Technical Information
The Select/Compare update detection
method is only available if you have
selected the Incoming record keys are
unique check box in the Table Delivery
Properties window.
If you later clear this check box, the update
detection method is automatically changed
to Select.
For detailed information regarding the
implications of using the Update, Select,
Key Cache, and Select/Compare update
detection methods, see the Data Manager
User Guide.
10-10
CUSTOMIZE
DATA
DELIVERY
10-11
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
The Text File delivery module is used to format build data into simple text files.
These files then can be imported into spreadsheets for cross-tab (pivot table)
analysis or distributed to other systems.
Technical Information
On the Module Properties tab of the
Table Delivery Properties dialog box for
the fact delivery:
specify the filename of the output
file that Data Manager should
generate (mandatory)
specify a character sequence that
Data Manager should use to delimit
the end of each data row and fields
in the output file (mandatory)
On the Element Properties tab of the
Table Delivery Properties dialog box for
the fact delivery:
Subscribe or unsubscribe the build
elements for delivery (optional). The
Available Elements pane shows all
the elements in the fact build. The
Subscribed Elements pane shows
the list of build elements to which
the delivery subscribes (by default,
this includes all the elements). Data
Manager delivers only values from
the subscribed elements list.
10-12
CUSTOMIZE
DATA
DELIVERY
2.
3.
4.
5.
In general, you should not deliver dimension data in a fact build. However, there are
exceptions to this rule:
10-13
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Demo 1
Manually Add a Relational
Table Delivery to a Fact Build
10-14
CUSTOMIZE
DATA
DELIVERY
Instructional Tips
If time permits, you may want to
have the students manually create
an entirely new fact build and then
add a relational table delivery to this
fact build.
10-15
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
11. In the Name box, type F_DemoFact, and then ensure that the Enabled
check box is selected.
12. Click the Table Properties tab, in the Connection list, click TargetConnect,
and then in the Table name box, type F_DemoFact.
The result appears as shown below:
13. Click the Module Properties tab, and then ensure that APPEND is
selected in the Refresh Type list.
14. Click OK to close the Table Delivery Properties window.
Task 2. Execute the build and view the results.
1. In the Visualization pane, right-click DataStream, and then click
Properties.
The DataStream Properties window opens.
2. If necessary, drag DateOrder from the DataStream Items pane to the left
of the OrderDate column.
The result appears as shown below:
3. Click the Input tab, ensure that 100 is entered in the Maximum input rows
to process box, and then click OK.
4. In the Visualization pane, right-click the F_DemoSales table, and then
click Properties.
5. Click the General tab, deselect the Enabled check box to disable the
delivery of this fact table, and then click OK.
10-16
CUSTOMIZE
DATA
DELIVERY
6. Save the catalog, in the tree, click DemoSales, and then on the toolbar,
click Execute.
A command window opens, and a log file is created that tracks the process
of the build. Notice that 100 rows are inserted into the F_DemoFact table.
7. Press Enter to close the command window.
8. Open SQLTerm, and then in the Database list, click TargetConnect.
9. In the Database objects pane, expand TargetConnect and dbo, right-click
F_DemoFact, and then click Add table select statement.
The SQL statement appears in the Query pane.
10. Click Return all rows.
The result appears as shown below:
The F_DemoFact table contains the 100 rows that were inserted during the
build execution process. The ProductNumber, VendorSiteCode, and
DateOrder columns contain surrogate key values derived from the
appropriate lookups.
11. Close SQLTerm.
Results:
You added a relational table to the fact delivery of the
DemoSales fact build. You then executed the build and viewed
the new table in SQLTerm.
10-17
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
unique B-tree
2.
3.
bitmap
Instructional Tips
When you work with a large data
warehouse, you probably would not use
Data Manager to create indexes. They
are usually created through the index
plan by the DBA.
Stress to students the difference
between keys and indexes. Keys are
the logical elements, whereas indexes
are the physical elements. Usually,
indexes are created on columns that
already have keys.
Indexes are required for a row search in
a large amount of data. For example, if
you are looking for a value of 1234 for
EmployeeCode 1234, having an index
means that the database does not have
to scan through all 50,000 employees.
The database uses the index to find the
row. Indexes are especially useful for
updating rows of data.
1. The unique B-tree index is used for high-cardinality primary key columns
(for example, product_id, customer_id).
2. The repeating B-tree index is used for high-cardinality foreign key columns
(for example, sales_product_id, sales_customer_id).
3. The bitmap index is used with dimension tables and fact tables, where the
constraint on the fact table results in a low cardinality match with the
dimension table (for example, columns that contain gender codes or
yes/no values).
10-18
CUSTOMIZE
DATA
DELIVERY
Technical Information
A fact table can have only one composite
index, but can have multiple singlecolumn indexes. It is a good practice to
have a composite index on the group of
table key columns and a single-column
index on individual fact columns that will
likely be used as a join condition, filter, or
group.
Single-column Indexes
orders_product
orders_date
orders_customer
orders_order
Orders
Composite Index
product_no(FK)
order_date(FK)
customer_no(FK)
quantity
unit_price
order_code
orders_prod_date_cust_pkey
The most common index for a fact table is the B-tree index. When we declare a
primary key constraint on a table, a unique index is built automatically on those
columns in the order in which they were declared. A fact table contains not only a
primary key but also foreign keys represented by dimension elements; therefore, it is
important to create repeating B-tree indexes on those columns.
Data Manager provides two options for creating fact table indexes:
a composite index, which is a single index based on the fact table keys
represented by dimension elements
10-19
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
10-20
CUSTOMIZE
DATA
DELIVERY
Demo 2
Define Keys and Indexes on
Fact and Dimension Tables
10-21
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
10-22
CUSTOMIZE
DATA
DELIVERY
10-23
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
10-24
CUSTOMIZE
DATA
DELIVERY
Instructional Tips
You may receive an error at the very
end of the fact build due to the
dropping of indexes. This is
acceptable, as long as the fact build
itself completed successfully.
10-25
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
4. Press Enter to close the command window, and then from the Tools
menu, click Browse Log Files.
5. Open the most recent log file, and then scroll to the bottom.
Notice that Data Manager creates indexes on the dimension element
columns, ignoring any processing errors. Also, it creates a composite index
on the group of table key columns.
6. Close the log file, and then close Windows Explorer.
Task 6. Execute the DemoSalesUpdate fact build and
analyze the results.
1. In the tree, right-click DemoSalesUpdate, and then click Execute.
The Execute Build dialog box appears.
2. In the Trace area, select the Override build settings check box, and then
select the SQL check box.
3. Ensure that the Progress check box is also selected, and then click OK.
A command window opens and a log file is created that tracks the progress
of the build's execution.
4. Press Enter to close the command window, and then from the Tools
menu, click Browse Log Files.
The Log window opens.
5. Open the most recent log file.
Notice that Data Manager has updated 100 rows in the F_DemoSales table,
and that the key columns are included in the WHERE clause.
6. Close the log file, and then close Windows Explorer.
Task 7. Create indexes on the surrogate and business key
columns of the D_ProductH dimension table.
1. In the tree, click the D_ProductH dimension build, in the Visualization
pane, right-click the D_ProductH table (on the far right side), and then
click Properties.
The Dimension Table Properties window opens.
2. Click the Columns tab, and then in the product_skey row, select the Index
box (if it is not already selected).
An ellipsis button appears in the Index column for the product_skey row.
3. Click the ellipsis.
The Index Properties dialog box appears.
4. In the Name box, type D_ProductH_ui1.
10-26
CUSTOMIZE
DATA
DELIVERY
10-27
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Instructional Tips
There are already products in the
ProductH hierarchy with ID numbers of
110 (Blue Steel Putter) and 115 (Course
Pro Gloves). You may want to explore the
hierarchy and show the students which
products already use these numbers.
Instead of adding static members, you may
want to include rows of data in a text file,
and then add the text file as a data source
in the catalog.
4. Type Red Pencils directly into the ProductName box, and then press
Enter.
5. Repeat steps 3 and 4 to add another member, using 115 for
ProductNumber and Coffee Tables for ProductName.
The result appears as shown below:
6. Click OK to close the Static Members window, and then save the catalog.
7. In the tree, right-click the D_ProductH build, and then click Execute.
The Execute Build dialog box appears.
8. In the Trace area, select the Override build settings check box, and then
select the SQL check box.
9. Ensure that the Progress check box is also selected, and then click OK.
A command window opens and the build executes.
10. Press Enter when the build has finished executing to close the command
window, and then from the Tools menu, click Browse Log Files.
The Log window opens.
11. Open the most recent log file, and then scroll to the bottom.
You can see the UPDATE statement that indicates that data has been
updated, as well as the statements to create the indexes on the product_skey
and ProductNumber columns.
12. Close the log file, and then close Windows Explorer.
10-28
CUSTOMIZE
DATA
DELIVERY
13. In the tree, click the ProductH hierarchy, in the Visualization pane, rightclick the Product level, and then click Delete Static Members.
A message appears, confirming the deletion.
14. Click Yes, and then save the catalog (click Save my version if prompted).
Results:
You defined keys on the OrderCode column and the dimension
element columns of the F_DemoFact table. You also created
single-column indexes on dimension element columns and a
composite index on all key columns in the F_DemoFact table.
You then executed the DemoSales fact build to view the results.
You also created single-column indexes on the surrogate and
business key columns of the D_ProductH table. You then added
static members to the lowest level of the ProductH hierarchy.
Lastly, you executed the D_ProductH dimension build and
viewed the results.
10-29
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Summary
In this module, we have:
10-30
CUSTOMIZE
DATA
DELIVERY
Workshop 1
Manually Create a Fact Build and Add a Fact Delivery
10-31
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
Add the Sales fact build to the build tree and add a data source that uses
data from the GOSOrderDetail and GOSOrderHeader tables in the
SourceConnect database.
Map the columns from the data source to items in the DataStream, and
then map the DataStream items to the elements of the transformation
model.
Process only 1,000 rows of data. Execute the build, and specify that you
want to include messages relating to the SQL that is written and executed
by the build.
For more detailed information outlined as tasks, see the Task Table on the next
page.
For the final query results, see the Workshop Results section that follows the Task
Table.
10-32
CUSTOMIZE
DATA
DELIVERY
WHERE TO WORK
Build tree
Data Source Properties
window
SELECT
Transformation Model
Transformation Model
HINTS
Name the build Sales.
a."OrderCode",
"ProductNumber",
"Quantity",
"VendorSiteCodeGO",
"SalesStaffCode",
"OrderDate"
FROM
"GOSOrderDetail" a,
"GOSOrderHeader" b
WHERE
a."OrderCode" =
b."OrderCode"
DataStream Properties
window
Transformation Model
Mapping window
10-33
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
TASK
7. Execute the build and
view the results.
WHERE TO WORK
Execute Build dialog box
SQLTerm
HINTS
In the DataStream Properties
window, in the Maximum input
rows to process box, insert 1000.
If you need more information to complete a task, see the Step-by-Step instructions
at the end of this workshop.
10-34
CUSTOMIZE
DATA
DELIVERY
Workshop 1: Results
The resulting log file appears similar to that shown below:
10-35
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
FROM
WHERE
a."OrderCode",
"ProductNumber",
"Quantity",
"VendorSiteCodeGO",
"SalesStaffCode",
"OrderDate"
"GOSOrderDetail" a, "GOSOrderHeader" b
a."OrderCode" = b."OrderCode"
7. Click the Result columns tab, ensure that Prepare is selected, and then
click Refresh to prepare the columns for use in the fact build.
8. Click OK.
Task 2. Add the product_skey, vendorsite_skey,
salesstaff_skey, and day_skey dimension elements
to the fact build.
1. In the tree, under the Sales fact build, right-click Transformation Model,
and then click Insert Dimension.
The Dimension Properties window opens.
2. In the Name box, type product_skey, and then click the Reference tab.
3. In the Dimension list, click ProductD, and then in the Structure list, click
D_ProductL (L).
4. Select the Use surrogates when available check box, and then click OK
to close the Dimension Properties window.
10-36
CUSTOMIZE
DATA
DELIVERY
10-37
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
10-38
CUSTOMIZE
DATA
DELIVERY
Task 6. Create indexes on the fact table and limit data input.
1. Click the product_skey row, and then select the Index check box.
A browse button appears in the Index Properties column for the
product_skey row.
2. Click the browse button in the Index Properties column for the
product_skey row.
The Index Properties dialog box appears.
3. In the Name box, type F_Sales_i1, select the Suppress Errors and
Recreate Index check boxes, and then click OK.
4. Repeat steps 1 to 3 to create indexes on the vendorsite_skey,
salesstaff_skey, and day_skey columns. Name the indexes F_Sales_i2,
F_Sales_i3, and F_Sales_i4, respectively.
5. Click the Module Properties tab, in the Refresh Type list, click
TRUNCATE, and then click OK to close the Table Delivery Properties
window.
Task 7. Execute the build and view the results.
1. In the Visualization pane, right-click DataStream, and the click Properties.
The DataStream Properties window opens.
2. Click the Input tab, and then in the Maximum input rows to process box,
type 1000.
3. Click OK to close the DataStream Properties window, and then save the
catalog (click Save my version if prompted).
4. In the tree, right-click Sales, and then click Execute.
The Execute Build dialog box appears.
5. Select the Override build settings check box, and then select the SQL
and ExecutedSQL check boxes.
6. Ensure that the Progress check box is also selected, and then click OK.
A command window opens, and a log file is created that tracks the progress
of the build execution. Notice that 1000 rows have been inserted into
F_Sales table.
7. Press Enter to close the command window.
8. Open SQLTerm, and then in the Database list, click TargetConnect.
9. In the Database objects pane, expand TargetConnect and dbo, right-click
F_Sales, and then click Add table select statement.
The SQL statement appears in the Query pane.
10-39
IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)
10-40
W W W. C O G N O S . C O M