Sunteți pe pagina 1din 482

Cognos Training

IBM Cognos 8 BI Data Manager:


Build Datamarts with
Enterprise Data (v8.4)
Instructor Guide Volume 1

IBM

COGNOS

BI

DATA

MANAGER:

BUILD

DATAMARTS

WITH

ENTERPRISE

DATA

IBM Cognos 8 BI Data Manager: Build Datamarts with


Enterprise Data (v8.4)

Copyright 2008 Cognos ULC (formerly Cognos


Incorporated). Cognos ULC is an IBM Company.

B2480

Portions of Cognos(R) software products are protected


by one or more of the following U.S. Patents: 6,609,123
B1; 6,611,838 B1; 6,662,188 B1; 6,728,697 B2;
6,741,982 B2; 6,763,520 B1; 6,768,995 B2; 6,782,378
B2; 6,847,973 B2.

Published January 2009

(V8.4)

While every attempt has been made to ensure that the


information in this document is accurate and complete,
some typographical errors or technical inaccuracies may
exist. Cognos does not accept responsibility for any kind
of loss resulting from the use of information contained in
this document.
This document shows the publication date. The
information contained in this document is subject to
change without notice. Any improvements or changes to
the information contained in this document will be
documented in subsequent editions. This document
contains proprietary information of Cognos. All rights are
reserved. No part of this document may be copied,
photocopied, reproduced, stored in a retrieval system,
transmitted in any form or by any means, or translated
into another language without the prior written consent of
Cognos.
Cognos and the Cognos logo are trademarks of Cognos
ULC (formerly Cognos Incorporated) in the United States
and/or other countries. IBM and the IBM logo are
trademarks of International Business Machines
Corporation in the United States, or other countries, or
both. All other names are trademarks or registered
trademarks of their respective companies.
Information about Cognos products can be found at
www.cognos.com

IP-2

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).

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)

CREATE A CATALOG................................................................................................... 2-1


OBJECTIVES ..................................................................................................................... 2-3
THE DATA MART DEVELOPMENT PROCESS: OVERVIEW.................................................. 2-4
WHAT IS A CATALOG? ..................................................................................................... 2-5
PHYSICAL STORAGE OF THE CATALOG ............................................................................ 2-6
SHARED ITEMS IN A CATALOG ......................................................................................... 2-7
CREATE A CATALOG ........................................................................................................ 2-8
CONNECT TO SOURCES AND TARGETS ............................................................................. 2-9
CONNECT TO A PUBLISHED FRAMEWORK MANAGER PACKAGE .................................... 2-10
CONNECT TO A IBM COGNOS DATA SOURCE ................................................................ 2-11
ACCESS DATA USING SQLTERM ................................................................................... 2-12
TEST YOUR QUERIES USING SQL HELPER .................................................................... 2-13
DEMO 1: CREATE A CATALOG AND REGISTER DATA SOURCES ..................................... 2-14
CONFIGURE TEXT FILES USING SQLTXT ..................................................................... 2-19
DEMO 2: CONFIGURE A TEXT FILE USING SQLTXT ..................................................... 2-20
SUMMARY ..................................................................................................................... 2-24
WORKSHOP 1 DEFINE CONNECTIONS TO DATA SOURCES .............................................. 2-25
CREATE HIERARCHIES .............................................................................................. 3-1
OBJECTIVES ..................................................................................................................... 3-3
THE DATA MART DEVELOPMENT PROCESS: OVERVIEW.................................................. 3-4
THE DIMENSIONAL FRAMEWORK IN THE DATA MART .................................................... 3-5
THE PURPOSE OF THE DIMENSIONAL FRAMEWORK ......................................................... 3-6
BUILD THE DIMENSIONAL FRAMEWORK .......................................................................... 3-7
EXAMINE HIERARCHY COMPONENTS .............................................................................. 3-8
EXAMINE ATTRIBUTES OF A HIERARCHY LEVEL ............................................................. 3-9
MAP DATA INTO A HIERARCHY ..................................................................................... 3-10
WHERE DO DATA SOURCES GO IN A HIERARCHY?........................................................ 3-11
CREATE HIERARCHIES USING THE HIERARCHY WIZARD ............................................... 3-12
CREATE THE HIERARCHY FROM THE COLUMNS OF ONE TABLE ..................................... 3-13
CREATE THE HIERARCHY FROM THE ROWS OF ONE TABLE ........................................... 3-14
CREATE THE HIERARCHY FROM MULTIPLE TABLES ...................................................... 3-15
DEMO 1: EXAMINE SOURCE DATA FOR HIERARCHIES ................................................... 3-16
TEST AND VIEW A HIERARCHY USING THE REFERENCE EXPLORER ............................... 3-18
DEMO 2: CREATE A HIERARCHY FROM MULTIPLE TABLES AND EXAMINE ITS
PROPERTIES ................................................................................................................... 3-19
CREATE A HIERARCHY OF STATIC DATE VALUES ......................................................... 3-24
HANDLE WEEKS IN A DATE HIERARCHY ....................................................................... 3-25
DEMO 3: CREATE AND EXAMINE A STATIC DATE HIERARCHY ...................................... 3-26
SUMMARY ..................................................................................................................... 3-29
WORKSHOP 1: CREATE A HIERARCHY FROM THE COLUMNS OF ONE TABLE AND
EXAMINE ITS PROPERTIES .............................................................................................. 3-30
WORKSHOP 2: CREATE A HIERARCHY FROM THE ROWS OF ONE TABLE AND
EXAMINE ITS PROPERTIES .............................................................................................. 3-38

IP-4

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).

INSTRUCTOR

PREFACE

CREATE BASIC BUILDS............................................................................................... 4-1


OBJECTIVES ..................................................................................................................... 4-3
THE DATA MART DEVELOPMENT PROCESS: OVERVIEW.................................................. 4-4
WHAT IS A BUILD? .......................................................................................................... 4-5
TYPES OF BUILDS ............................................................................................................ 4-6
WHAT IS A DIMENSION BUILD? ....................................................................................... 4-7
CREATE A DIMENSION BUILD USING THE DIMENSION BUILD WIZARD............................ 4-8
DEMO 1: CREATE A DIMENSION BUILD ........................................................................... 4-9
HOW DATA MANAGER CREATES DATA MARTS: OVERVIEW ......................................... 4-12
THE FACT BUILD PROCESS ............................................................................................ 4-13
IDENTIFY THE ELEMENTS OF A FACT BUILD .................................................................. 4-14
CREATE A FACT BUILD USING THE FACT BUILD WIZARD ............................................. 4-15
IDENTIFY TYPES OF FACT BUILDS ................................................................................. 4-16
USE A FACT BUILD TO TRANSFER DATA........................................................................ 4-17
DEMO 2: CREATE A FACT BUILD ................................................................................... 4-18
EXAMINE A FACT BUILD GRAPHICALLY ........................................................................ 4-22
FACT BUILD VISUALIZATION ......................................................................................... 4-23
EXAMINE SOURCE DATA MAPPING ............................................................................... 4-24
TRANSFORMATION MODEL VISUALIZATION .................................................................. 4-25
FACT DELIVERY VISUALIZATION................................................................................... 4-26
EXAMINE FACT BUILD DELIVERIES ............................................................................... 4-27
EXAMINE TYPES OF FACT DELIVERIES .......................................................................... 4-28
EXECUTE A FACT BUILD ................................................................................................ 4-29
CONTROL BUILD FEEDBACK .......................................................................................... 4-30
DEMO 3: EXECUTE A FACT BUILD AND VIEW THE RESULTING LOG FILE ...................... 4-31
DOCUMENT A CATALOG ................................................................................................ 4-33
DEMO 4: DOCUMENT A CATALOG.................................................................................. 4-34
CREATE CATALOG SCHEMA .......................................................................................... 4-37
SUMMARY ..................................................................................................................... 4-38
CREATE DERIVATIONS............................................................................................... 5-1
OBJECTIVES ..................................................................................................................... 5-3
WHAT IS A DERIVATION?................................................................................................. 5-4
WHERE CAN YOU CREATE A DERIVATION? .................................................................... 5-5
WHEN TO USE A DERIVATION?........................................................................................ 5-6
USE OPERATORS IN DERIVATIONS ................................................................................... 5-7
USE FUNCTIONS IN DERIVATIONS .................................................................................... 5-8
CREATE A DATA SOURCE DERIVATION ........................................................................... 5-9
CREATE A DATASTREAM DERIVATION .......................................................................... 5-10
CREATE A TRANSFORMATION MODEL DERIVATION ...................................................... 5-11
CALCULATE A DERIVATION IN THE TRANSFORMATION MODEL .................................... 5-12
EXAMINE THE DERIVATION TIMING MODEL .................................................................. 5-13
DEMO 1: ADD DERIVATION ELEMENTS TO A FACT BUILD ............................................. 5-14
SUMMARY ..................................................................................................................... 5-21

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-5

IBM

COGNOS

BI

DATA

MANAGER:

BUILD

DATAMARTS

WITH

ENTERPRISE

DATA

(V8.4)

CREATE CONFORMED DIMENSIONS...................................................................... 6-1


OBJECTIVES ..................................................................................................................... 6-3
REVIEW: A PRIVATE DATA MART ................................................................................... 6-4
EXAMINE CONFORMED DIMENSIONS ............................................................................... 6-5
ADVANTAGES OF CONFORMED DIMENSIONS ................................................................... 6-6
DESIGN CONFORMED DIMENSIONS: GUIDELINES............................................................. 6-7
MAP CONFORMED DIMENSIONS ...................................................................................... 6-8
GRANULARITY IN CONFORMED DIMENSIONS .................................................................. 6-9
EXAMINE SURROGATE KEYS ......................................................................................... 6-11
USE SURROGATE KEYS IN CONFORMED DIMENSIONS ................................................... 6-12
EXAMINE SLOWLY CHANGING DIMENSIONS (SCDS)..................................................... 6-13
EXAMINE ISSUES WITH SLOWLY CHANGING DIMENSIONS ............................................. 6-14
USE DIFFERENT METHODS TO HANDLE SLOWLY CHANGING DIMENSIONS ................... 6-15
STANDARDIZE DIMENSION ATTRIBUTES ........................................................................ 6-16
STANDARDIZE FACT DEFINITIONS ................................................................................. 6-17
CREATE CONFORMED DATA MARTS: OVERVIEW .......................................................... 6-18
DELIVER CONFORMED DIMENSIONS WITH DIMENSION BUILDS ..................................... 6-19
DEMO 1: CREATE CONFORMED DIMENSION BUILDS...................................................... 6-20
REFERENCE STRUCTURES FOR FACT BUILDS ................................................................. 6-24
USE REFERENCE STRUCTURES WITH FACT BUILDS ....................................................... 6-25
DATA INTEGRITY LOOKUPS: OVERVIEW........................................................................ 6-26
CREATE A DATA INTEGRITY LOOKUP ............................................................................ 6-27
DEMO 2: CREATE DATA INTEGRITY LOOKUPS ............................................................... 6-28
DEMO 3: CREATE A FACT BUILD THAT REFERENCES DATA INTEGRITY LOOKUPS ......... 6-33
CREATE CONFORMED DIMENSIONS: REVIEW ................................................................ 6-37
USE CONFORMED DIMENSIONS: REVIEW ....................................................................... 6-38
SUMMARY ..................................................................................................................... 6-39
WORKSHOP 1: CREATE A LOOKUP AND A FACT TABLE THAT USE CONFORMED
DIMENSIONS .................................................................................................................. 6-40
CUSTOMIZE REFERENCE STRUCTURES............................................................... 7-1
OBJECTIVES ..................................................................................................................... 7-3
MANUALLY CREATE A HIERARCHY: OVERVIEW ............................................................. 7-4
SPECIFY FEATURES FOR A HIERARCHY ............................................................................ 7-5
CREATE LITERALS ........................................................................................................... 7-6
DEMO 1: MANUALLY CREATE A HIERARCHY .................................................................. 7-7
SET DATA ACCESS FOR HIERARCHY LEVELS ................................................................. 7-17
USE TEMPLATES IN THE DATA WAREHOUSE: EXAMPLE ................................................ 7-18
STATIC AND DYNAMIC MEMBERS ................................................................................. 7-19
EXAMINE FOSTERING .................................................................................................... 7-20
USE A DERIVATION IN A HIERARCHY............................................................................. 7-21
POPULATE A HIERARCHY USING MULTIPLE DATA SOURCES ......................................... 7-22
MULTIPLE DATA SOURCES AND DERIVATIONS IN HIERARCHIES ................................... 7-23
DEMO 2: CREATE A HIERARCHY THAT INCLUDES A DERIVATION .................................. 7-24
SUMMARY ..................................................................................................................... 7-34
WORKSHOP 1: CREATE DIMENSION BUILDS .................................................................. 7-35
WORKSHOP 2: CREATE DATA INTEGRITY LOOKUPS ...................................................... 7-50

IP-6

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).

INSTRUCTOR

PREFACE

PRESERVE DIMENSIONAL HISTORY AND LATE ARRIVING FACTS ............. 8-1


OBJECTIVES ..................................................................................................................... 8-3
EXAMINE SLOWLY CHANGING DIMENSIONS (SCD) ........................................................ 8-4
USE SURROGATE KEYS IN SCDS ..................................................................................... 8-5
USE BUSINESS KEYS IN A DATA WAREHOUSE: EXAMPLE ............................................... 8-6
USE SURROGATE KEYS IN A DATA WAREHOUSE: EXAMPLE............................................ 8-7
LINK DIMENSION TABLES TO FACT TABLES USING SURROGATES ................................... 8-8
SURROGATE KEY SUBSTITUTION IN A FACT TABLE ......................................................... 8-9
DEMO 1: MANUALLY ADD A SURROGATE KEY TO A DIMENSION TABLE ...................... 8-10
EXAMINE ISSUES WITH SLOWLY CHANGING DIMENSIONS ............................................. 8-16
USE DIFFERENT METHODS TO HANDLE SLOWLY CHANGING DIMENSIONS ................... 8-17
TRACK TYPE 0 CHANGES ............................................................................................... 8-18
TRACK TYPE 0 CHANGES: EXAMPLE ............................................................................. 8-19
TYPE 1: OVERWRITE THE ORIGINAL VALUE .................................................................. 8-20
TYPE 2: ADD A NEW DIMENSION ROW .......................................................................... 8-21
USE TEMPLATES TO MANAGE DIMENSIONAL CHANGES ................................................ 8-22
USE BUSINESS KEYS WITH TYPE 2 CHANGES ................................................................ 8-23
DEMO 2: APPLY SCDS TO A DIMENSION BUILD ............................................................ 8-24
TYPE 1 AND TYPE 2 UPDATES: REVIEW ......................................................................... 8-31
TYPE 1 AND TYPE 2 UPDATES: LOGGING ....................................................................... 8-32
LOAD HISTORICAL DATA FOR A DIMENSION ................................................................. 8-33
IMPLEMENT DIMENSIONAL HISTORY ............................................................................. 8-34
PROCESS DIMENSIONAL HISTORY.................................................................................. 8-35
PROCESS LATE ARRIVING DIMENSION DETAILS ............................................................ 8-36
SPECIFY THE SOURCE OF THE EFFECTIVE DATE ............................................................. 8-37
SPECIFY OTHER EFFECTIVE DATE OPTIONS................................................................... 8-38
DEMO 3: LOAD DIMENSIONAL HISTORY ........................................................................ 8-39
WHAT ARE LATE ARRIVING FACTS?.............................................................................. 8-49
PROCESS LATE ARRIVING FACTS: PREREQUISITES ........................................................ 8-50
DEMO 4: CREATE A LOOKUP AND A FACT BUILD TO PROCESS LATE ARRIVING FACTS . 8-51
SUMMARY ..................................................................................................................... 8-57
TRANSFORM DATA USING LOOKUPS AND DERIVED DIMENSIONS ............. 9-1
OBJECTIVES ..................................................................................................................... 9-3
WHEN CAN YOU USE LOOKUPS?..................................................................................... 9-4
IDENTIFY THE REQUIREMENTS FOR A LOOKUP ................................................................ 9-5
USE A TRANSLATION LOOKUP ......................................................................................... 9-6
DEMO 1: CONVERT CURRENCY DATA USING A TRANSLATION LOOKUP.......................... 9-7
USE AN OPTIONAL LOOKUP ........................................................................................... 9-17
DEMO 2: FLAG INVALID DATA USING AN OPTIONAL LOOKUP ....................................... 9-18
WHAT IS A DERIVED DIMENSION? ................................................................................. 9-23
HOW TO CREATE A DERIVED DIMENSION ...................................................................... 9-24
DEMO 3: USE A DERIVED DIMENSION ELEMENT IN A FACT BUILD ................................ 9-25
SUMMARY ..................................................................................................................... 9-32

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-7

IBM

COGNOS

BI

DATA

MANAGER:

BUILD

DATAMARTS

WITH

ENTERPRISE

DATA

(V8.4)

CUSTOMIZE DATA DELIVERY................................................................................ 10-1


OBJECTIVES ................................................................................................................... 10-3
DELIVERY PROCESS TO A SINGLE DATA MART ............................................................. 10-4
DELIVERY PROCESS TO A DATA WAREHOUSE ............................................................... 10-5
FACT DELIVERY MODULES ............................................................................................ 10-6
DELIVER FACT DATA TO A RELATIONAL TABLE............................................................ 10-7
CONFIGURE DATA UPDATING FOR A RELATIONAL TABLE ............................................. 10-8
SELECT THE UPDATE DETECTION METHOD FOR A RELATIONAL TABLE ...................... 10-10
DELIVER FACT DATA TO A TEXT FILE ......................................................................... 10-12
DELIVER DIMENSION DATA IN A FACT BUILD ............................................................. 10-13
DEMO 1: MANUALLY ADD A RELATIONAL TABLE DELIVERY TO A FACT BUILD ......... 10-14
CREATE INDEXES ON FACT AND DIMENSION TABLES .................................................. 10-18
USE FACT TABLE INDEXES .......................................................................................... 10-19
SPECIFY KEYS FOR A FACT TABLE............................................................................... 10-20
DEMO 2: DEFINE KEYS AND INDEXES ON FACT AND DIMENSION TABLES ................... 10-21
SUMMARY ................................................................................................................... 10-30
WORKSHOP 1: MANUALLY CREATE A FACT BUILD AND ADD A FACT DELIVERY ....... 10-31
CUSTOMIZE FACT DATA PROCESSING ............................................................... 11-1
OBJECTIVES ................................................................................................................... 11-3
THE FACT BUILD PROCESS ............................................................................................ 11-4
HOW DATA MANAGER PROCESSES FACT DATA: DEFAULT PROCESSING....................... 11-5
HOW DATA MANAGER ACQUIRES FACT DATA: MERGING OR REJECTING
DUPLICATE DATA .......................................................................................................... 11-6
FILTER SOURCE DATA ................................................................................................... 11-7
DEMO 1: FILTER SOURCE DATA..................................................................................... 11-8
ALLOW OR REJECT DUPLICATE FACT DATA ROWS ..................................................... 11-11
MERGE DUPLICATE FACT ROWS.................................................................................. 11-12
DEMO 2: MERGE DATA ................................................................................................ 11-13
FACT DATA INTEGRITY CHECKING .............................................................................. 11-21
INCLUDE UNMATCHED MEMBERS ............................................................................... 11-22
TRACK REJECTED ROWS .............................................................................................. 11-23
DEMO 3: REJECT AND ANALYZE DATA........................................................................ 11-24
SUMMARY ................................................................................................................... 11-26
AGGREGATE, FILTER, AND PARTITION FACT DATA...................................... 12-1
OBJECTIVES ................................................................................................................... 12-3
THE FACT BUILD PROCESS ............................................................................................ 12-4
WHAT IS AGGREGATION? .............................................................................................. 12-5
EXAMINE THE AGGREGATION PROCESS ......................................................................... 12-6
EXAMINE AGGREGATE RULES ....................................................................................... 12-7
IMPACT OF AGGREGATING FACT DATA ......................................................................... 12-8
AGGREGATE DUPLICATE FACT ROWS ........................................................................... 12-9
FACTORS TO CONSIDER WHEN AGGREGATING DATA .................................................. 12-10
DEMO 1: AGGREGATE DATA ....................................................................................... 12-11
RESTRICT FACT DATA DELIVERY ................................................................................ 12-20
VERTICALLY RESTRICT FACT DATA ............................................................................ 12-21
DEMO 2: VERTICALLY RESTRICT FACT DATA ............................................................. 12-22
HORIZONTALLY RESTRICT FACT DATA ....................................................................... 12-25
CREATE LEVEL FILTERS .............................................................................................. 12-26

IP-8

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).

INSTRUCTOR

PREFACE

LEVEL FILTER CONSIDERATIONS ................................................................................. 12-27


EXAMPLES OF LEVEL FILTERS ..................................................................................... 12-28
CREATE OUTPUT FILTERS ............................................................................................ 12-29
DEMO 3: HORIZONTALLY RESTRICT FACT DATA......................................................... 12-30
PARTITION FACT DATA................................................................................................ 12-35
ORDERING FACT TABLE PARTITIONS ........................................................................... 12-36
DEMO 4: PARTITION FACT DATA ................................................................................. 12-37
SUMMARY ................................................................................................................... 12-43
IMPLEMENT JOB CONTROL.................................................................................... 13-1
OBJECTIVES ................................................................................................................... 13-3
THE DATA MART DEVELOPMENT PROCESS: OVERVIEW................................................ 13-4
JOB CONTROL AND THE DATA WAREHOUSE .................................................................. 13-5
WHAT IS A JOBSTREAM? ............................................................................................... 13-6
CHARACTERISTICS OF JOBSTREAMS .............................................................................. 13-7
ADD VARIABLES TO A JOBSTREAM ............................................................................... 13-8
MAIN COMPONENTS OF A JOBSTREAM .......................................................................... 13-9
BUILD NODE ................................................................................................................ 13-10
SQL NODE................................................................................................................... 13-11
PROCEDURE NODE ....................................................................................................... 13-12
CONDITION NODE ........................................................................................................ 13-13
JOBSTREAM NODE ....................................................................................................... 13-14
ALERT NODE ............................................................................................................... 13-15
EMAIL NODE................................................................................................................ 13-16
SPECIFY THE RESULT VARIABLE ................................................................................. 13-18
ACTION ON FAILURE .................................................................................................... 13-19
LINK JOBSTREAM NODES ............................................................................................ 13-20
EXECUTE NODES SEQUENTIALLY OR IN PARALLEL ..................................................... 13-21
EXECUTE A JOBSTREAM .............................................................................................. 13-22
DEMO 1: CREATE A JOBSTREAM.................................................................................. 13-23
DEMO 2: LINK AND RUN NODES IN A JOBSTREAM ....................................................... 13-29
JOBSTREAMS AND WAREHOUSE DEPLOYMENT ........................................................... 13-32
SUMMARY ................................................................................................................... 13-33
WORKSHOP 1: CREATE A JOBSTREAM TO DELIVER A CONFORMED DIMENSION ......... 13-34
AUTOMATE FUNCTIONALITY USING COMMANDS ......................................... 14-1
OBJECTIVES ................................................................................................................... 14-3
THE COMMAND LINE INTERFACE (CLI) ........................................................................ 14-4
CLI COMMANDS ............................................................................................................ 14-5
EXECUTE A FACT BUILD ................................................................................................ 14-6
EXECUTE A DIMENSION BUILD ...................................................................................... 14-7
EXECUTE A JOBSTREAM ................................................................................................ 14-8
DEMO 1: USE COMMANDS TO CREATE A FACT BUILD EXECUTABLE ............................. 14-9
VARIABLES AND THE CLI ............................................................................................ 14-12
WHERE VARIABLES CAN BE DECLARED ..................................................................... 14-13
SUMMARY ................................................................................................................... 14-14

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-9

IBM

COGNOS

BI

DATA

MANAGER:

BUILD

DATAMARTS

WITH

ENTERPRISE

DATA

(V8.4)

CUSTOMIZE FUNCTIONALITY WITH USER-DEFINED FUNCTIONS AND


VARIABLES ................................................................................................................... 15-1
OBJECTIVES ................................................................................................................... 15-3
WHAT IS A USER-DEFINED FUNCTION? ......................................................................... 15-4
CREATE A UDF.............................................................................................................. 15-5
DECLARE THE INTERFACE OF A UDF............................................................................. 15-6
SPECIFY THE CALCULATION FOR A UDF ....................................................................... 15-7
TEST A UDF .................................................................................................................. 15-8
INTERNAL AND EXTERNAL FUNCTIONS ......................................................................... 15-9
CREATE AN EXTERNAL UDF ....................................................................................... 15-10
DEMO 1: CREATE AND TEST AN INTERNAL UDF ......................................................... 15-11
DEMO 2: USE AN INTERNAL UDF IN A FACT BUILD .................................................... 15-14
USE UDF VARIABLES .................................................................................................. 15-18
BUILD AND JOBSTREAM VARIABLES ........................................................................... 15-19
DEMO 3: USE A VARIABLE IN A FACT BUILD ............................................................... 15-20
SUMMARY ................................................................................................................... 15-22
PROCESS UNBALANCED HIERARCHICAL DATA .............................................. 16-1
OBJECTIVES ................................................................................................................... 16-3
BALANCED, UNBALANCED, AND RAGGED HIERARCHIES ............................................... 16-4
EXAMINE PARENT-CHILD (RECURSIVE) RELATIONSHIPS............................................... 16-5
EXAMPLE OF A HIERARCHY FROM A RECURSIVE RELATIONSHIP ................................... 16-6
CREATE RECURSIVE LEVELS ......................................................................................... 16-7
DEMO 1: ADD A RECURSIVE LEVEL AND SUBLEVELS TO A HIERARCHY ........................ 16-8
EXAMINE UNBALANCED HIERARCHIES........................................................................ 16-13
BALANCE AN UNBALANCED HIERARCHY .................................................................... 16-14
LINK A NEW LEVEL TO AN UNBALANCED HIERARCHY ................................................ 16-15
EXAMINE RAGGED HIERARCHIES ................................................................................ 16-16
DELIVER FLATTENED HIERARCHICAL DATA ............................................................... 16-17
DEMO 2: BALANCE A HIERARCHY AND DELIVER FLATTENED DATA ........................... 16-18
EXAMINE CIRCULAR REFERENCES .............................................................................. 16-22
REVIEW: NO MODELING OF UNBALANCED DATA ........................................................ 16-23
REVIEW: DESIGN 1 - BALANCE ALL LEAF NODES ........................................................ 16-24
REVIEW: DESIGN 1 - HOW TO BALANCE LEAF NODES ................................................. 16-25
REVIEW: DESIGN 2 - BALANCE EVERY NODE .............................................................. 16-26
REVIEW: DESIGN 2 - HOW TO BALANCE EVERY NODE ................................................ 16-27
REVIEW: DESIGN 3 - LOWEST LEVEL, RETAIN NULL VALUES .................................... 16-28
REVIEW: DESIGN 3 - HOW TO DELIVER LOWEST LEVEL AND RETAIN NULL VALUES 16-29
OVERVIEW OF DEMOS 3 TO 6....................................................................................... 16-30
DEMO 3: CREATE AN AUTO-LEVEL HIERARCHY TO DETERMINE THE NUMBER OF
LEVELS ........................................................................................................................ 16-35
DEMO 4: CREATE A DIMENSION BUILD TO OUTPUT THE AUTO-LEVEL HIERARCHY
TO A STAGING TABLE .................................................................................................. 16-39
DEMO 5: MANUALLY CREATE AN UNBALANCED HIERARCHY..................................... 16-42
DEMO 6: MANUALLY CREATE A DIMENSION BUILD TO DELIVER AN UNBALANCED
HIERARCHY ................................................................................................................. 16-48
SUMMARY ................................................................................................................... 16-54

IP-10

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).

INSTRUCTOR

PREFACE

PIVOT FACT DATA...................................................................................................... 17-1


OBJECTIVES ................................................................................................................... 17-3
WHAT IS PIVOTING? ...................................................................................................... 17-4
RULES FOR PIVOTING .................................................................................................... 17-5
BASIC PIVOTING IN DATA MANAGER ............................................................................ 17-6
DEMO 1: PERFORM BASIC PIVOTING ............................................................................. 17-8
WHAT IF ONE PIVOT IS NOT ENOUGH?......................................................................... 17-16
EXAMINE THE DERIVATION TIMING MODEL ................................................................ 17-17
ADVANCED-PIVOT TECHNIQUE ................................................................................... 17-18
ADVANCED-PIVOT TECHNIQUE: MAPPING .................................................................. 17-19
DEMO 2: ADVANCED PIVOT TECHNIQUE ..................................................................... 17-20
REVERSE PIVOTING ..................................................................................................... 17-25
SUMMARY ................................................................................................................... 17-26
RESOLVE DATA QUALITY ISSUES......................................................................... 18-1
OBJECTIVES ................................................................................................................... 18-3
UNDERSTAND DATA QUALITY AND CLEANSING............................................................ 18-4
EVALUATE THE QUALITY OF INPUT DATA ..................................................................... 18-5
TRACK REJECTED ROWS ................................................................................................ 18-6
EXAMINE FOSTERING .................................................................................................... 18-7
EXAMINE UNMATCHED MEMBERS ................................................................................ 18-8
INCLUDE UNMATCHED MEMBERS IN THE DATA MART ................................................. 18-9
IDENTIFY HIERARCHIES WITH MULTIPLE PARENTS ..................................................... 18-10
ACCEPT MULTIPLE PARENTS ....................................................................................... 18-11
DEMO 1: INSPECT REJECTED DATA.............................................................................. 18-12
HANDLE FAILED ROWS IN A RELATIONAL TABLE DELIVERY ...................................... 18-16
USE SQLTERM FOR DEBUGGING ................................................................................. 18-17
USE FUNCTIONS FOR DEBUGGING ............................................................................... 18-18
EVALUATE THE QUALITY OF OUTPUT DATA ............................................................... 18-19
IDENTIFY OTHER DATA ISSUES.................................................................................... 18-20
DEMO 2: USE BUILT-IN FUNCTIONS TO DEBUG INPUT DATA ....................................... 18-21
SUMMARY ................................................................................................................... 18-24
TROUBLESHOOT AND TUNE THE DATA MANAGER ENVIRONMENT........ 19-1
OBJECTIVES ................................................................................................................... 19-3
USE TROUBLESHOOTING FILES ...................................................................................... 19-4
SPECIFY THE BUILD EXECUTION MODE ......................................................................... 19-5
EXAMINE MEMORY MANAGEMENT ............................................................................... 19-6
EXAMINE THE HASH TABLE ........................................................................................... 19-7
IDENTIFY MEMORY LIMITS ............................................................................................ 19-8
SET THE MEMORY LIMITS.............................................................................................. 19-9
DIMENSION BREAKING ................................................................................................ 19-10
SPECIFY WHEN TO BREAK ........................................................................................... 19-11
DEMO 1: PERFORM DIMENSION BREAKING, EXECUTE A BUILD IN CHECK ONLY
MODE, AND INSPECT THE LOG FILE ............................................................................. 19-12
FINE-TUNE YOUR TARGET TABLES ............................................................................. 19-17
DIMENSION CACHING .................................................................................................. 19-18
DIMENSION CACHING ON DEMAND ............................................................................. 19-19
SUMMARY ................................................................................................................... 19-20

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-11

IBM

COGNOS

BI

DATA

MANAGER:

BUILD

DATAMARTS

WITH

ENTERPRISE

DATA

(V8.4)

ORGANIZE AND PACKAGE DATA MANAGER COMPONENTS....................... 20-1


OBJECTIVES ................................................................................................................... 20-3
WHAT IS PACKAGING?................................................................................................... 20-4
PACKAGING CONCEPTS.................................................................................................. 20-5
EXPORT AND IMPORT COMPONENTS .............................................................................. 20-6
DEMO 1: EXPORT AND IMPORT COMPONENTS USING PACKAGES .................................. 20-7
WHAT IS NAVIGATOR? ................................................................................................ 20-10
DEMO 2: LOCATE A COMPONENT AND CHECK ITS DEPENDENCIES .............................. 20-11
SUMMARY ................................................................................................................... 20-14
INTEGRATE WITH IBM COGNOS 8 ........................................................................ 21-1
OBJECTIVES ................................................................................................................... 21-3
EXAMINE IBM COGNOS 8 BI ......................................................................................... 21-4
IDENTIFY THE STUDIOS IN IBM COGNOS 8 BI ............................................................... 21-5
CREATE DATA MANAGER METADATA FOR USE IN IBM COGNOS 8 BI.......................... 21-6
CREATE METADATA DIMENSIONS ................................................................................. 21-7
CREATE METADATA COLLECTIONS ............................................................................... 21-8
ADD STARS TO A METADATA COLLECTION ................................................................... 21-9
DEMO 1: CREATE METADATA DIMENSIONS AND A COLLECTION................................. 21-10
IMPORT DATA MANAGER METADATA INTO FRAMEWORK MANAGER ......................... 21-13
CREATE REPORTS IN IBM COGNOS 8 USING DATA MANAGER METADATA ................ 21-14
DEMO 2: USE DATA MANAGER METADATA IN IBM COGNOS 8 .................................. 21-15
EXECUTE BUILDS AND JOBSTREAMS USING THE DATA MOVEMENT
SERVICE\L2................................................................................................................. 21-23
PUBLISH A DATA MOVEMENT TASK ............................................................................ 21-24
DEMO 3: PUBLISH AND SCHEDULE A DATA MOVEMENT TASK .................................... 21-25
SUMMARY ................................................................................................................... 21-29
ENTITY-RELATIONSHIP MODEL OF THE GO_DEMO DATABASE .................A-1
WORK IN A MULTI-DEVELOPER ENVIRONMENT..............................................B-1
OBJECTIVES .....................................................................................................................B-3
CONSIDERATIONS FOR MULTI-DEVELOPER ENVIRONMENTS ...........................................B-4
SOURCE CODE CONTROL ARCHITECTURE .......................................................................B-5
MULTI-DEVELOPER COMMUNITY ....................................................................................B-6
COMPONENT DEPENDENCY MODEL .................................................................................B-7
GUIDELINES FOR PLANNING A PROJECT ...........................................................................B-8
SUMMARY .....................................................................................................................B-10
END-TO-END WORKSHOP (OPTIONAL) .................................................................C-1
STANDARDIZING DIMENSIONS AND FACTS EXERCISE (OPTIONAL) ..........D-1

IP-12

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).

INSTRUCTOR

PREFACE

REVIEW OF DATA MANAGER ESSENTIALS (OPTIONAL).................................E-1


OBJECTIVES ..................................................................................................................... E-3
DATA WAREHOUSE DESIGN ............................................................................................ E-4
DATA WAREHOUSE ARCHITECTURE ................................................................................ E-5
STAR SCHEMA DATA MARTS ........................................................................................... E-6
CONFORMED DIMENSIONS ............................................................................................... E-7
SURROGATE KEYS IN CONFORMED DIMENSIONS ............................................................. E-8
THE NINE DECISION POINTS (BY KIMBALL) .................................................................... E-9
DESIGN DOCUMENT 1: THE DIMENSION MAP ................................................................ E-10
DESIGN DOCUMENT 2: THE LOGICAL DATA MAP.......................................................... E-11
THE PURPOSE OF DATA MANAGER COMPONENTS ......................................................... E-12
DIMENSION BUILD ......................................................................................................... E-13
FACT BUILD ................................................................................................................... E-14
JOBSTREAM ................................................................................................................... E-17
DEVELOPMENT STEPS IN DATA MANAGER .................................................................... E-19
THE DATA MART DEVELOPMENT PROCESS: OVERVIEW................................................ E-20
CREATE CONFORMED DATA MARTS: OVERVIEW .......................................................... E-21
HIERARCHY COMPONENTS: OVERVIEW ......................................................................... E-23
MANUALLY CREATE A HIERARCHY: OVERVIEW ........................................................... E-24
2. CREATE A HIERARCHY AND SPECIFY FEATURES ........................................................ E-25
3. CREATE A TEMPLATE ................................................................................................. E-26
4. ADD A LEVEL AND SELECT ATTRIBUTES ................................................................... E-27
5. DEFINE DATA SOURCES FOR THE LEVEL .................................................................... E-28
6. MAP DATA SOURCE COLUMNS TO DATASTREAM ITEMS ........................................... E-29
7. MAP DATASTREAM ITEMS TO LEVEL ATTRIBUTES .................................................... E-30
8. EXPLORE THE HIERARCHY ......................................................................................... E-31
CREATE CONFORMED DATA MARTS: OVERVIEW .......................................................... E-32
2. DELIVER CONFORMED DIMENSIONS WITH DIMENSION BUILDS ................................. E-33
MANAGE TYPES 0, 1, AND 2 SCDS ................................................................................ E-34
IMPLEMENT DIMENSIONAL HISTORY ............................................................................. E-35
CREATE CONFORMED DATA MARTS: OVERVIEW .......................................................... E-36
3. DATA INTEGRITY LOOKUPS: OVERVIEW .................................................................... E-37
3. CREATE A DATA INTEGRITY LOOKUP ........................................................................ E-38
CREATE CONFORMED DATA MARTS: OVERVIEW .......................................................... E-39
4. REFERENCE A DATA INTEGRITY LOOKUP IN A FACT BUILD ....................................... E-40
EXAMINE THE DERIVATION TIMING MODEL .................................................................. E-41
CREATE A TRANSFORMATION MODEL DERIVATION ...................................................... E-42
PROCESS LATE ARRIVING FACTS: PREREQUISITES ........................................................ E-43
VARIOUS TOPICS ........................................................................................................... E-44
SQLTERM: LAYOUT AND USAGE .................................................................................. E-45
SUMMARY ..................................................................................................................... E-46

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-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:

Examine the Cognos approach to data warehousing and the role of


Data Manager

Create and administer catalogs

Connect to source and target data

Build and customize the dimensional framework

Create builds to deliver data to a data mart

Create conformed dimensions and manage dimensional history

Aggregate, merge, and partition fact data

Automate functionality using JobStreams and commands

Resolve common data quality issues

Create business intelligence from data mart data using Cognos 8

IP-14

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).

INSTRUCTOR

PREFACE

Course Prerequisites
Participants should have:

Experience using basic Windows functionality

Knowledge of database concepts

Knowledge of dimensional analysis concepts

Working knowledge of SQL

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-15

IBM

COGNOS

BI

DATA

MANAGER:

BUILD

DATAMARTS

WITH

ENTERPRISE

DATA

(V8.4)

Important Course Changes


New features for IBM Cognos 8 BI Data Manager: Build
Datamarts with Enterprise Data (v8.4)
General Changes

This is an updated edition of the Cognos 8 BI Data Manager:


Building Datamarts with Enterprise Data (version 8.3) course
manual. All of the content in this book has been revised to reflect the
features and functionality of Cognos 8 Data Manager 8.4. Screen
captures have been replaced, content has been modified, and
exercise scripts have been changed as necessary.

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.

Some of the module titles have been modified slightly to more


clearly indicate the content, and to incorporate the new product
naming conventions. For example, Module 21 is now entitled
"Integrate with IBM Cognos 8" (it used to be called "Report on Data
with Cognos 8").

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.

The dates in the databases have been changed to reflect more


recent values (e.g., the dm_fiscal table in the dm_ref database now
spans 2005 to 2007, instead of 2003 to 2005).

This course now includes a reference card.

The student data for this course includes a file called


GO_Logical_DataMap.xls. This file can be customized as
necessary. This file is an Excel spreadsheet that contains two tabs:
o

GO Dimension Map: outlines the dimensions that are used


by some of the fact tables that are created in this course

GO Logical Data Map: outlines some of the tables and


columns that are created by the builds in Data Manager
throughout the course, as well as their data types, usage,
and other characteristics.

Module 5, "Create Derivations"

IP-16

This module no longer covers derived dimensions. Derived


dimensions are covered in Module 9, "Transform Data Using
Lookups and Derived Dimensions."

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).

INSTRUCTOR

PREFACE

Module 6, "Create Conformed Dimensions"

In Demo 1, "Create Conformed Dimension Builds," the surrogate key


attribute in each dimension build template is renamed to be more
intuitive (e.g., from "skey" to "state_skey" in the template for the
D_LocationH dimension build). In addition, in Demo 3, "Create a
Fact Build that References Data Integrity Lookups," the dimension
element columns are renamed to match the related attributes in the
lookups (e.g., "period_no" is renamed to "period_skey"). This
naming convention is used throughout the manual where
appropriate.

Module 8, "Process Dimensional History and Late Arriving Facts"

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.

Module 9, "Transform Data Using Lookups and Derived Dimensions"

As noted earlier, the topic of "derived dimensions" is covered in this


module. This module also includes a new workshop. This workshop
shows how to use lookups and derived dimensions to create a fact
build that uses a query against a single table, instead of a query
against multiple tables (thereby avoiding numerous and
cumbersome joins in the data source).

Module 10, "Customize Data Delivery"

Demo 2, "Define Keys and Indexes on Fact and Dimension Tables,"


and Workshop 1, " Manually Create a Fact Build and Add a Fact
Delivery" use more realistic naming conventions for indexes. For
example, in Demo 2, the single-column indexes are called
"F_DemoFact_i1," "F_DemoFact_i2," and "F_DemoFact_i3," while
the unique composite index is called "F_DemoFact_ui1."

Module 11, "Customize Fact Data Processing"

Demo 2, "Merge Data," has been completely rewritten to use a new


data source. The data is reverse pivoted and merged to produce a
realistic result.

Module 12, "Aggregate, Filter, and Partition Fact Data"

Demo 1, "Aggregate Data," has been completely rewritten. This


demo shows how to use the Fact Build wizard to automatically
create aggregate tables.

Demo 4, "Partition Fact Data" has been completely rewritten. In this


demo, the students partition the data to push the columns relating to
an order's status into their own table, which will be linked to the
second fact table. The students add an "order closed date" column
to this partition by creating a derivation in the transformation model.

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-17

IBM

COGNOS

BI

DATA

MANAGER:

BUILD

DATAMARTS

WITH

ENTERPRISE

DATA

(V8.4)

Module 13, "Implement Job Control"

Page 13-17 is new. It discusses the new DataStage node that you
can add to a JobStream.

Module 16, "Process Unbalanced Hierarchical Data"

Demos 3 to 6 have been added to this module. These demos are


derived from the DecisionStream 7.2 course manual (released in
2003). These demos show an alternate way to deliver unbalanced
hierarchical data, in order to preserve null values.

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.

Module 19, "Troubleshoot and Tune the Data Manager Environment"

Demo 1, "Perform Dimension Breaking, Execute a Build in Check


Only Mode, and Inspect the Log File" has been rewritten. The
students are instructed to enable merging on the Sales fact build. In
addition, the students are shown how to modify the break processing
setting to produce more valid results in the log file.

Module 21, "Integrate with IBM Cognos 8"

This module includes new content and a demo on how to publish


and schedule a data movement task.

Appendix C, "End-to-End Workshop (Optional)"

This is a new workshop (with no solution script) that reviews key


concepts in the course.

Appendix D, "Standardizing Dimensions and Facts Exercise


(Optional)"

This is a new step-by-step exercise. This exercise is an example of


how you can use Data Manager to standardize source data.

Appendix E, "Review of Data Manager Essentials (Optional)"

IP-18

This new section contains slides that review (at a high level) the key
information in the course.

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).

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

identify the purpose of IBM Cognos


Data Manager

define data warehousing and its key


underlying concepts

identify how Data Manager creates


data warehouses

examine the Data Manager


architecture and user interface

Slides

Demos

Workshops

Est. Time

22

1 hr.

Slides

Demos

Workshops

Est. Time

17

1.5 hrs.

Module 2: Create a Catalog


Topics

examine the purpose and contents


of Data Manager catalogs

create a catalog

define connections to source and


target data

access data using SQLTerm

configure flat data source files using


SQLTXT

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-19

IBM

COGNOS

BI

DATA

MANAGER:

BUILD

DATAMARTS

WITH

ENTERPRISE

DATA

(V8.4)

Module 3: Create Hierarchies


Topics

examine the role of the dimensional


framework in Data Manager

examine hierarchies and their data


sources

identify how to create hierarchies


from the columns of one table, the
rows of one table, and from multiple
tables

test and view hierarchies

create a hierarchy of static date


values

handle weeks in a date hierarchy

Slides

Demos

Workshops

Est. Time

23

2 hrs.

Slides

Demos

Workshops

Est. Time

29

2 hrs.

Module 4: Create Basic Builds


Topics

examine Data Manager builds and


build-related terminology

create a dimension build using the


Dimension Build wizard

create a fact build using the Fact


Build wizard

test and execute a fact build

document a catalog

create catalog schema

IP-20

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).

INSTRUCTOR

PREFACE

Module 5: Create Derivations


Topics

examine derivations

apply operators and functions to


derivations

examine the derivation timing model

add derivations to a fact build

Slides

Demos

Workshops

Est. Time

15

0.5 hrs.

Slides

Demos

Workshops

Est. Time

29

2 hrs.

Module 6: Create Conformed Dimensions


Topics

examine conformed dimensions and


their advantages

design conformed dimensions

create conformed dimensions

create data integrity lookups that


use conformed dimensions

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-21

IBM

COGNOS

BI

DATA

MANAGER:

BUILD

DATAMARTS

WITH

ENTERPRISE

DATA

(V8.4)

Module 7: Customize Reference Structures


Topics

create hierarchies manually using


different approaches

examine the features of a hierarchy

examine literals

set data access for hierarchy levels

examine static and dynamic


members

examine fostering

use derivations in a hierarchy

Slides

Demos

Workshops

Est. Time

17

2 hrs.

Module 8: Process Dimensional History and Late Arriving Facts


Topics

examine slowly changing


dimensions (SCDs)

use surrogate keys in SCDs

manage type 1 and type 2 changes


to dimensional data

load historical data for a dimension

examine late arriving facts

process late arriving facts in a fact


build

Slides

Demos

Workshops

Est. Time

31

2 hrs.

Module 9: Transform Data Using Lookups and Derived Dimensions


Topics

identify when to use lookups

identify the requirements for a


lookup

create a translation lookup

create an optional lookup

add derived dimensions to fact


builds

IP-22

Slides

Demos

Workshops

Est. Time

13

1.5 hrs.

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).

INSTRUCTOR

PREFACE

Module 10: Customize Data Delivery


Topics

configure fact and dimension


delivery modules

create indexes on fact and


dimension tables

update fact data using keys

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.

Module 11: Customize Fact Data Processing


Topics

filter fact data

merge duplicate fact data

examine fact data integrity checking

reject fact data

Module 12: Aggregate, Filter, and Partition Fact Data


Topics

aggregate fact data

examine aggregate rules

vertically restrict fact data

horizontally restrict fact data

partition fact data

Module 13: Implement Job Control


Topics

examine where job control fits into


the data warehouse lifecycle

create a JobStream

add, link, and reposition nodes

execute a JobStream and view the


results

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-23

IBM

COGNOS

BI

DATA

MANAGER:

BUILD

DATAMARTS

WITH

ENTERPRISE

DATA

(V8.4)

Module 14: Automate Functionality Using Commands


Topics

differentiate between the Command


Line Interface (CLI) and Data
Manager Designer

identify common commands

use commands in a batch file

examine variables

Slides

Demos

Workshops

Est. Time

11

0.5 hrs.

Module 15: Customize Functionality with User-Defined Functions and Variables


Topics

examine user defined functions


(UDFs)

create an internal UDF

create a user-defined variable

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.

Module 16: Process Unbalanced Hierarchical Data


Topics

examine balanced, unbalanced, and


ragged hierarchies

add a recursive level to a hierarchy

identify ways to balance a hierarchy


and delivered flattened data

examine circular references

Module 17: Pivot Fact Data


Topics

examine pivoting

use the single pivot technique

use the advanced pivot technique

examine reverse pivoting

IP-24

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).

INSTRUCTOR

PREFACE

Module 18: Resolve Data Quality Issues


Topics

identify data quality and cleansing


issues

handle fostered and unmatched


members

perform debugging using SQLTerm


and functions

assess the quality of output data

Slides

Demos

Workshops

Est. Time

18

1 hr.

Module 19: Troubleshoot and Tune the Data Manager Environment


Topics

use build logging to ensure that data


marts are being loaded properly

perform dimension breaking

manage memory and resources

export DDL statements

Slides

Demos

Workshops

Est. Time

15

0.5 hrs.

Module 20: Organize and Package Data Manager Components


Topics

export and import components using


packages

search for components in a catalog


using Navigator

Slides

Demos

Workshops

Est. Time

0.5 hrs.

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-25

IBM

COGNOS

BI

DATA

MANAGER:

BUILD

DATAMARTS

WITH

ENTERPRISE

DATA

(V8.4)

Module 21: Integrate with IBM Cognos 8


Topics

examine IBM Cognos 8 BI

identify the role of metadata


dimensions, metadata collections,
and metadata stars

export Data Manager metadata to


XML

import Data Manager XML into


Framework Manager

use Data Manager metadata with


IBM Cognos 8

publish a data movement task to


IBM Cognos Connection

Slides

Demos

Workshops

Est. Time

16

1 hr.

Appendix A: Entity-Relationship Model of the GO_Demo Database (Optional)


Topics

a diagram showing the tables in the


GO_Demo database and the
relationships between the tables

Slides

Demos

Workshops

Est. Time

N/A

N/A

N/A

N/A

Appendix B: Work in a Multi-Developer Environment (Optional)


Topics

examine collaborative development


support

examine the source code repository

examine the component


dependency model

identify planning considerations

Slides

Demos

Workshops

Est. Time

0.5 hrs.

Slides

Demos

Workshops

Est. Time

N/A

N/A

N/A

4 hrs.

Appendix C: End-to-End Workshop (Optional)


Topics

IP-26

a workshop that reviews key


concepts in the course

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).

INSTRUCTOR

PREFACE

Appendix D: Standardizing Dimensions and Facts Exercise (Optional)


Topics

a step-by-step exercise that shows


an example of how to standardize
data using Data Manager

Slides

Demos

Workshops

Est. Time

N/A

N/A

N/A

0.5 hrs.

Appendix E: Review of Data Manager Essentials (Optional)


Topics

data warehouse design, as


propagated by Ralph Kimball

the purpose of Data Manager


components

development steps in Data Manager


to create data marts

track dimensional changes and late


arriving facts

Slides

Demos

Workshops

Est. Time

45

N/A

N/A

1.0 hrs.

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-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

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).

INSTRUCTOR

PREFACE

Instructor Data EXE


The Instructor Data EXE contains an executable (EXE) file that can install
any or all of the following files. By running the EXE on your computer and
following the prompts as the install runs, these files will be installed in
C:\Edcognos\B2480.
Instructor Slides
These files contain the Microsoft PowerPoint slide presentation for each
module of the course as presented in the Student Guide:

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

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-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)

PDF version of the Instructor Guide


These files are the Instructor Guide Microsoft Word documents in PDF.

IP-30

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).

INSTRUCTOR

PREFACE

Student Data

Backups folder

Source Code 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

Demos, Workshops, and Workshop Solutions


The course is designed to be easily customized for on-site training with
customer data. The files contain Microsoft Word files that you can use to
modify the demonstrations and workshops as required.

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-31

IBM

COGNOS

BI

DATA

MANAGER:

BUILD

DATAMARTS

WITH

ENTERPRISE

DATA

(V8.4)

General Setup and Instructor Preparation


Pre-Class Agenda
To ensure that the class runs smoothly, you should know the answers to the
following questions. If you need help in obtaining answers, contact the
customer or customer's sales representative (if the course is scheduled for a
client site), or the local office responsible for course logistics.

Who is the contact person for class setup?

What is the classroom setup? Is there a white board? Is there a flip


chart? Is there a computer for the instructor, a PC viewer, overhead
projector, and screen?

Will the physical environment be set up prior to your arrival (product


loaded and PowerPoint files on the computer)?

What time does the class start?

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?

What Cognos office is responsible for sending the Student Guides?

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:

Run through the VMware Image.

Run through at least one module in a classroom with a PC viewer.

Run through the full course at least once on a computer.

Make sure you complete each of the demos before teaching the
course so that you become familiar with each step required.

Have a set of product reference manuals in the classroom.

Make sure that there is a Student Guide for each participant.

IP-32

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).

INSTRUCTOR

PREFACE

Document Conventions
Conventions used in this guide follow Microsoft Windows application
standards, where applicable. As well, the following conventions are
observed:
Bold

Bold style is used in demo and workshop


step-by-step solutions to indicate a user
interface element that is actively selected or
text that must be typed by the participant.

Italic

Used to reference book titles.

CAPITALIZATION

All file names, table names, column names,


and folder names appear in this guide exactly
as they appear in the application.
To keep capitalization consistent with this
guide, type text exactly as shown.

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-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)

Advance to next slide

Left-click, Page Down, Space, N, Right or


Down Arrow, right-click/Next, Enter

Return to previous slide

Backspace, Page Up, P, Left or Up Arrow,


right-click/Previous

Change pointer to a pen

Right-click/Pen or Ctrl+P

Erase drawings on screen

Make the screen white

W or ',' (toggle to restore)

Make the screen black

B or '.' (toggle to restore)

Help

End the slide show

Esc, Ctrl+Break, '-'

Move between PowerPoint and


the product

Alt+Tab or click the application name on the


status bar

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

A page containing an animation slide (multiple clicks to complete the


slide) will also include an Instructor Guide note indicating the
number of clicks needed to complete the slide.

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).

INSTRUCTOR

PREFACE

VMware Keyboard Shortcuts


Below is a list of shortcuts that can be used when in a VM image.
Shortcut

Action

Ctrl-B

Power on.

Ctrl-E

Power off.

Ctrl-R

Reset the power.

Ctrl-Z

Suspend.

Ctrl-N

Create a new virtual machine.

Ctrl-O

Open a virtual machine.

Ctrl-F4

Close the summary/console view for the selected virtual machine.


A confirmation dialog appears only if the virtual machine is powered on.

Ctrl-D

Edit the virtual machine's configuration.

Ctrl-G

Grab input from keyboard and mouse.

Ctrl-P

Edit preferences.

Ctrl-AltEnter

Go to full screen mode.

Ctrl-Alt

Return to normal (windowed) mode.

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.

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-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

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).

INSTRUCTOR

PREFACE

Get the Class Started


Welcome participants to the course. Use the slide show,
STARTB2480.PPT, to introduce yourself, the participants, and the agenda
for the training (optional).
Instructor Introduction
IBM Cognos 8 BI Data Manager: Build
Datamarts with Enterprise Data (v8.4)
Instructor Name
Instructor Background

Student Introductions
Name
Company
Position
Product Experience

Use this slide to welcome the participants to the


course, to introduce yourself, and to mention your
background (for example, how long you have been
teaching the course, your teaching experience overall,
how long you have been working with the product, and
so on). Make sure you have customized the slide
ahead of time.

Have the participants take turns introducing


themselves with respect to the items listed on this
slide. The intent of the slide is to act as an icebreaker
and to encourage participation.

Personal objective(s) for


this course

Administrative Items

Use this slide to go through the list of administrative


items that participants often ask about.

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

Use this slide to explain the class format and


emphasize that participants are encouraged to actively
perform the hands-on demos while following along with
the instructor. Mention that the Student Guide contains
copies of the slides and further supporting notes for
the participants to use as reference material in the
future.

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-37

IBM

COGNOS

BI

DATA

MANAGER:

BUILD

DATAMARTS

WITH

ENTERPRISE

DATA

(V8.4)

Post-Class Agenda

Have participants complete the Course Evaluation forms.

Hand out certificates.

Leave the classroom clean.

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.

Complete the Instructor Feedback form, and return it to the


Education Coordinator. Ensure that the Coordinator receives the
Course Evaluation forms.

If you are at a customer site, thank the course administrator by


letter.

List any outstanding questions, and ensure that participants receive


answers in writing.

Report any sales leads to your sales representative.

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

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).

INSTRUCTOR

PREFACE

Submit Feedback and Locate Additional Product


Information
Submit Feedback
Instructional Designers from the Cognos Education Development team
designed these course materials.
Your feedback is important and valuable. We are interested in your
comments or questions. If you have feedback for a course, you may directly
submit it to our online database using the following link: http://ges/gesfeedback. The link to this feedback database can also be found in the
Instructor Support community on myCognos.
You may also send general comments or concerns to Global Education
Services at Cognos.GES@ca.ibm.com.
In the Instructor Support Community on myCognos, your suggested course
corrections and course-related supplementary information (e.g. additional
demos you use, diagrams you created) will be posted under Course
Updates, and teaching tips and techniques will be posted under Instructor
Tips. This gives other instructors worldwide, immediate use of the
information. Instructional designers will also use this information when the
course is updated. Access the Instructor Support Community at
http://myCognos. You will also find additional course information (for
example, course release status or course development templates) in the
Instructor Support Community, which you may find useful when preparing
for courses.
Suggestions for significant course enhancements will be reviewed for
possible implementation in future course updates.

Additional Product Information


You can research product information including issues, and advanced
functionality using the Knowledge Base. Access the Knowledge Base
through the Web at http://trakweb. If you do not already have a user name
and password to access the Knowledge Base, you can send an email
request to trakker.development@cognos.com.
You can also search the Customer Support Web site at
www.cognos.com/support, for further product information. To obtain a user
name and password, send an email request to
webmaster.support@cognos.com.
Tip: To determine if you already have a user name and password for the
Customer Support Web site, visit http://support.cognos.com/support/.

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-39

IBM

COGNOS

BI

DATA

MANAGER:

BUILD

DATAMARTS

WITH

ENTERPRISE

DATA

(V8.4)

Cognos Product Help


Help type

When to use

Location

Taskoriented

You are working in the product and you need


specific task-oriented help.

Cognos Product - Help link

Books for
Printing
(.pdf)

You want to use search engines to find


information. You can then print out selected pages,
a section, or the whole book.

Start/Programs/Cognos
Product/Documentation

Use Step-by-Step online books (.pdf) if you want to


know how to complete a task but prefer to read
about it in a book.
The Step-by-Step online books contain the same
information as the online help, but the method of
presentation is different.
Cognos on
the Web

IP-40

You want to access any of the following:

Services and Training Web site

http://support.cognos.com

Online support

http://support.cognos.com

Cognos Web site

http://www.cognos.com

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

Setup Instructions

IBM Cognos 8 BI

2008 IBM Corporation

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

SI-2

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).

SETUP

INSTRUCTIONS

Important Setup Instructions for This Course


Instructor and Student Computer Checklist
Use the following checklist when configuring both the instructor and student
computers. The total time to set up the instructor computer is 84 minutes,
and the total time to set up a student computer is 84 minutes.
Setup

Est. Time (per


computer)

Install student data to the default location (C:\Edcognos\B2480)

1 min

Install Microsoft SQL Server 2000. See steps on page SI-4.

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

Perform a default installation of IBM Cognos 8 Data Manager 8.4. Install


8.4.27.78_GA.

5 mins.

Perform a default installation of IBM Cognos 8 BI Modeling 8.4, IBM


Cognos 8 BI Server 8.4, and IBM Cognos 8 BI Samples 8.4. Install
version 8.4.27.78_GA. Note: Do not set up the database and do not
configure IBM Cognos 8.

15 mins.

Configure Data Manager. See steps on page SI-9.

10 mins

Create the IBM Cognos 8 content store and restore SQL Server
databases. See steps on page SI-11.

5 mins

Set up Web aliases. See steps on page SI-13.

2 mins

Configure IBM Cognos 8. See steps on page SI-14.

5 mins

Create a user in a third-party authentication provider. See steps on page


SI-16.

1 mins

Set up IBM Cognos 8 samples. See steps on page SI-17.

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

Install presentation files on the instructor computer. For a list of files, in


the Instructor Preface see the Instructor EXE section.

1 min

Customize the introductory slide in StartB2480.ppt (optional).

1 min

TOTAL SETUP TIME

Complete

84 minutes

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-3

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Install Microsoft SQL Server 2000


Use these instructions as a guide to install the SQL Server component. Ensure
that you are logged onto the machine with a valid account, which is the account
that will be used to administer the machine.
Note: If SQL Server 2000 is already installed, go to the section Ensure you
have the right patches for SQL Server.
1.
2.
3.
4.

Start the install.


Click SQL Server 2000 Components.
Click Install Database Server.
Click Next.

5. Click Local Computer, and then click Next.

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

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).

SETUP

INSTRUCTIONS

8. Accept the License Agreement.


9. Enter the 25-digit CD Key.

10. Click Server and Client Tools, and then click Next.
11. Select Default as the Instance Name, and then click Next.

12. Select a Setup Type of Typical, and then click Next.

13. For Services Accounts, click Use the Local System account.

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-5

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

14. Click Next.

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

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).

SETUP

INSTRUCTIONS

Install Microsoft SQL Server 2000 SP4


Use these instructions as a guide to install the SQL Server Service Pack 4. Ensure
that you are logged onto the machine with a valid account, which is the account that
will be used to administer the machine.
Download SQL2000-KB884525-SP4-x86-ENU.EXE from the following
location:
http://www.microsoft.com/downloads/details.aspx?familyid=8E2DFC8D-C20E4446-99A9-B7F0213F8BC5&displaylang=en
1. Double-click SQL2000-KB884525-SP4-x86-ENU.EXE.
2. Click Next on the Location to Save Files page (accept the default of
C:\SQL2KSP4).
3. Click Finish and then navigate to C:\SQL2KSP4.
4. Double-click setup.bat.
5. Click Next on the Welcome page, click Yes on the Software Agreement
License page, and then click Next on the Instance Name page.
6. On the page Connect to server, select The SQL Server system
administrator login information (SQL Server authentication).
7. Enter the Education1! password in the textbox, and then click Next to
continue.
8. On the Error reporting page, click OK.
9. On the Start Copying Files page, click Next.
10. Click OK on the Setup message indicating you should backup your
databases now.
11. On the Setup Complete page, click Finish.

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-7

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Ensure that you have Internet Information


Services Installed
1. Open the Control Panel, and then double-click Add or Remove
Programs.
2. Click Add/Remove Windows Components.
3. Ensure the Internet Information Services (IIS) check box is selected.
4. Highlight Internet Information Services (IIS), and then click Details.
5. Ensure all of the check boxes for the subcomponents are selected.
If any of the check boxes are grayed out, highlight the subcomponent, click
Details, and then select all of the check boxes.
6. When you are finished, click OK to close all of the dialog boxes, and then
close the Control Panel.

SI-8

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).

SETUP

INSTRUCTIONS

Configure Data Manager


1. Open Data Manager.
2. From the Tools menu, click ODBC Administrator.
3. Click the System DSN tab, and then add the following data source names
(DSNs) using the Microsoft Access Driver (*.mdb), if they do not already
exist:
DS_Advanced points to C:\Program
Files\cognos\c8\webcontent\samples\DataManager\MSAccess\DS_Adv
anced.mdb
DS_Advanced_out points to C:\Program
Files\cognos\c8\webcontent\samples\DataManager\MSAccess\DS_Adv
anced_out.mdb
DS_Marts points to C:\Program
Files\cognos\c8\webcontent\samples\DataManager\MSAccess\DS_Mar
ts.mdb
GOSales points to C:\Program
Files\cognos\c8\webcontent\samples\DataManager\db\GOSales.mdb
GOVendors points to C:\Program
Files\cognos\c8\webcontent\samples\DataManager\db\GOVendors.md
b
GOMarket points to points to C:\Program
Files\cognos\c8\webcontent\samples\DataManager\db\MarketResearch.
mdb
4. Close ODBC Administrator.
5. From the Tools menu, click Options.
6. Ensure that the Show the welcome screen when the application starts,
the Show transformation model elements in the visualization by
default, and the Show build details in the visualization by default
check boxes are selected, and then click OK.
7. From the File menu, click Open Catalog.
8. In the left pane, ensure that ODBC is selected, in the Data Source Name
list, click DS_Advanced, and then click OK.
9. In the left pane, right-click DerivedDimensionsExample, and then click
Duplicate.
10. Right-click DerivedDimensionsExample:1, and then click Properties.
11. In the Name and Business name boxes, type ProductSales, and then click
OK.
12. Expand the ProductSales fact build and Transformation Model.
13. Right-click UOM, click Delete, and then click Yes.
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-9

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

14. Right-click TOTAL_UNITS_SOLD, click Delete, and then click Yes.


15. Under the ProductSales fact build, expand Delivery Modules and Fact
Delivery, right-click F_DerivedDimensionExample, and then click
Properties.
16. In the Name and Business name boxes, type F_ProductSales, and then
click the Table Properties tab.
17. In the Table name box, delete the text, and then type ProductSales.
18. Click OK, and then on the toolbar, click Save.
19. Expand the Connections folder.
20. Right-click DS_Advanced_out, and then click Properties.
21. Click the Connection Details tab, and then in the Data Source Name list,
ensure that DS_Advanced_out is selected.
22. Click Test Connection to validate the connection, click OK when the
connection is validated, and then click OK to close the Connection
Properties dialog box.
23. Repeat steps 20 to 22 to verify the other data source connections as follows:
DS_Marts: points to DS_Marts
GO_Sales: points to GOSales
GO_Vendors: points to GOVendors
MarketResearch: points to GOMarket
24. On the toolbar, click Save.
25. In the tree, expand the JobSequence folder, click JobSequence, and then
on the toolbar, click Execute.
A command window opens and the JobStream executes.
26. Press Enter to close the command window.
27. In the tree, click DerivedDimensionsExample, and then on the toolbar,
click Execute.
A command window opens and the build executes.
28. Press Enter to close the command window.
29. Close Data Manager.

SI-10

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).

SETUP

INSTRUCTIONS

Create the IBM Cognos 8 Content Store and


Restore SQL Server Databases
1. Open Windows Explorer, and then navigate to C:\Program
Files\cognos\c8\webcontent\samples\datasources\sqlserver.
2. Extract GOSALES.zip and GOSALESDW.zip to add the Gosales and
Gosalesdw files to the C:\Program Files\cognos\c8\
webcontent\samples\datasources\sqlserver folder.
3. From the Start menu, point to All Programs, Microsoft SQL Server, and
then click Enterprise Manager.
2. Expand Microsoft SQL Servers and SQL Server Group.
3. Expand <servername>, and then expand Databases.
4. Right-click Databases, and then click New Database.
The Database Properties dialog box appears.
5. In the Name box, type cm.
6. In the Collation name list, select Latin1_General_CI_AS, and then click
OK.
7. Right-click Databases, point to All Tasks, and then click Restore
Database.
8. In the Restore as database box, type dm_additional, and then select the
From device button.
9. Click Select Devices, and then click Add.
10. Click the browse button, navigate to C:\Edcognos\B2480, and then click
the dm_additional file.
11. Click OK, and then click OK again.
12. Click OK, and then click OK to close the Restore database dialog box.
13. Repeat steps 7 to 12 to create the following databases (all of the database
files are in the C:\Edcognos\B2480 folder):
dm_out
dm_ref
dm_sales
dm_stock
DWH
GO_Catalog
GO_Demo
GO_Target
GOSL

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-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

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).

SETUP

INSTRUCTIONS

Set up Web Aliases


Task 1. Set up a virtual directory for IBM Cognos 8.
1. From the Start menu, click Control Panel, open Administrative Tools,
and then open Internet Information Services.
2. In Internet Information Services, expand <servername>, and then expand
Web Sites.
3. Expand Default Web Site, rightclick Default Web Site, point to New,
and then click Virtual Directory.
The Virtual Directory Creation wizard appears.
4. Click Next.
5. Under Alias, type cognos8, and then click Next.
6. Browse to <IBM Cognos 8 install location>:\Program Files\
cognos\c8\webcontent, click OK, and then click Next.
7. Clear the Run scripts check box, so that only Read is selected, and then
click Next.
8. Click Finish.
Task 2. Set up a virtual directory for cgibin.
1. Right-click the cognos8 virtual directory folder, point to New, and then
click Virtual Directory.
The Virtual Directory Creation wizard appears.
2. Click Next.
3. Under Alias, type cgi-bin, and then click Next.
4. Browse to <IBM Cognos 8 install location>:\Program
Files\cognos\c8\cgibin, click OK, and then click Next.
5. Select the Execute check box, deselect the Read and Run scripts check
boxes, and then click Next.
6. Click Finish.
7. Close Internet Information Services.

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-13

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Configure IBM Cognos 8


Task 1. Configure the NTLM provider.
1. From the Start menu, point to All Programs, IBM Cognos 8, and then
click IBM Cognos Configuration.
2. In the Explorer pane of IBM Cognos Configuration, right-click
Authentication, point to New resource, and then click Namespace.
3. In the New Namespace dialog box, under Name, type Local NT, and then
from the drop-down list under Type, click NTLM.
4. Click OK.
5. Click the cell in the Namespace ID row and the Value column, and type
Local NT ID, and then press Enter.
The results appear as shown below:

6. In the Explorer pane under Authentication, click Cognos.


7. To the right of Allow anonymous access, in the Value column, click True,
and then click False to change the setting.
With Anonymous access now set to False, students will need to log in to
IBM Cognos Connection and provide a user name and password.
8. Leave IBM Cognos Configuration open.

SI-14

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).

SETUP

INSTRUCTIONS

Task 2. Configure the IBM Cognos 8 components.


1. In IBM Cognos Configuration, expand Content Manager (if necessary),
and then click Content Store.
Because we are using SQL Server as our database (not DB2), we will need
to delete and recreate the Content Store entry so that it refers to a SQL
Server database.
2. In the Explorer pane, right-click the Content Store row, click Delete, and
then click Yes to confirm the deletion.
3. In the Explorer pane, right-click Content Manager, point to New
resource, and then click Database.
4. In the Name box, type Content Store, in the Type list, select Microsoft
SQL Server database, and then click OK.
5. In the Database server with port number or instance name row, type
localhost:1433 (if necessary).
6. Click the User ID and password row, and then click the Edit button.
The Value - User ID and password dialog box appears.
7. In the Password field and the Confirm password field, type Education1!,
and then click OK.
8. In the Database name box, type cm, and then press Enter.
The result appears as shown below:

9. Right-click Content Store, and then click Test.


10. Click Close when the test is complete.
11. Click Save configuration

to save the new configuration.

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)

Create a User in a Third-party Authentication


Provider
1. From the Start menu, click Control Panel, and then double-click
Administrative Tools.
2. Double-click Computer Management.
3. Expand Local Users and Groups.
4. Right-click Users, and then click New User.
5. In the User name box, type admin, in the Full Name box, type Admin
Person, and then in the Password and Confirm password boxes, type
Education1!.
6. Clear the User must change password at next logon check box, select
the Password never expires check box, and then click Create.
7. Click Close to close the dialog box.
8. In the left pane, click Users to ensure that the user has been added.
9. Close Computer Management.
10. Open Internet Explorer, in the Address box, type
http://localhost/cognos8, and then press Enter.
11. In the User ID box, type admin, in the Password box, type Education1!,
and then click OK.
The Welcome page opens.
12. Click the My home link.
The Public Folders tab in Cognos Connection is displayed.
13. Close Internet Explorer.

SI-16

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).

SETUP

INSTRUCTIONS

Set Up IBM Cognos 8 Samples


Task 1. Import sample reports.
1. In Windows Explorer, navigate to C:\Program Files\cognos\c8\
webcontent\samples\content, and then copy all of the .zip files in this
folder.
2. Navigate to C:\Program Files\cognos\c8\deployment, and then paste
the .zip files to this folder.
3. Open Internet Explorer, and then navigate to http://localhost/cognos8.
4. In the User ID box, type admin, in the Password box, type Education1!,
and then click OK.
5. Click the Administer IBM Cognos content link, click the Configuration
tab, and then in the left pane, click Content Administration.
6. Click New Import
and then click Next.

, ensure that the Cognos Audit button is selected,

7. Click Next, select the Samples folder, and then click Next.
8. Ensure that the options appear as shown below:

9. Click Next, and then click Next again.


10. Click Finish, click Run, and then click OK.
11. Repeat steps 6 to 10 to import the remaining deployment archives.
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-17

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Task 2. Create data source connections.


1. In the left pane, click Data Source Connections.
2. Click New Data Source

3. In the Name box, type great_outdoors_sales, and then click Next.


4. In the Type list, select Microsoft SQL Server (OLE DB), and then click
Next.
5. In the Server name box, type localhost, and then in the Database name
box, type GOSALES.
6. Ensure that the Signons button is selected, and then select the Password
and Create a signon that the Everyone group can use check boxes.
7. In the User ID box, type sa, and then in the Password and Confirm
password boxes, type Education1!.
8. Click Test the connection, and then click Test.
The connection is tested successfully.
9. Click Close, and then click Close again.
10. Click Finish, and then click OK.
11. Repeat steps 3 to 11 to create a second data source called
great_outdoors_warehouse. This data source will point to the
GOSALESDW database.
12. Close Internet Explorer.

SI-18

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).

SETUP

INSTRUCTIONS

Ensure that Simple File Sharing is Off


1. In Control Panel, click Folder Options.
2. Ensure the View tab is selected, and then deselect the Use Simple File
Sharing (recommended) check box.

Instructional Tips
Note: Use Simple File Sharing
(recommended) may already be
deselected.

3. Click OK.
4. Close Control Panel.

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-19

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Stop the Default SMTP Virtual Server


1. From the Start menu, right-click My Computer, and then click Manage.
The Computer Management dialog box opens.

Instructional Tips
Note: the Default SMTP Virtual
Server might already be stopped.

2. Expand Services and Applications, expand Internet Information


Services.
3. Right click Default SMTP Virtual Server and click Stop.
4. Close Computer Management.

SI-20

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).

Introduction

IBM Cognos 8 BI

2008 IBM Corporation

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Intro-2

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).

INTRODUCTION

Objectives
In this course, we will:
examine dimensional modeling with Data Manager
develop a Data Manager catalog

create the dimensional framework


enhance the dimensional framework
use fact and dimension builds to populate a data mart
automate Data Manager functionality

2008, Cognos ULC (formerly Cognos Incorporated)


Cognos Confidential. For internal use only.

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

2008 IBM Corporation

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.
Audience:

Developers

Required prerequisites:

experience using basic Windows functionality

knowledge of database concepts

knowledge of dimensional analysis concepts

working knowledge of SQL

Intro-4

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).

INTRODUCTION

Process Dimensional History and Late Arriving Facts


Transform Data using Lookups and Derived Dimensions
Customize Data Delivery
Customize Fact Data Processing
Aggregate, Filter, and Partition Fact Data
Implement Job Control
Automate Functionality Using Commands

2008 IBM Corporation

2008, Cognos ULC (formerly Cognos Incorporated)


Cognos Confidential. For internal use only.

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)

Customize Functionality with User-Defined


Functions and Variables
Process Unbalanced Hierarchical Data
Pivot Fact Data
Resolve Data Quality Issues
Troubleshoot and Tune the Data Manager
Environment
Organize and Package Data Manager Components

2008 IBM Corporation

Intro-6

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).

INTRODUCTION

Integrate with IBM Cognos 8


Entity-Relationship Model of the GO_Demo
Database (Optional)
Work in a Multi-Developer Environment (Optional)
End-to-End Workshop (Optional)
Standardizing Dimensions and Facts Exercise
(Optional)
Review of Data Manager Essentials (Optional)

2008 IBM Corporation

2008, Cognos ULC (formerly Cognos Incorporated)


Cognos Confidential. For internal use only.

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:

creating and administering catalogs

connecting to source and target data

creating and enhancing dimensional frameworks that reflect the


dimensional structure of the business

transforming and delivering source data to data marts using fact


and dimension builds

automating functionality using JobStreams

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

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).

INTRODUCTION

Additional Training
After completing this course, please visit
http://support.cognos.com/training to find more information about:

additional training to enhance your knowledge and skills with IBM


Cognos products

the IBM Cognos Certification program which:


recognizes individuals who have obtained superior knowledge and skills

with IBM Cognos products

provides the flexibility to certify in a chosen area of expertise

2008, Cognos ULC (formerly Cognos Incorporated)


Cognos Confidential. For internal use only.

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

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).

Getting Started

IBM Cognos 8 BI

2008 IBM Corporation

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA

1-2

(V8.4)

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).

GETTING

STARTED

Objectives
In this module, we will:

identify the purpose of IBM Cognos Data Manager

define data warehousing and its key underlying concepts

identify how Data Manager creates data warehouses

examine the Data Manager architecture and user interface

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).

1-3

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA

(V8.4)

What is Data Manager?

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)

merges and transforms the data to facilitate enterprise-wide reporting,


analysis, and performance management

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

uses an innovative dimensional reference model (the dimensional


framework) to manage coordinated data marts across many different
platforms

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).

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).

GETTING

STARTED

What is a Data Warehouse?


A data warehouse is a collection of related data marts.

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:

facilitate reporting and analysis

maintain an organizations historical information

provide an integrated view of the enterprise, across many subject areas

be implemented in phases, delivering business value at each stage

allow changes in both source data and reporting requirements to be


implemented easily

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).

1-5

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA

(V8.4)

Data Warehouse Architecture

Data warehouse architecture comprises a number of elements:


1.

operational source systems

2.

a data staging area

3.

one or more conformed data marts

4.

a data warehouse database

3
2

HR
Sales
Production

A data warehouse consists of a number of elements:

1-6

Operational source systems (also known as online transactional processing


or OLTP) are developed to capture and process original business
transactions. These systems are designed for data entry, not reporting, but it
is from operational source systems that tools such as IBM Cognos Data
Manager get the data they need to construct the data warehouse.

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.

A data mart is a logical subset of an enterprise-wide data warehouse. It is


more efficient to build a data warehouse iteratively by creating integrated
data marts than by constructing the entire warehouse at once. 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.

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.

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).

GETTING

STARTED

Star Schema Data Marts

The data marts that make up a data warehouse usually have a star
structure that consists of dimension tables and fact tables:
1.

dimension tables contain textual descriptions of business


components

2.

fact tables contain measures (numeric data) and foreign keys


to the dimension tables
1

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.

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).

1-7

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA

(V8.4)

The IBM Cognos Approach to Data Warehousing


Provide rapid return on investment (ROI).
Start with a business focus, not a data focus.
Be analysis-oriented (to facilitate the decision-making process) as
opposed to database-oriented.
It is necessary to get input from all users at all stages of the design
and development process.
Design (Requirements Gathering) Phase
User Community

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

Cognos, an IBM company, recommends an information-centric, instead of a


technological, approach to building a data warehouse. The data warehouse should
be derived from the users reporting and analysis needs, as opposed to
Information Technologys understanding of the existing operational databases.
Using a technological approach takes too long and results in data warehouses that
are overly complex and underutilized. The result is a poor ROI.
The users input into the requirements of the data warehouse is critical. User
requirements dictate how changing dimensions are handled, how data is
summarized, the hierarchical structure of the data in the dimension tables, and so
on. It is important to maintain contact with the users during the more technical
phase of the project (for example, when cleansing data prior to loading it into the
data warehouse).

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

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).

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

Aggregating across locations

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.

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).

1-9

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA

(V8.4)

Conformed (Shared) Dimensions


Conformed dimensions are dimensions that are used with more than
one fact table.
A conformed dimension is re-usable and identical in every data mart
in which it is used.
Dimensions

Sales
Distr.
Mkting
HR

XXXX
X
X
X X
XX
X X
X
X
X

The Sales Data


Mart

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

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).

GETTING

STARTED

Data Mart Versus Data Warehouse


IBM Cognos recommends building data marts incrementally and
combining them into a data warehouse, instead of building a single
comprehensive data warehouse and extracting data marts.
Global Data Warehouse

Sales Data Mart


Branches

Sales

Products

HR

Customer

Sales
Fact

Channels

Time

Inventory

Building a single data warehouse:

is complex and intellectually challenging

takes too long before results are available

is difficult to maintain

is costly with slow return on investment

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.

On the other hand, integrated data marts:

can be implemented in manageable proportions

make decentralized, incremental development possible

provide rapid deployment and return on investment

are easier to change and more flexible

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).

1-11

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA

(V8.4)

Data Mart Versus OLTP System


Orders OLTP System
Product
Line

Customer
Type

Sales Area

Product
Type

Customer

Sales Rep

Product

Order
Header

Bulk writing at intervals


Redundancy is no problem
Queries are fast

Orders Data Mart


SalesStaff

Products
Order
Fact

Customer

Time

Order
Line

Frequent or constant writing


Avoid redundancy
Complex queries are slow

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

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).

GETTING

STARTED

Data Manager Installation Components


Single-/Multi-Server
Installation possible

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).

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).

1-13

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA

(V8.4)

Data Manager Capabilities


Design
Connections
Input Connections

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

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).

GETTING

STARTED

Data Manager Capabilities (cont'd)


Document
Whole catalog content
Usage summary
As Web page (*.htm)
Backup / Restore
Whole catalog content
As text file (*.ctg)
DM - Catalog

Create / Restore Package


Partial content of catalog
As text file (*.pkg)
Can run independently

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:

move components between catalogs

combine the efforts of several developers

distribute catalogs or components

partially backup and restore a catalog

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).

1-15

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA

(V8.4)

The Role of Data Manager in IBM Cognos 8 BI

OLAP Modeling

Design
Publish

Reporting & Analysis


ETL
Design

Event Management
Metadata Modeling

Author (QS/AS/RS/ES)

Execute

Design (Relational)

Execute, View (CV)

Automate

Publish (Rel., OLAP)

Schedule

IBM Cognos 8 BI is a complete enterprise business intelligence software solution


with integrated reporting, analysis, scorecarding, and event management capabilities.
To use Data Manager metadata in IBM Cognos 8 studios, you must create and
publish a package from Framework Manager or Transformer.
You can then access the package from IBM Cognos Connection, the Web portal
for IBM Cognos 8.

1-16

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).

GETTING

STARTED

Data Sources

Servers Gateway Front Ends

IBM Cognos 8 Architecture


DM - Designer

FM

Tr

CV/QS/AS/RS ... /Admin

Frmwrk.
Manager

Web-Server / C8-Gateway

DM - Engine

Tr

DM - Catalog

C8-Server

C8 - Content Store

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).

1-17

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA

(V8.4)

Multi-Developer Community
Local DM Catalog

Optional: SCCS Repository

Local DM Catalog

(such as Visual SourceSafe)

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

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).

GETTING

STARTED

Data Manager Automation & Install Options


Remote Start

Start Data Movement Job

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

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).

1-19

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA

(V8.4)

Maintain Conformed Data Marts

To maintain conformed data marts:


1.

Deliver dimension tables using dimension builds.

2.

Deliver fact tables using fact builds.

3.

Enable automation and job control using JobStreams.

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

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).

GETTING

STARTED

The Data Mart Development Process: Overview

Perform business analysis and design the data marts:


(dimension and fact tables).

In Data Manager, perform the following steps:


1.

Create connections to source, target, and catalog databases.

2.

Create a Data Manager catalog.

3.

Insert connections to source and target databases.

4.

Create dimensions and hierarchies and explore them.

5.

Create dimension builds.

6.

Create fact builds.

7.

Create JobStreams.

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).

1-21

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA

(V8.4)

Demo 1
Explore the Data
Manager Interface

1-22

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).

GETTING

STARTED

Demo 1: Explore the Data Manager Interface


Purpose:
You want to examine an existing catalog, as well as become
familiar with the Help files and the Data Manager and SQLTerm
interfaces.
Task 1. Start Data Manager, open a catalog, and then look
at Help.
1. From the Start menu, point to All Programs\IBM Cognos 8, and then
click Data Manager.
The Welcome dialog box appears.
2. Click Open an existing catalog.
The Open Catalog dialog box appears.
3. In the left pane, click ODBC, in the Data Source Name list, click
DS_Advanced (if necessary), and then click OK.
The result appears as shown below:

4. From the Help menu, click Contents and Index.


The Data Manager User Guide appears. From here you can browse the
various help topics, as well as search for specific information.
5. Close the browser window.
Task 2. Explore the catalog and Data Manager Designer
interface.

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. In the tree, click the plus sign (+) to expand Connections.


There are connections to several data sources in this catalog.
2. Click the plus sign (+) to expand Dimensions.
There are six dimensions in this catalog.

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).

1-23

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA

(V8.4)

3. Click the plus sign (+) to expand the Staff dimension.


There are three hierarchies, a lookup, and a folder called Templates
associated with this dimension.
4. Click the plus sign (+) to expand the Staff hierarchy.
There are five levels in this hierarchy.
5. Click the plus sign (+) to expand the Staff level.
6. Click the plus sign (+) to expand the DataStream, and then double-click
the Staff data source.
The Data Source Properties window opens.
7. Click the Query tab.
You can see the SQL statement that is used to retrieve the data from the
data source.
8. Click Cancel to close the Data Source Properties window.
9. Click the plus sign (+) to expand the JobSequence user-defined folder.
This user-defined folder contains one fact build, four dimension builds, and
two JobStreams.
10. Click the Fact Build

tab at the bottom of the Tree pane.

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

tab at the bottom of the Tree pane.

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

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).

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.

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).

1-25

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA

(V8.4)

Summary
In this module, we have:

1-26

identified the purpose of IBM Cognos Data Manager

defined data warehousing and its key underlying concepts

identified how Data Manager creates data warehouses

examined the Data Manager architecture and user interface

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).

Create a Catalog

IBM Cognos 8 BI

2008 IBM Corporation

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

2-2

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).

CREATE

CATALOG

Objectives
In this module, we will:

examine the purpose and contents of Data Manager catalogs

create a catalog

define connections to source and target data

access data using SQLTerm

configure flat data source files using SQLTXT

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-3

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

The Data Mart Development Process:


Overview
1. Create connections to source, target, and catalog
databases.
2. Create a Data Manager catalog.
3. Insert connections to source and target databases.
4. Create dimensions and hierarchies and explore them.
5. Create dimension builds.
6. Create fact builds.
7. Create JobStreams.

In this module, we will complete the first three steps in the standard data mart
development process.

2-4

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).

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.

The catalog stores Data Manager builds, connection specifications, JobStreams,


user-defined functions, and the dimensional framework.

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.

You save a catalog by clicking Save


Catalog from the File menu or clicking the
Save button on the toolbar.

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).

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-5

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Physical Storage of the Catalog


Catalog Database

Development
Catalog
Tables

Quality Control
Catalog
Tables

Production
Catalog
Tables

Data Manager
Target
Connection

Source
Connection
Source
Connection

Target
Connection

Physically, Data Manager maintains catalog information in database tables.


We recommend that you create a dedicated schema for each of your catalogs,
separate from your source or target data. With a separate schema, the catalog is
more secure; only people who have access to that schema will use the catalog.
If you are using Microsoft Access, a catalog database may contain only one catalog
because Access does not use database schema. If you will be using multiple catalogs
in Access, each catalog must be stored in a separate database.
If you are using multiple catalogs to work in different environments, you can create
a package to share work between them.

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

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).

CREATE

CATALOG

Shared Items in a Catalog


Library items can be used throughout
the catalog in a variety of different
builds and JobStreams.
A catalog library consists of:

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.

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-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

The shortcut for creating a catalog is


Ctrl+N.

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).

CREATE

Connect to Sources and Targets

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.

identifies the particular data source or target

specifies the connection method that must be used to connect to the data

provides information, such as a user name and a password, that the


database management system requires when Data Manager connects to the Select the Cognos SQL check box to use
data. The database password information stored in the catalog is encrypted. Cognos SQL when you construct an SQL

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.

statement for components using this


connection. If you clear this check box,
you must use native SQL for the
database you are accessing.

The selection that you make here


determines the default for the Cognos
SQL check box in other components that
use this connection.
You can use the Published FM Package
connection to access query subjects
from a published IBM Cognos 8
package. We discuss these later in this
module.

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-9

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Connect to a Published Framework Manager


Package

Connect to a published Framework Manager package if you want to


access query subjects from a published IBM Cognos 8 package.

To connect to the package:

1.

Create a Published FM Package connection.

2.

Log on to the IBM Cognos 8 server (if necessary).

3.

Select the package that you want to work with.

Each connection can access one published package.

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

When using IBM Cognos Connection with


multiple data source connections, you can
use the DM_DATASOURCE_
CONNECTION_SIGNONS variable to
specify which data sources to use. For
more information, see the Data Manager
User Guide.

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).

CREATE

Connect to a IBM Cognos Data Source

Create an IBM Cognos Data Source connection to access data


sources that have been set up in IBM Cognos 8.

Before you can create a IBM Cognos Data Source connection, you
must configure Data Manager to access the:

IBM Cognos 8 Gateway URI (uniform resource identifier)

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.

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-11

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Access Data Using SQLTerm


After you have created connections to data sources within a catalog,
you can use SQLTerm to view the data that they contain.
You can also use SQLTerm to change the structure and contents of
the data.
You can execute SQL (Structured Query Language) statements
against any data source that Data Manager can access, including
published Framework Manager packages.
SELECT RETAILER_CODE,
RETAILER_NAME,
COMPANY_NAME
FROM RETAILER

Data Source

DML statement in SQLTerm

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:

Data Definition Language (DDL), such as CREATE TABLE

Data Manipulation Language (DML), such as SELECT FROM

Connection Queries, such as SOURCES

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.

Technical Information (contd)


When you use SQLTerm with a published Framework Manager package, you can view the generated
XML for the query, and if required, convert it so that it can be manually authored. When a query has
been converted, you cannot return to using the model. This functionality is intended for advanced
users who are familiar with the query specification syntax and the IBM Cognos SDK. For more
information, see the Data Manager User Guide.

2-12

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).

CREATE

CATALOG

Test Your Queries Using SQL Helper


When you add an SQL statement in a window or dialog box, you can
open SQL Helper.
SQL Helper makes it easier to specify the tables and columns that
the catalog will use in the builds and the dimensional framework.
For example, you can write and test SQL query statements before
executing a fact build.

When you pass a SQL statement to SQL Helper, you have the option to:

accept it as it is

modify it and then accept it

discard the statement

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.

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-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

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).

CREATE

CATALOG

Demo 1: Create a Catalog and Register Data Sources


Purpose:
As data warehouse developers for The Great Outdoors
Company, you want to create a simple data mart prototype for
presentation to senior management. To begin, you will create a
Data Manager catalog to hold the data mart and connect to a
database that contains transactional data.
Task 1. Create a data source to hold the catalog.
1. Open Data Manager.
2. In the Welcome dialog box, click Close, and then from the Tools menu,
click ODBC Administrator.
The ODBC Data Source Administrator dialog box appears.
3. Click the System DSN tab, and then click Add.
The Create New Data Source dialog box appears.
4. Click Microsoft Access Driver (*.mdb), and then click Finish.
The ODBC Microsoft Access Setup dialog box appears.
You are now ready to register a new data source for your Data Manager
catalog.
5. Click Create, and then in the Directories list, navigate to
C:\Edcognos\B2480.
6. In the Database Name box, type Day1Database.mdb.
7. Click OK.
A message appears, informing you that you have successfully created your
database.
8. Click OK, and then in the Data Source Name box, type Day1Catalog.
9. Click OK, and then click OK again to close the ODBC Data Source
Administrator dialog box.

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:

Task 3. Define a connection to the Sales data source.


1. In the tree, right-click Connections, and then click Insert Connection.
The Connection Properties dialog box appears.
2. In the Alias box, type Sales.
3. Click the Connection Details tab, and then in the left pane, click SQL
Server (OLE-DB).
4. In the Username box, type sa, and then in the Password box, type
Education1!.
5. In the Server Name list, select (local), and then in the Database Name box,
type dm_sales.

2-16

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).

CREATE

CATALOG

6. In the OLE DB Provider box, ensure that sqloledb (SQL Server 2000
OLEDB) is selected.
The results appear as shown below:

7. Click Test Connection.


The data source is tested successfully.
8. Click OK to dismiss the confirmation message, and then click OK to close
the Connection Properties dialog box.
You have successfully connected to a transactional data source.
Task 4. Use SQLTerm to view the data in the Sales data
source.
1. From the Tools menu, click SQLTerm.

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.

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-17

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

4. Right-click dm_sales, and then click Select rows.


The result appears as shown below:

5. Click Return all rows

Data Manager displays 10,529 rows of data.


6. Clear the Query pane by clicking Clear the query
Test pane by clicking Clear test results .

, and then clear the

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

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).

CREATE

CATALOG

Configure Text Files Using SQLTXT


Use SQLTXT if you want to access data in text files through SQL.
You can use SQLTXT to define access to one or more text files in
ASCII or EBCDIC format.
You can maintain the resulting definition file (.def) through
SQLTXT Designer or edit it manually in a regular text editor such
as Notepad.

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:

single table SELECTS (no table joins)

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.

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-19

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 2
Configure a Text File
Using SQLTXT

2-20

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).

CREATE

CATALOG

Demo 2: Configure a Text File Using SQLTXT


Purpose:
You have transactional data that you want to incorporate into
your data mart. This data consists of sales figures within a flat
file, which must be configured to produce a definition file. To
incorporate the data into your data mart, you must connect to
this file within Day1Catalog.
Task 1. Import table data into a new definition file.
1. From the Tools menu, click SQLTXT Designer.
SQLTXT Designer appears.
Maximize the window if necessary.
2. From the File menu, click New.
3. Right-click the untitled database, and then click Import Table Data.
The Import SQLTXT Table Data File dialog box appears.
4. In the Look in list, navigate to
C:\Edcognos\B2480\Additional_Sales.txt, and then click Open.
The Import wizard appears.
You will now use this wizard to convert Additional_Sales.txt into a format
that can be accessed with the SQLTXT driver.
5. In the Number of header rows box, type 1, and then click Next.
6. In the Delimiter type list, click COMMA, and then click Next.

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-21

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

7. Click Finish, and then press Enter.


The result appears as shown below:

8. From the File menu, click Save As.


The Save Definition File As dialog box appears.
9. In the File name box, type Additional_Sales.def, and then click Save.
10. From the File menu, click Exit.
You have configured a text file to produce a definition file that you can
interact with by using SQL.
Task 2. Create a connection to the .def file in Day1Catalog.
1. Right-click Connections, and then click Insert Connection.
The Connection Properties dialog box appears.
2. In the Alias box, type Additional_Sales, and then click the Connection
Details tab.
3. In the left pane, click SQLTXT.
.
4. Click Browse
The Select File dialog box appears.
5. In the Look in list, navigate to
C:\Edcognos\B2480\Additional_Sales.def, and then click Open.
2-22

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).

CREATE

CATALOG

6. Click Test Connection.


A message appears, indicating that the connection is OK.
7. Click OK to close the message, and then click OK to close the Connection
Properties dialog box.
Task 3. Verify the SQLTXT specification using SQLTerm.
1. From the Tools menu, click SQLTerm.
SQLTerm appears.
2. In the Database objects pane, expand Additional_Sales.
3. Right-click Additional_Sales, and then click Select rows.
4. Click Return all rows.
The result appears as shown below:

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.

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-23

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Summary
In this module, we have:

2-24

examined the purpose and contents of Data Manager catalogs

created a catalog

defined connections to source and target data

used SQLTerm to view data

used SQLTXT to configure flat data source files

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).

CREATE

CATALOG

Workshop 1
Define Connections to Data Sources

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-25

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 1: Define Connections to Data Sources


Now that the catalog is created and connected to a data source, we can continue
developing the data mart. The data mart must contain all the relevant information
about the business. As a result, we must obtain data from all the necessary
databases. Also, the data mart itself will take the form of relational tables that will be
located in a separate database. Your assignment is to define connections to three
additional data sources within Day1Catalog.
The first data source contains inventory information about each product that the
company has in stock. The second data source holds reference data (including a
standard list of the 16 products that the company sells), and the third data source
will contain the complete data mart.
To accomplish this workshop:

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

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).

CREATE

CATALOG

Workshop 1: Task Table


TASK

WHERE TO WORK

HINTS

1. Add the Stock, Reference,


and Output connections
to Day1Catalog.

Connections folder, Tree pane

Specify the SQL Server


(OLE-DB) connection
type.

Use the dm_stock,


dm_ref, and dm_out SQL
Server databases.

Specify your local server


and the SQL Server 2000
OLE-DB provider.

Username: sa

Password: Education1!

Right-click a table or
column to obtain a
SELECT statement.

2. Use SQLTerm to view the


data.

SQLTerm

If you need more information to complete a task, see the Step-by-Step instructions
at the end of this workshop.

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-27

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 1: Results

2-28

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).

CREATE

CATALOG

Workshop 1: Step-by-Step Instructions


Task 1. Add the Stock, Output, and Reference connections
to Day1Catalog.
1. Right-click Connections, and then click Insert Connection.
The Connection Properties dialog box appears.
2. In the Alias box, type Stock.
3. Click the Connection Details tab, and in the list in the left pane, click SQL
Server (OLE-DB).
4. In the Username box, type sa, and then in the Password box, type
Education1!.
5. In the Server Name list, select (local), and then in the Database name box,
type dm_stock.
6. In the OLE DB Provider list, ensure that sqloledb (SQL Server 2000
OLEDB) is selected, and then click Test Connection.
A message appears, indicating that the connection is OK.
7. Click OK to close the message and then click OK to close the Connection
Properties dialog box.
8. Repeat steps 1 to 7 to create two connections named Reference and
Output.
These will point to the dm_ref and dm_out databases, respectively.
Task 2. Use SQLTerm to view the data.
1. From the Tools menu, click SQLTerm.
2. In the Database list, select Stock.
3. In the Database objects pane, double-click Stock, and then double-click
dbo.
The dm_stock table is now available for analysis.
4. Right-click dm_stock, and then click Select rows.
The result appears as shown below:

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-29

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

5. Click Return all rows.


Data Manager returns 10,861 rows of data.
6. Click Clear the query, and then click Clear test results.
7. In the Database list, click Reference.
8. Repeat steps 3 through 6 to analyze dm_fiscal and other tables within the
Reference data source.
9. Close SQLTerm, and then on the toolbar, click Save catalog.
10. Close Data Manager.

2-30

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).

Create Hierarchies

IBM Cognos 8 BI

2008 IBM Corporation

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

3-2

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).

CREATE

HIERARCHIES

Objectives
In this module, we will:

examine the role of the dimensional framework in Data Manager

examine hierarchies and their data sources

identify how to create hierarchies from the columns of one table,


the rows of one table, and from multiple tables

test and view hierarchies

create a hierarchy of static date values

handle weeks in a date hierarchy

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).

3-3

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

The Data Mart Development Process: Overview


1. Create connections to source, target, and catalog databases.
2. Create a Data Manager catalog.
3. Insert connections to source and target databases.
4. Create dimensions and hierarchies and explore them.
5. Create dimension builds.
6. Create fact builds.
7. Create JobStreams.

3-4

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).

CREATE

HIERARCHIES

The Dimensional Framework in the Data Mart


Dimensional
Framework

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:

consists of multiple hierarchies that represent the logical structure of the


data, independent of any physical data source

is defined in the catalog

represents the core components of your business

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.

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).

3-5

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

The Purpose of the Dimensional Framework

3-6

For dimension builds, the dimensional framework defines the


hierarchical structure and content of the data delivered to the
dimension tables.

For fact builds, the dimensional framework:

enables integrity checking for each incoming row of data

provides context for aggregating fact data

enables you to deliver dimension data from a fact build (when


creating a prototype data mart)

enables surrogate key substitution when available

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.

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).

CREATE

HIERARCHIES

Build the Dimensional Framework


To build the dimensional framework, you create dimensions within
the library of a catalog.
You can then add any number of these reference structures to the
dimension:

hierarchies

auto-level hierarchies

lookups

A hierarchy is a particular view of a business dimension which organizes the


structure data into levels that represent parent-child relationships. Each hierarchy
can have as many levels as you require.
An auto-level hierarchy is a hierarchy that is structured solely in terms of parentchild relationships and does not have a fixed number of levels.
A lookup is a single-level structure that is used primarily for data validation.

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.

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).

3-7

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Examine Hierarchy Components


A hierarchy consists of levels.
Each level of a hierarchy is populated by its members.
A member is a unique occurrence of data within a level, such as a
specific customer or specific product.
A member can have many children, but should have only one parent.
Dimension to which
hierarchy belongs

Name of hierarchy
Levels in hierarchy

3-8

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).

CREATE

HIERARCHIES

Examine Attributes of a Hierarchy Level


Each level of a hierarchy is defined by its attributes.
A level attribute may serve as an:

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.

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).

3-9

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Map Data into a Hierarchy


State Data Source

State Level

A DataStream is a Data Manager component that is used to retrieve data from


identified sources (such as database tables). To enable the flow of data from a data Instructional Tips
source to the levels of a hierarchy, you must map the data source columns to items As shown in the slide example, you might
have two tables that contain similar
in the DataStream, and then map the DataStream items to the level attributes.

information but in different languages, such


Mapping lets you incorporate multiple data sources and transfer identical data from as English and French. In this case, you
will want to map the data coming from the
these sources into the same attributes of a hierarchy level.
columns "state_name" (in the English
source) and "nom_de_la_province" (in the
French source) into the same level attribute
(in this case, "state_name").
If you want to modify the SQL (for example,
to add more columns to the SELECT
statement) you must go back and re-map
the columns that you add or modify to the
level attributes within the DataStream.
Emphasize the importance of mapping to
the students. Point out that, although the
demos in this module do not require
mapping (as it will be done automatically by
the Hierarchy wizard), it is more common to
manually map the data. We will manually
map data into hierarchies later in this
course.

3-10

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).

CREATE

HIERARCHIES

Where Do Data Sources Go in a Hierarchy?

single data source above the top level

data sources at specific levels

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 a single query provides information to more than one level in the


hierarchy, it must be declared at the hierarchy level. All columns in this toplevel data source can be made available to all levels of the hierarchy.

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.

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).

3-11

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Create Hierarchies Using the Hierarchy Wizard


If you are building a simple data mart structure, you can create
your hierarchies with the Hierarchy wizard.
Using the Hierarchy wizard, you can create a hierarchy from:

3-12

the columns of one table

the rows of one table

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.

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).

CREATE

Create the Hierarchy from the Columns of One


Table
Use this method when your source data is in a single table with
specific columns representing levels in the hierarchy.

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.

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).

3-13

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Create the Hierarchy from the Rows of One


Table
Use this method when your source data is in a single table with sets
of rows for each level in the hierarchy, each related by a parent
column.
REGION

3-14

Type

Parent

Location

REGION

n/a

West

STATE

West

California

CITY

California San Jose

STATE

CITY

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).

CREATE

HIERARCHIES

Create the Hierarchy from Multiple Tables


Use this method when your source data comes from multiple tables,
with each table representing a single level in the hierarchy.
Each row has a parent ID column that relates to another row in its
parent table.
Since transactional data sources are often very well-normalized, this
is the most commonly used method to create hierarchies.
Class
Class
Household
Family
Books

Family

Class
Household

Product

Family

Product

Dictionary Books

The hierarchy follows one-to-many relationships between the tables.

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.

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).

3-15

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 1
Examine Source Data
for Hierarchies

3-16

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).

CREATE

HIERARCHIES

Demo 1: Examine Source Data for Hierarchies


Purpose:
As data warehouse developers at The Great Outdoors Company,
you are creating a data mart prototype that can be used to
analyze the company's product inventory in the U.S. Therefore,
you must look at your data sources to determine the types of
hierarchies that you must create.
Task 1. Determine the types of hierarchies to create.
1. Open Data Manager.
2. In the Welcome dialog box, click Open an existing catalog.
3. In the left pane, click ODBC, in the Data Source Name list, click
Day1Catalog, and then click OK.
4. On the toolbar, click Open the SQLTerm window

5. In the Database list, click Reference.


6. In the Database objects pane, double-click Reference, and then doubleclick dbo.
7. Right-click dm_location, and then click Select rows.
8. Click Return all rows.
This table contains a column called timezone_cd. If you expand
dm_timezone, you can see that this column also exists in that table. In the
dm_location table, it serves as a foreign key column. Therefore, you must
create the Location hierarchy from multiple tables (dm_location and
dm_timezone).
9. Click Clear the query, and then click Clear test results.
10. Repeat step 7 for the dm_fiscal table.
You can see that you must create the Fiscal hierarchy based on the columns
from one table (dm_fiscal) because the columns of this table reflect a
hierarchical structure (year, quarter, and period).
11. Close SQLTerm.
Results:
You have looked at the reference data sources and have
determined the three different types of hierarchies you must
create. You will create one hierarchy from the columns of one
table and one hierarchy from multiple tables.

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).

3-17

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Test and View a Hierarchy Using the Reference


Explorer
Hierarchy View

Level View

Instructional Tips
When you test a hierarchy, the
Reference Explorer runs the SQL to
temporarily populate the hierarchy.

Testing the hierarchy tells you:

which members are at each level

how much memory is required to cache the hierarchical data

If the members do not appear as expected, or if a lot of memory is required to


cache the data, you may need to manually modify or re-create the hierarchy.
You can use the Reference Explorer to view a hierarchy in two ways:

Because the members of each hierarchy


level (for example, the Atlantic Standard
Time member of the Timezone level) are
not stored anywhere, you do not need to
create a data source to hold them. The
members are only loaded into memory
as needed for processing.

1. Hierarchy view: the reference data is shown in a true hierarchical structure


with members linked to their parent. This view is useful if the hierarchy has
a lot of levels.
2. Level view: the hierarchical members are linked under the levels they belong
to with no specific reference to the parent. This view is useful if the
hierarchy does not contain a lot of data.

3-18

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).

CREATE

HIERARCHIES

Demo 2
Create a Hierarchy
from Multiple
Tables and Examine its
Properties

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).

3-19

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 2: Create a Hierarchy from Multiple Tables and


Examine its Properties
Purpose:
You must develop a hierarchy so that you can look at the
business from a geographical point of view. The Location
hierarchy will organize this area of the business into time zones
and states.
Task 1. Begin creating the Location hierarchy.
1. On the Data Manager toolbar, click Start the Hierarchy Wizard

The Hierarchy wizard appears.


2. Select Create the hierarchy from multiple tables. (Snowflake Schema),
and then click Next.

Instructional Tips
The list on the left side of the Hierarchy
wizard indicates where you are in the
hierarchy creation process.

3. In the Enter the name of the hierarchy box, type Location.


4. Click Add.
The Dimension Properties dialog box appears.
You will now name your reference dimension.
5. In the Name box, type Location, and then click OK.
The Location dimension is selected automatically in the Select the reference
dimension to use for this hierarchy box.
6. Click Next.
7. Clear the Include a top level with an 'All' member box, as you do not
require an all level in this hierarchy, and then click Next.
You must now add levels to the Location hierarchy.
Task 2. Add the Timezone level to the hierarchy.
1. Click Add.
The Level Details window opens.
2. In the Name box, type Timezone.
3. In the Source database list, click Reference.
4. Next to Source table, click Browse for table

The Select Table dialog box appears.


5. Double-click dbo, click dm_timezone, and then click OK.

3-20

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).

CREATE

HIERARCHIES

6. In the Available attributes list, double-click timezone_cd and


timezone_name to add them to the Chosen attributes list.
7. In the Chosen attributes list, select the Id check box for timezone_cd and
the Caption check box for timezone_name.
8. Click OK to create the level.
Task 3. Add the State level to the hierarchy.
1. With Timezone selected, click Add.
The Level Details window opens.
2. In the Name box, type State, and then in the Source database list, click
Reference (if necessary).
3. Next to Source table, click Browse for table.
The Select Table dialog box appears.
4. Double-click dbo, click dm_location, and then click OK.
5. In the Available attributes list, double-click state_cd, state_name, and
timezone_cd to add them to the Chosen attributes list.
6. In the Chosen attributes list, select the Id check box for state_cd, the
Caption check box for state_name, and the Parent check box for
timezone_cd.
The result appears as shown below:

7. Click OK to create the level.


The result appears as shown below:

8. Click Next, and then click Finish.

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).

3-21

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

9. In the tree, expand the Location hierarchy.


The result appears as shown below:

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

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).

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.

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).

3-23

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Create a Hierarchy of Static Date Values


Often, there is no table in your source database that contains a full
range of dates for use in a date hierarchy.
To assist you in creating a date hierarchy, Data Manager provides
the Date Hierarchy wizard.
You can choose to include levels for year, quarter, month, week, and
day.

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.

level name - you can change the


default name (mandatory)
format of the level ID - you can select
or type the format for the ID (such as
using four digits for the Year level)
(mandatory)
format of the level caption (optional)
how the weeks roll up to the nexthigher level - this option is only
available for the Week level (optional)
the days to include in the calendar (for
example, you may only want to include
week days, not week ends) - this
option is only available for the day
level (optional)

You may want to discuss other methods of


creating date (and time of day)
hierarchies, such as using an Excel feed
or the MAKEROWS database. Also
discuss why you might want to use these
alternative approaches (for example, you
can add extra attributes such as day of the
week, day of the month, day of year, and
so forth).

3-24

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).

CREATE

HIERARCHIES

Handle Weeks in a Date Hierarchy


If you include weeks in your date hierarchy, a particular week may
straddle the start and end of its parent (for example, the month to
which it belongs).
This overlap can make it difficult to correctly roll up data to higher
levels of detail.
You can use the Date Hierarchy wizard to specify how you want to
handle weeks that cross a parental boundary.
August
Week 34
Aug

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

Week to Start and End

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).

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

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).

CREATE

HIERARCHIES

Demo 3: Create and Examine a Static Date Hierarchy


Purpose:
You will create a static date hierarchy that employees of the
Great Outdoors can use to analyze their business. This
hierarchy will represent the time dimension for three years of the
business.
Task 1. Create the Date dimension.
1. Right-click the Dimensions folder, and then click Insert Reference Dimension.
The Dimension Properties dialog box appears.
2. In the Name box, type Date.
3. Select the Dimension Represents Time check box, and then click OK.
You will now create the static date hierarchy that will populate this dimension.
Task 2. Create the Date_static hierarchy by using the Date
Hierarchy wizard.
1. On the toolbar, click Start the Date Hierarchy Wizard

The Date Hierarchy wizard appears.


2. In the Enter the name of the hierarchy box, type Date_static.
3. In the Select the reference dimension (representing time) to use for this
hierarchy list, click Date, and then click Next.
4. Select the Year, Quarter, and Month boxes, and then click Next.
5. In the Year Caption format list, click YYYY, and then click Next.
6. In the Quarter Caption format list, click YYYY"Q"Q, and then click
Next.
7. In the Month Caption format box, click YYYYMM, and then click Next.
8. In the Start date box, type 01/01/2006.
9. In the End date box, type 12/31/2008, and then click Finish.
The Date_static hierarchy is automatically generated.
10. Expand the Date_static hierarchy.
The result appears as shown below:

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.

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).

3-27

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Task 3. Explore the Date_static hierarchy in Reference


Explorer.
1. In the Visualization pane, right-click Date_static, and then select Explore.
A message appears, prompting you to save your changes to the catalog.
2. Click OK.
The Reference Explorer dialog box appears with Date_static (H) selected
by default in the Reference Item list.
3. Click OK.

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:

5. Close Reference Explorer.


6. Under the Date_static hierarchy, expand the Month level.
7. In the Month level, right-click Static Members, and then click Properties.
The Static Members window opens.
The meaning of these members will be discussed later in this course.
8. Click OK to close the Static Members window.
Results:
You have used the Date Hierarchy wizard to create a static date
hierarchy that will represent the time dimension for three years
of the business.

3-28

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).

CREATE

HIERARCHIES

Summary
In this module, we have:

examined the role of the dimensional framework in Data Manager

examined hierarchies and their data sources

identified how to create hierarchies from the columns of one table,


the rows of one table, and from multiple tables

tested and viewed hierarchies

created a hierarchy of static date values

handled weeks in a date hierarchy

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).

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

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).

CREATE

HIERARCHIES

Workshop 1: Create a Hierarchy from the Columns of One


Table and Examine its Properties
You must continue the development of your catalog to create a simple data mart.
Your next task is to use the Hierarchy wizard to build a hierarchy from the columns
of one table.

Use the dm_fiscal table to create a hierarchy called Fiscal. You do not
require a static ALL level.

Create the levels for the fiscal hierarchy.


Fiscal:

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.

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).

3-31

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 1: Task Table


TASK

WHERE TO WORK

1. Create the Fiscal reference


dimension.

Build tree

2. Create the Fiscal hierarchy. Hierarchy wizard

HINTS

Create the hierarchy from the


columns of one table (Star
Schema).

Use the dm_fiscal table within


the Reference database.

3. Create the Year level for


the hierarchy.

Level Details window

Use the fiscal_yr column for


the Id and the fiscal_yr_desc
column as the caption.

4. Create the Quarter level.

Level Details window

Use the fiscal_qtr column for


the Id and the fiscal_qtr_desc
column as the caption.

5. Create the Month level


and complete the
hierarchy.

Level Details window

Use the period_no column as


the Id and the period_no_desc
column as the caption.

6. Examine the Fiscal


hierarchy.

Build tree

Expand and collapse the Fiscal


hierarchy to review the
components.

Review the Fiscal data source


SQL.

Review the properties of the


DataStream.

Click the plus sign (+) to view


the members within 2007.

Data Source Properties


window, Query tab
DataStream Properties
window

7. Use the Reference


Explorer to examine the
Fiscal hierarchy.

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

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).

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:

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).

3-33

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 1: Step-by-Step Instructions


Task 1. Create the Fiscal dimension.
1. In the tree, right-click the Dimensions folder, and then click Insert
Reference Dimension.
The Dimension Properties dialog box appears.
2. In the Name box, type Fiscal, and then click OK.
Task 2. Create the Fiscal hierarchy.
1. On the toolbar, click Start the Hierarchy Wizard.
The Hierarchy wizard opens.
2. Ensure that the Create the hierarchy from the columns of one table.
(Star Schema) button is selected, and then click Next.
3. In the Enter the name of the hierarchy box, type Fiscal.
4. In the Select the reference dimension to use for this hierarchy list, click
Fiscal, and then click Next.
5. Double-click Reference and dbo, click dm_fiscal, and then click Next.
6. Clear the Include a top level with an 'All' member check box, and then
click Next.
Task 3. Create the Year level for the hierarchy.
1. Click Add.
The Level Details dialog box appears. Here you will specify the sources for
the ID and caption of the hierarchy's top level.
2. In the Name box, type Year.
3. Next to Source column for Id, click Browse for column

The Select Column dialog box appears.


4. Click fiscal_yr, and then click OK.
5. Next to Source column for caption, click Browse for column.
6. The Select Column dialog box appears.
7. Click fiscal_yr_desc, and then click OK.
8. Click OK to close the Level Details dialog box.
You have just created the top level for the Fiscal hierarchy.

3-34

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).

CREATE

HIERARCHIES

Task 4. Create the Quarter level.


1. With Year selected, click Add.
The Level Details dialog box appears.
2. In the Name box, type Quarter.
3. Next to Source column for Id, click Browse for column.
The Select Column dialog box appears.
4. Click fiscal_qtr, and then click OK.
5. Next to Source column for caption, click Browse for column.
The Select Column dialog box appears.
6. Click fiscal_qtr_desc, and then click OK.
7. Click OK to close the Level Details dialog box.
Task 5. Create the Month level and complete the hierarchy.
1. With Quarter selected, click Add.
The Level Details dialog box appears.
2. In the Name box, type Month.
3. Next to Source column for Id, click Browse for column.
The Select Column dialog box appears.
4. Click period_no, and then click OK.
5. Next to Source column for caption, click Browse for column.
The Select Column dialog box appears.
6. Click period_no_desc, and then click OK.
7. Click OK to close the Level Details dialog box, and then click Next.
8. Click Next to bypass assigning additional attributes to this level.
9. Click Finish.

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).

3-35

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Task 6. Examine the Fiscal hierarchy.


1. Double-click the Fiscal hierarchy to expand it.
The result appears as shown below.

2. Double-click DataStream, and then double-click the Fiscal data source.


The Data Source Properties window opens.
3. Click the Query tab.
The SQL code you see here represents the call made to the database to
retrieve the data for the hierarchy.
4. Click OK to close the Data Source Properties window.
5. Right-click DataStream, and then click Properties.
The DataStream Properties window opens and shows the mapping of SQL
columns to the DataStream items.
The result appears as shown below.

6. Click OK to close the DataStream Properties window.


Task 7. Use the Reference Explorer to examine the Fiscal
hierarchy.
1. In the Visualization pane, right-click the Fiscal 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.
3. Click OK.
The Reference Explorer runs and returns all the members in the Fiscal
hierarchy.
3-36

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).

CREATE

HIERARCHIES

4. Click (+) to expand FY07 (2007).


The four quarters of fiscal year 2007 are shown.
The result appears as shown below:

5. Close Reference Explorer.

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).

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

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).

CREATE

HIERARCHIES

Workshop 2: Create a Hierarchy from the Rows of One


Table and Examine its Properties
You must now develop a hierarchy that represents the products that the business
sells. Your assignment is to use the Hierarchy wizard to build a product hierarchy
from the rows of one table.

Create a hierarchy called Product by using the dm_product table. Do not


create a static ALL level member.

Create the Class and Product levels for the Product hierarchy:

Source Column
for Id

Source Column
for Caption

Source Column for


Parent

Source Column for


Level Name

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.

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).

3-39

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 2: Task Table


TASK

WHERE TO WORK

1. Create the Product


reference dimension.

Build tree

2. Create the Product


hierarchy.

Hierarchy wizard

3. Use the Reference


Explorer to examine the
Product hierarchy.

Reference Explorer

HINTS

Create the hierarchy from the


rows of one table.

Use the Reference data source.

Use the dm_product table.

Use product_cd as the source


column for the Id attribute.

Use product_name as the


source column for the caption
attribute.

Use parent_product_cd as the


source column for the parent
attribute.

Use product_type as the


source column for the level
name.

Click the plus sign (+) to view


the members within each level.

If you need more information to complete a task, see the Step-by-Step instructions
at the end of this workshop.

3-40

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).

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:

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).

3-41

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 2: Step-by-Step Instructions


Task 1. Create the Product dimension.
1. In the tree, right-click the Dimensions folder, and then click Insert
Reference Dimension.
The Dimension Properties dialog box appears.
2. In the Name box, type Product, and then click OK.
Task 2. Create the Product hierarchy.
1. On the toolbar, click Start the Hierarchy Wizard, select Create the
hierarchy from the rows of one table., and then click Next.
2. In the Enter the name of the hierarchy box, type Product.
3. In the Select the reference dimension to use for this hierarchy list, select
Product, and then click Next.
4. Double-click Reference and dbo, click dm_product, and then click Next.
5. Beside Select the column for the Id, click Browse for column, click
product_cd, and then click OK.
6. Beside Select the column for the Caption, click Browse for column, click
product_name, and then click OK.
7. Beside Select the column for the Parent, click Browse for column, click
parent_product_cd, and then click OK.
8. Beside Select the column for the level name, click Browse for column,
click product_type, and then click OK.
9. Click Next, clear the Include a top level with an 'All' member check
box, and then click Next.
10. Click Next, click Next to avoid assigning additional attributes to the levels,
and then click Finish.

3-42

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).

CREATE

HIERARCHIES

Task 3. Use the Reference Explorer to examine the Product


hierarchy.
1. Right-click the Product hierarchy, and then click Explore.
A message appears, prompting you to save the catalog.
2. Click OK.
The Reference Explorer appears, with the Product hierarchy automatically Instructional Tips
selected.
If students ask about the Unknown class,
explain that we will be discussing this
3. Click OK.
situation later when we get to the topic of
4. Expand Kitchen.

fostering.

You can now see the five different types of products within the Kitchen
class. The result appears as shown below:

5. Close Reference Explorer, 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).

3-43

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

3-44

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).

Create Basic Builds

IBM Cognos 8 BI

2008 IBM Corporation

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

4-2

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

CREATE

BASIC

BUILDS

Objectives
In this module, we will:

examine Data Manager builds and build-related terminology

create a dimension build using the Dimension Build wizard

create a fact build using the Fact Build wizard

test and execute a fact build

document a catalog

create catalog schema

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

4-3

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

The Data Mart Development Process: Overview


1. Create connections to source, target, and catalog databases.
2. Create a new Data Manager catalog.
3. Insert connections to source and target databases.
4. Create dimensions and hierarchies and explore them.
5. Create dimension builds.
6. Create fact builds.
7. Create JobStreams.

4-4

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

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.

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

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

deliver data to fact tables in data marts

deliver a single, private data mart that includes fact data


and dimension data

perform a simple data transfer

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

CREATE

BASIC

BUILDS

What is a Dimension Build?


A dimension build delivers data that describes a single dimension of
the business, such as Product or Customer.

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).

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

4-7

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Create a Dimension Build Using the Dimension


Build Wizard

4-8

The Dimension Build wizard guides you step-by-step through the


process of creating a dimension build:
1.

Name the build.

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.

Define the features and properties of the build.

5.

Indicate how slowly changing dimensions will be handled.

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

CREATE

BASIC

BUILDS

Demo 1
Create a Dimension
Build

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

4-9

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 1: Create a Dimension Build


Purpose:
You want to create a simple dimension build based on the
Location hierarchy. When executed, the build will populate one
dimension table that utilizes a star schema. This table will enable
users to analyze revenue by office location.
Task 1. Name the dimension build and choose the
dimension to deliver.
1. Open Data Manager.
2. In the Welcome dialog box, click Open an existing catalog.
3. In the left pane, ensure that ODBC is selected, in the Data Source Name
list, click Day1Catalog, and then click OK.
4. On the toolbar, click Start the Dimension Build Wizard

The Dimension Build wizard appears.


5. In the Name box, type Location, and then click Next.
6. In the Dimension to be delivered list, click Location.
The Location hierarchy is automatically selected in the Reference item to be
delivered box, since it is the only reference structure within the Location
dimension at this point.
7. In the Deliver into connection list, click Output, and then click Next.
Task 2. Set the properties of and run the Location dimension build.
1. Click Next to accept the default schema naming conventions for the
dimension table and columns.
2. Click Next to accept the default features of the generated build.
3. Click Next to accept the default properties of the generated build.
4. Click Next to bypass adding surrogates and change tracking attributes to the
dimension table.
5. Click Finish.
The result appears as shown below:

6. In the tree, ensure that the Location build is selected, and then on the
toolbar, click Execute

A message appears, prompting you to save your changes to the catalog.

4-10

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

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.

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

4-11

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

How Data Manager Creates Data Marts: Overview


Dimensional
Framework

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

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

CREATE

BASIC

BUILDS

The Fact Build Process


Data
Source

Product

DataStream

10100101

1. Populate hierarchy in memory


2. Read fact source data
3. Deliver fact data

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.

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

4-13

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Identify the Elements of a Fact Build

Five types of elements can be part of a delivered fact table:


1.

dimension

2.

derived dimension

3.

measure

4.

attribute

5.

derivation

During the build definition process, these elements form the


transformation model.

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

A quantitative data value, such as Product Cost. The eventual goal of


Business Intelligence is to roll up and analyze these values. Measures
are usually additive values, such as Total Sales.

Attribute

Additional transactional information that may be of interest in the


data mart, but not necessarily a dimension or a measure. For
example, it probably would not make sense to have a Unit Weight
dimension. However, Unit Weight would also not work as a
measure, since you probably would not want to roll up this type of
value.

Derivation

A calculated element that is not obtained through an SQL query. A


derivation is different from other build elements in that it is an
output-only element.

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.

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

CREATE

BASIC

BUILDS

Create a Fact Build Using the Fact Build Wizard

The Fact Build wizard guides you step-by-step through the process
of creating a fact build:
1.

Name the build.

2.

Define the purpose of the fact build (for example, to transfer


data).

3.

Create the DataStream.

4.

Assign the element types.

5.

Define the dimensions.

6.

Define the fact and dimension deliveries.

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

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.

Identify Types of Fact Builds


When you use the Fact Build wizard, you can specify the type of fact
build that you want to create:

IBM Cognos BI Mart (Star)

IBM Cognos BI Mart (Snowflake)

Relational Datamart

Data Transfer

Each fact build type provides default settings for the data mart
delivery.

You want to

Type of fact build to use

You want to deliver the dimension data to tables


that represent a star schema. That is, you want to
create one dimension table for each dimension in
the fact build.

Cognos BI Mart (Star)

You want to deliver the dimension data to tables


that represent a snowflake schema. That is, you
want to create one dimension table for each level
of each dimension in the build and a central fact
table.

Cognos BI Mart (Snowflake)

You want to move data into a relational database


and deliver dimension data to tables that
represent a star schema. That is, you want to
create one dimension table for each dimension in
the fact build and a central fact table.

Relational Datamart

You want to copy data from one DBMS to a


single fact table in another DBMS, or from a
DBMS table to a text file.

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.

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

CREATE

BASIC

BUILDS

Use a Fact Build to Transfer Data


Use a data transfer fact build to move data from one place to
another quickly and efficiently, without creating a data mart.
A data transfer fact build provides the default settings for copying
data from one DBMS to a single fact table in another DBMS, and also
from a DBMS table to a text file.

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.

Build wizard. When this fact build


was executed, data was transferred
from the SourceConnect database to
a single fact table (F_DataTransfer)
in the TargetConnect database.

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

4-17

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 2
Create a Fact Build

4-18

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

CREATE

BASIC

BUILDS

Demo 2: Create a Fact Build


Purpose:
Using a star schema, you want to create a fact build that
references the columns of the dm_stock table, as well as the
hierarchies in the dimensional framework. Later, when you
execute this fact build, you will deliver one fact table and three
dimension tables to the data mart.
Task 1. Set the properties of the fact build.
1. On the toolbar, click Start the Fact Build Wizard

The Fact Build wizard appears.

Instructional Tips
The IBM Cognos BI Mart (Star) type of
fact build is selected automatically.

2. In the Enter the name of the build box, type Stock.


3. In the Select the type of fact build to create list, ensure that IBM Cognos
BI Mart (Star) is selected.
4. In the Select the connection into which the build is to deliver data list, click
Output.
5. Select the Perform a full refresh on the target data check box, and then
click Next.
Task 2. Establish the data source that the fact build will
read from, and create the SQL statement to obtain
the data.
1. Click the Data Source button, and then click Add.
The Data Source wizard appears.
2. In the Enter the data source name box, type Stock.
3. In the Select the connection from which the data source is to read list, click
Stock.
4. Click Next.
Technical Information
The SQL created by the Data Source
A SELECT statement appears in the right pane of the Data Source wizard, wizard is native to the database in
question. In this case, because our
indicating the columns that will be included in the build's data source.
source data resides in a Microsoft SQL
Server database, each column includes
The result appears as shown below:
quotation marks. These quotation marks
are not necessary, but they are added
automatically by the Data Source wizard.

5. In the left pane, expand dbo, and then select the dm_stock check box.

When working with source or target


databases, you must use the syntax of
SQL that is native to the database.

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

4-19

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

6. Click Finish to close the Data Source wizard.


7. Click Next to accept the default data source mapping.
8. Click Next to accept the default transformation model.
Task 3. Relate the reference structures (hierarchies) to the
dimensional elements of the transformation model.
1. Next to period_no, click (no reference), and then click the browse button

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

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

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:

9. Save the catalog.


Results:
You used the Fact Build wizard to create a fact build that uses a
star schema template. This fact build references the columns of
the dm_stock table and the hierarchies in the dimensional
framework.

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

4-21

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Examine a Fact Build Graphically


After you have created a fact build, you can use visualizations to
easily understand the build's structure and how it moves data.
You can view:

4-22

the entire fact build structure at a high level

how incoming data maps to elements of the transformation


model

how dimension elements in the transformation model map to


hierarchies

the way in which the data is to be delivered

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

CREATE

BASIC

BUILDS

Fact Build Visualization


Dimensions
associated with
the fact build

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.

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

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.

Examine Source Data Mapping


To easily examine how transactional data sources feed into the fact
build, you can view the DataStream mapping for the build.
Use this visualization to see how the source SQL columns map to
the elements of the build's transformation model.

If you need to modify how the fact


build brings in source data (or you
want to add new data sources), you
can open the build's DataStream
Properties dialog box and modify the
mapping as necessary.
Technical Information
Derivations and derived dimensions
in the transformation model do not
map to any literal values or columns
that SQL returns.

4-24

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

CREATE

Transformation Model Visualization


You can easily examine how the dimension elements in the build link
to the dimensional framework by viewing the transformation model
visualization.

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.

Mapped Reference Structures

The check marks in the dimensions


indicate the granularity of the transactional
data coming in (input) and the fact data
being delivered (output). For example, you
may want to bring in product sales at all
levels of the Location hierarchy, but you
may only want to output data aggregated at
the Timezone level.

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

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.

Fact Delivery Visualization


You can easily see how the fact data will be output to one or more
fact tables by viewing the fact delivery visualization.

4-26

The slide example shows how each


element in this transformation model
maps to a single column in the target
fact table.

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

CREATE

BASIC

BUILDS

Examine Fact Build Deliveries


When you create a fact build,
you can output data to two
types of deliveries:

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.

the data mart. Level filters configure


delivery of only specific dimensions and
When you execute a fact build, fact delivery modules are delivered first, followed by hierarchy levels. Output filters are
dimension delivery modules.
expressions that result in either TRUE or
FALSE when applied to each data row. For
example, you may want to include only
those products that have a cost of more
than $25.00 (Price > 25.00). Each delivery
module may have several level filters but
only one output filter.
Partitioning columns horizontally across a
table can be used if the fact data contains
columns that are only occasionally used.
These columns can be stored in a
separate, but linked table.

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

4-27

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Examine Types of Fact Deliveries


You can deliver fact data into:

database tables

files

Table delivery modules


DB2 LOAD
Informix LOAD
Microsoft SQL Server BCP Command
ORACLE SQL *Loader
Red Brick Loader (TMU)
Relational Table
SQL Server Bulk Copy via API

Non-table delivery modules


Text File
Essbase Direct Feed
Essbase File Feed
TM1 Turbo Integrator Delivery

Teradata Fastload
Teradata Multiload
Teradata Tpump
Netezza NZLoad
Sybase ASE BCP Command
Sybase IQLoad

4-28

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

CREATE

Execute a Fact Build

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.

You can also execute fact builds entirely


from the command line. You can include
additional options at the command line.
The command that the Data Manager
engine implements is shown in the
Command Line box.
Almost everything that is done within Data
Manager Designer can be done from the
command line in Windows or UNIX. This
topic is discussed later in the course.

Executing a fact build actually delivers data to the target.


You can choose from three execution modes.
Mode

Description

Normal

Runs a build stored in the Data Manager catalog. Data Manager


processes the whole build and delivers the required data.

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

Used for performance testing and resource estimating. Check Only


does not create the physical delivery structures and does not deliver
data.

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.

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

4-29

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Control Build Feedback


When you execute a fact build, Data Manager opens a new process in
a command window.
This window writes information that is automatically saved as a log
file.
You can control the amount and type of information that you want to
write to the command window and the log file.
By consulting the log files, you can fine-tune the build so that it
efficiently meets your requirements.

Type of Information

Description

Progress

Details the overall progress of the build


implementation.
Includes more detailed progress messages. This option
also displays additional progress messages as each given
number rows are processed (by default, every 5000
rows).
Includes internal Data Manager activity messages, such
as resource usage (memory usage, paging information,
and so on). This is useful for performance testing and
resource estimating.
Includes all SQL statements that Data Manager uses at
each stage of executing the build. This information is
useful in resolving database errors.
Includes the executed SQL for SELECT statements.
Includes all application messages written to the log file
by using the LogMsg() function.

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.

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

CREATE

BASIC

BUILDS

Demo 3
Execute a Fact Build
and View the
Resulting Log File

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

4-31

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 3: Execute a Fact Build and View the Resulting


Log File
Purpose:
You will execute the Stock fact build to load data into the target
data mart. After you have executed the build, you will view the
log file to evaluate the progress of the build.
Task 1. Execute the Stock fact build and view its log file.
1. In the left pane, under the Builds and JobStreams folder, click the Stock
fact build, if it is not already selected.
2. On the toolbar, click Execute.
The Stock fact build runs in a separate command window and delivers
10,861 rows of transactional data into the F_Stock table of the data mart.
3. Press Enter to close the command window.
4. From the Tools menu, click Browse Log Files.
Windows Explorer opens, showing the log files that have been created for Instructional Tips
The log file may have a different number,
builds that have been run.
but it will still be prefaced with
"Build_Stock."

5. Double-click the Build_Stock_0001.log file.


The log file created for the Stock build opens in Notepad.
This file shows the progress details that were displayed in the command
window as the fact build ran. It indicates that data was loaded into the
F_Stock fact table and three dimension tables (D_Stock_Fiscal,
D_Stock_Location, and D_Stock_Product).
6. Close the Build_Stock_0001.log file, and then close Windows Explorer.
Results:
You executed a fact build and viewed the resulting log file to
evaluate its progress.

4-32

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

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

usage summary 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.

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

4-33

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 4
Document a Catalog

4-34

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

CREATE

BASIC

BUILDS

Demo 4: Document a Catalog


Purpose:
You want to create full HTML documentation for the
Day1Catalog. Using this document, users can view detailed
information about the contents of the catalog.
Task 1. Document Day1Catalog.
1. Right-click the Stock fact build, and then click Properties.
2. In the Business name box, type Stock Fact Build, and then in the
Description box, type This is the Stock fact build.
3. Click OK, and then save the catalog.
4. From the File menu, click Document Catalog.
The Document Catalog dialog box appears.
5. Beside the Document name box, click browse

The Save Document dialog box appears.


6. In the File name box, type Day1Catalog, navigate to
C:\Edcognos\B2480, and then click Open.
7. Click OK.
The documentation for Day1Catalog opens in the Web browser (the
browser window may be minimized to the taskbar).
Task 2. View the documentation for Day1Catalog.
1. In your browser, under Data Builds, click the Stock link.
The browser scrolls to the Stock details section of the documentation.
This section gives information about the Stock fact build, such as the SQL
used to retrieve the transactional data and the elements of the
transformation model. You can also see the business name and description
that you added in Task 1.
2. Scroll down, and then click the Linked to Stock Database Alias link.
The browser scrolls to the details of the Stock connection. This section
indicates the different data sources that use the Stock connection to retrieve
data (at this point, only one data source uses the Stock connection).
3. Scroll up, and then click the link to the Location dimension delivery
(underneath the Output connection).
The browser scrolls to the details of the Location dimension delivery that
was created by running the Stock fact build. This section outlines the
elements to which this dimension delivery subscribes.

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

4-35

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

4. Close your Web browser, and then close Data Manager.


Results:
You created an HTML document that contains a detailed
description of the contents of Day1Catalog.

4-36

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

CREATE

BASIC

BUILDS

Create Catalog Schema


For some installations, it may be necessary for a Database
Administrator to manually set up the catalog tables.

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.

Create the required tables. You


may also want to copy the table
creation statements from the
Clipboard to other applications to
inform the database administrators
of the tables to create.
Create indexes from the selected
database tables.
Grant all permissions to all tables
in the schema (however, this may
not apply to all databases).
Delete the contents of all tables in
the schema.
Drop all the tables of the schema,
thereby removing the schema from
the database.

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,
No part of this or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

4-37

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Summary
In this module, we have:

4-38

examined Data Manager builds and build-related terminology

created a dimension build using the Dimension Build wizard

created a fact build using the Fact Build wizard

tested and execute a fact build

documented a catalog

created catalog schema

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,
No part of or translated into another language without a legal license agreement from Cognos ULC (formerly Cognos Incorporated).

Create Derivations

IBM Cognos 8 BI

2008 IBM Corporation

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

5-2

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).

CREATE

DERIVATIONS

Objectives
In this module, we will:

examine derivations

apply operators and functions to derivations

examine the derivation timing model

add derivations to a fact build

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-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:

source data in a fact build or dimension build

target data in a fact build

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.

A derivation can be one of the following:

5-4

a string literal

a calculation defined in terms of other Data Manager objects

Example of a calculation defined in terms


of other Data Manager objects: a
transformation model derivation that uses
other elements that exist within the
transformation model.

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).

CREATE

DERIVATIONS

Where Can You Create a Derivation?


You can create a derivation in:

a data source of a fact build or dimension build

the DataStream of a fact build or dimension build

the transformation model of a fact build

Perform derivations in the data source when:

you have more than one data source, but the derivation is only to be
performed on one

the result of the derivation is to be used as an input for other derivations in


the DataStream

Perform derivations in the DataStream when the:

same calculation is used for each of the data sources, that is, the data for
each data source must undergo the same derivation

result of the derivation is required before the data is used in the


transformation model, that is, the derivation concatenates keys before the
result is used in the transformation model for a reference structure

result of the derivation is to be pivoted

Perform derivations in the transformation model when:

values are only available after the data has been merged

data is only available after pivoting has been performed

data uses input values that are stored from reference structures

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-5

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

When to Use a Derivation?


Use a derivation when:

you want to perform data cleansing or standardization

you want to avoid performing calculations in the SQL


statement of a data source

certain key performance indicators (KPIs) must be derived

a calculation must be stored in the data mart that is shared by


users

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.

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).

CREATE

DERIVATIONS

Use Operators in Derivations


When creating derivations, you can use:

mathematical operators (for example, +)

logical operators (for example, BETWEEN)

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.

there are two exceptions: the minus


operator and brackets. The minus
operator negates its operand (for
example, 2 - 1 = 1). Brackets force
expression evaluation order (for
example, (2 + 2) * 3 = 12).
Expressions can contain more than
one operator. In such cases, Data
Manager applies the operators in
order of precedence. If brackets are
included in the expression, they will
affect the evaluation order, as shown
in the example above (note that the
result is 12, not 8).

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-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.

Use Functions in Derivations


Function Type

Examples

Conversion

ToChar(), ToDate(), ToInteger()

Control

RowsUpdated(), Exit(), SQL(), LogMsg()

Logical

If(), IfNull()

Mathematical

Abs(), Floor(), Trunc(), Round(), Mod()

Member

Member(), Level(), IsAncestor()

Text

Char(), Concat(), Trim(), Length()

Date

AddToDate(), SysDate(), DaysBetween()

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

Text functions perform calculations on strings.

Mathematical functions return the results of mathematical calculations.

Logical functions return their results dependent on some test.

Conversion functions convert data from one data type to another.

Date functions perform calculations on date values, return date values, or


both.

Control functions give some control over how Data Manager executes a
build.

Member functions refer to the Data Manager dimensional framework.


Therefore, they are valid only within the context of Data Manager builds.

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).

CREATE

DERIVATIONS

Create a Data Source Derivation

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.

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-9

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Create a DataStream Derivation

Add

Calculate

Test

To create a DataStream derivation:


1. Add a derivation to the DataStream 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-10

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).

CREATE

DERIVATIONS

Create a Transformation Model Derivation


Add

Calculate

Test

To create a transformation model derivation:


1. Add a derivation element to the transformation model of the fact build.
2. Provide a name for it and create a calculated expression using operators,
functions, or control statements. If the build has deliveries defined, you can
add the derivation to the deliveries.

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.

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-11

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Calculate a Derivation in the Transformation


Model
By default, a transformation model derivation is calculated after the
data is aggregated (summarized).
You can choose to calculate the derivation before aggregation.
Select the Calculate at Source box to calculate
first and then aggregate

Select an aggregation method

AverageRevenue
Quantity * UnitCost
MEASURE

MEASURE

Revenue

(Quantity*UnitCost)

DERIVATION

AVGRevenue
AGGREGATION

Data Manager provides two options for calculating derivations:

Perform the calculation first, and then aggregate (summarize) the


calculated results. This method can eliminate rounding errors in the
summary data.

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.

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).

CREATE

DERIVATIONS

Examine the Derivation Timing Model


Data
Source
Data

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.

the same DataStream. The same rule


applies for data source and transformation
model derivations.
Derivations are evaluated in the order they
are specified in the user interface. If
necessary, you can reorder them.

This timing model also applies to


derivations created in the DataStream or
If your derivation is returning unexpected results, it may be due to where you have data source of a hierarchy, except that
there is no concept of a transformation
placed it in the fact build. You may move the derivation (for example, from the
model within a hierarchy.

data source to the DataStream) in order to get the values that you want.

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-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

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).

CREATE

DERIVATIONS

Demo 1: Add Derivation Elements to a Fact Build


Purpose:
Business analysts at The Great Outdoors Company want to see
which products have generated the greatest total sales and
profit. Therefore, you will create a derivation that calculates the
total sales of each product, and then create a second derivation
that references the first to calculate total profit.
Task 1. Add a derivation element to a fact build that
calculates the total sales of each product.
1. Open Data Manager.
2. In the Welcome dialog box, click Open an existing catalog.

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.

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-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:

Task 3. Test the calculation formula for SalesTotal.


1. Click Test.
The Values for Expression window opens. 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

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).

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)

4. In the left pane, double-click Operators and Mathematical, and then


double-click - to add the subtraction operator to the expression.
5. In the left pane, double-click Operators and Mathematical, and then
double-click ( to add the left bracket to the expression.
6. In the left pane, double-click Elements, and then double-click UnitCost to
add it to the expression.
7. In the left pane, double-click Operators and Mathematical, and then
double-click * to add the multiplication sign to the expression.
8. In the left pane, double-click Elements, and then double-click Quantity to
add it to the expression.
9. In the left pane, double-click Operators and Mathematical, and then
double-click ) to add the right bracket to the expression.
The result appears as shown below:

Task 5. Test the calculation formula for ProfitTotal.


1. Click Test.
The Values for Expression window opens.
Check marks to the left of SalesTotal, UnitCost, and Quantity 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. Double-click the Value column to the right of SalesTotal, type 125, and
then press Enter.
3. 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.
4. Double-click the Value column to the right of UnitCost, type 20, and then
press Enter.
5. Click the Type column to the right of Quantity, and then click the ellipsis.
The Data Type dialog box opens.
6. In the Data type list, click NUMBER, and then click OK.

5-18

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).

CREATE

DERIVATIONS

7. Repeat steps 5 and 6 for UnitCost and SalesTotal.


8. Click Calculate.
The result appears as shown below:

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.

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-19

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Task 6. Execute the fact build and view the results.


1. In the tree, click DemoSales, save the catalog, and then on the toolbar,
click Execute.
The fact build runs and 100 rows of transactional data are loaded into the
F_DemoSales table of the data mart.
2. Press Enter to close the command window.
3. Open SQLTerm, and then in the Database list, click TargetConnect.
4. In the Database objects pane, expand TargetConnect and dbo, right-click
F_DemoSales, and then click Add table select statement.
A SELECT statement is added to the Query pane.
5. Click Return all rows.
100 rows of data are returned. The SalesTotal and ProfitTotal columns
contain data that was calculated by the two derivations that you created
previously. The result appears as shown below (the rows may be sorted
differently, but this is acceptable):

6. Close SQLTerm, and then close Data Manager.


Results:
You created a derivation that calculates the total sales of each
product. You then created a second derivation that referenced
the first to calculate the total profit.

5-20

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).

CREATE

DERIVATIONS

Summary
In this module, we have:

examined derivations

applied operators and functions to derivations

examined the derivation timing model

added derivations to a fact build

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-21

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

5-22

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).

Create Conformed Dimensions

IBM Cognos 8 BI

2008 IBM Corporation

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

6-2

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).

CREATE

CONFORMED

DIMENSIONS

Objectives
In this module, we will:

examine conformed dimensions and their advantages

design conformed dimensions

create conformed dimensions

create data integrity lookups that use conformed dimensions

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-3

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Review: A Private Data Mart


We created a data mart containing one fact table and three
dimension tables. We delivered all the tables by executing a fact
build.
What if we want to add another fact table called F_Sales that will
reference the three existing dimension tables?

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.

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).

CREATE

CONFORMED

DIMENSIONS

Examine Conformed Dimensions


When multiple fact tables can share a dimension, we say that the
dimension is conformed.

Location

Sales Fact

Time

Customer

Distribution Fact

Distributor

Product

Order Fact

Promotion

Conformed Dimensions

Conformed Dimensions

Conformed dimensions are crucial to an enterprise data warehouse.

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.

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-5

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Advantages of Conformed Dimensions


1. Reduce development time.
2. Enable changes to the data warehouse.
3. Deliver a consistent view across your business.

Branches

Products

Sales
HR

Customer

Sales
Fact

Time

Sales Data Mart

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.

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).

CREATE

CONFORMED

DIMENSIONS

Design Conformed Dimensions: Guidelines


1. Lay out a broad dimension map for the enterprise.
2. Identify the most granular (atomic) fact table and define conformed
dimensions at the same granular level.
3. Conformed dimensions should always use surrogate keys.
4. Define standard names for dimension and fact attributes.

1. Designing conformed dimensions is a process that requires careful analysis.


Start by identifying what dimensions you need, what hierarchy levels must
be represented, and what attributes each dimension will have. The latter
requires that you analyze the data sources: what tables are available, how
similar their structures are, and how to merge these structures.
2. A critical requirement for designing conformed dimensions is to keep the
data structure at the lowest level of granularity. If the lowest level of data
that you keep in the warehouse is summarized, you have lost any ability to
analyze at the atomic level.
3. Use surrogate keys for performance and tracking of history.
4. Data often comes from different operational systems. These separate
sources may have different names for identical entities. Establishing
standards for dimension and fact table attributes ensures that attributes with
different interpretations get different names and, equally important, that
attributes with the same interpretation get the same name.

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."

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-7

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Map Conformed Dimensions


Identifying and designing the conformed dimensions is a critical
step in the architecture phase of data warehouse design.
You have to decide from the beginning which dimensions will be
referenced by a single fact table. If the same dimension is
referenced in several tables, it becomes a conformed dimension.

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

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).

CREATE

CONFORMED

DIMENSIONS

Granularity in Conformed Dimensions


Conformed dimensions should be defined at the most granular
(atomic) level so that each row in these tables corresponds to a
single row in the base-level fact table.

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.

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-9

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Granularity in Conformed Dimensions (cont'd)


For multiple granularity fact tables, higher level views of dimensions
(or a snowflake table) can be used.
View or Snowflake table
Time Dimension
Customer
Customer Id
Last Name
First Name
Address

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

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).

CREATE

CONFORMED

Examine Surrogate Keys

Surrogate keys are numeric keys that can replace business keys in
the context of a data mart.

Advantages of surrogate keys:


1.

numeric

2.

unique

3.

allow you to combine data

4.

have no intrinsic meaning


Sales Rep Dimension Table

Sales Fact Table


RepSur Order
RepSur
Order
Date
Key
Date

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.

Using these surrogate keys, we can


correctly associate each of her sales
in the Sales Fact table with the
appropriate office.

3. Using surrogate keys, you can combine data from tables with incompatible
keys.

For example, the sale that she made


on 1/1/2008 is associated to the
Dallas office (surrogate key value
11111), while the sale that she made
on 3/1/2008 is associated to the New
York City office (surrogate key value
11112).

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.

The diagram in the slide depicts a


"Type 2" change in the Sales Rep
dimension. We will examine slowly
changing dimensions in detail later in
this course.

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-11

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Use Surrogate Keys in Conformed Dimensions


Surrogate keys are an important part of conformed dimensions, as
they serve as links between dimension tables and fact tables.
ProductKey (PK)
ProductCode
ProductName
ProductTypeCode
...
ProductKey (FK)
SalesRepKey (FK)
SalesRepKey (PK)

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.

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).

CREATE

CONFORMED

DIMENSIONS

Examine Slowly Changing Dimensions (SCDs)


OLTP systems tend to contain data about the current state of the
business.
A data warehouse is expected to hold data for several years.
Therefore, dimension data in the warehouse must often reflect
changes over time.
The term "Slowly Changing Dimension" (SCD) refers to this behavior.
By using surrogate keys, we can track these changes in the data
warehouse.

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.

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-13

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Examine Issues With Slowly Changing Dimensions


Maintaining SCDs can be complex without surrogates.
Business
Key
Surrogate

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)

** (Emp. No + Branch + Position)


*** (Emp. No + Branch + Position + Salary)

As the key gets larger and larger, the


fact table would become difficult to
manage and query against.

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

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).

CREATE

CONFORMED

DIMENSIONS

Use Different Methods to Handle Slowly Changing


Dimensions
Two most common ways of handling changing dimension data
(according to Kimball):

Type 1 - Overwrite the old value with the new value (do not
track the changes).

Type 2 - Add a new dimension row with a new surrogate key


(track changes over time).

A single row may have a combination of columns of different types.

The choice of method largely depends on the business's need to track changes. By
far, the most commonly accepted methods are:

Type 1 - where no historical row is required

Type 2 - where an accurate historical row is required at any stage

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.

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-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.

Standardize Dimension Attributes


Data for an integrated data warehouse with conformed dimensions
can come from different legacy systems and outside sources.
When designing a data warehouse, make the data from different
sources consistent by using standardized attributes.
Product
ProductCode
ProdName
ProdDesc

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

However, the structure of the two


tables is different. In the Oracle
database, the Product table has
ProductCode, ProdName, and
ProdDesc as attributes. In the
Sybase database, the Product table
has ProdKey, Name, and Desc as
the attributes.
When you merge these two tables,
you must decide on common column
names.
A more significant problem is that the
data values between the source
tables may differ. In the slide
example, a single product is
identified by different product codes
and even different descriptions in the
two separate systems.
To merge these together as a single
member in the product hierarchy, the
data must be "cleansed". Data
cleansing is a complicated and timeconsuming problem in data
warehousing, and is not covered in
great detail in this course.
However, Appendix D,
"Standardizing Facts and
Dimensions Exercise" contains an
example of how to use Data
Manager to standardize incoming
fact and dimensional data.

6-16

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).

CREATE

CONFORMED

DIMENSIONS

Standardize Fact Definitions


Like dimensions, fact attributes should also be conformed.

Sales
(Gross)
Profit

Gross Profit

Profit

SalesFact
(Gross Profit)
(Net Profit)

Net Profit
Finance
(Net)
Profit

The identification of standard fact definitions is done at the beginning of the


development process, when the conformed dimensions are established. Users need
the standard fact definitions to use the same terminology for the same
interpretation or different terminology for different interpretation across data
marts.
The most common measures that require standardization are Profit, Cost, Price,
and Revenue. If two operational systems both use an identical term but their
definitions differ, the warehouse should use different names to properly identify
each measure.

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.

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-17

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Create Conformed Data Marts: Overview

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.

Create dimension builds which maintain surrogate keys.

3.

Create data integrity lookups that include surrogate keys.

4.

Create fact builds which reference the lookups and use


surrogate keys.

5.

Create a JobStream which includes all of the necessary builds.

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).

CREATE

CONFORMED

DIMENSIONS

Deliver Conformed Dimensions with Dimension


Builds
Dimension data is delivered to conformed dimensions through
dimension builds.
The dimension builds maintain surrogate keys.

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.

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-19

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 1
Create Conformed
Dimension Builds

6-20

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).

CREATE

CONFORMED

DIMENSIONS

Demo 1: Create Conformed Dimension Builds


Purpose:
Business analysts at The Great Outdoors Company want to
create queries and reports that use historical sales data. To
provide this data in an easy-to-access format, you will build a
small data mart that contains conformed dimension tables. To
this end, you will create and execute three dimension builds
based on three existing hierarchies in Day1Catalog. The result
will be three dimension tables, each of which will contain
surrogate keys.
Task 1. Create the dimension builds.
1. Open Data Manager.
2. In the Welcome dialog box, click Open an existing catalog.
The Open Catalog dialog box appears.
3. In the left pane, ensure that ODBC is selected, in the Data Source Name
list, click Day1Catalog, and then click OK.
Day1Catalog opens in Data Manager Designer.
4. On the toolbar, click Start the Dimension Build Wizard.
The Dimension Build wizard opens.
5. In the Name box, type D_ProductH, click Next, and then in the
Dimension to be delivered list, click Product.
Because Product is the only hierarchy in this dimension, it is selected
automatically in the Reference item to be delivered list.
6. In the Deliver into connection list, click Output, click Next, and then in
the Column naming strategy list, select Level and Attribute.
By selecting Level and Attribute in the Column naming strategy list, each
column of the dimension table will be named using a combination of the
level name and the attribute (such as the caption).
7. Click Next, click Next, and then click Next again.
8. Select the Add Surrogate Keys to the Dimension Tables check box
(DO NOT select the Add Change Tracking Attributes to the Dimension
Tables check box), click Next, and then click Finish.
The result appears as shown below:

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.

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-21

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

9. Repeat steps 4 to 8 to create two dimension builds called D_FiscalH and


D_LocationH. The D_FiscalH build is based on the Fiscal dimension, and
the D_LocationH build is based on the Location dimension. In step 6, DO
NOT select Level and Attribute in the Column naming strategy list. Leave
the default item selected (Attribute).
The tree appears as shown below:

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:

12. Click OK.


13. Repeat steps 10 to 12 to rename skey in the D_Fiscal template (for the
D_FiscalH dimension build) to period_skey.
14. Repeat steps 10 to 12 to rename skey in the D_Product template (for the
D_ProductH dimension build) to product_skey.
Task 2. Execute the dimension builds.
1. Save the catalog, in the tree, click the D_FiscalH dimension build, and
then on the toolbar, click Execute.
The build executes and delivers 36 rows to the D_Fiscal dimension table.

6-22

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).

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:

Each row of dimension data includes a surrogate key value in the


period_skey column. Each of the values in the period_skey column is a
unique four-byte integer.
8. Click the Clear the query and Clear test results buttons, and then repeat
step 7 for the D_Location and D_Product tables.
Both tables, like the D_Fiscal table, contain a surrogate key column with
unique surrogate key values. In the D_Location table, the surrogate key
column is called state_skey. In the D_Product table, the surrogate key is
called product_skey. These surrogate key values will be important in the
remaining demos in this module.
9. Close SQLTerm.
Results:
You created and executed three dimension builds based on
three existing hierarchies in Day1Catalog. The result was three
dimension tables, each of which contains surrogate keys.

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-23

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Reference Structures for Fact Builds


A fact build can use either multilevel (hierarchy) or single-level
(lookup) reference structures.
Hierarchy

Lookup
AllProducts

Product Line

Product Type

Product

A hierarchy presents a particular view of a multilevel business dimension. The levels


of the structure represent parent-child relationships between members of adjacent
Technical Information
A lookup consists of a single
hierarchy levels.
A lookup is a simple, single-level reference structure. There are no parent-child
relationships in its structure. You can create a lookup for any level of a dimension.

DataStream and, optionally, a set of


static members. Static members are
discussed later in this course.

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.

there is no need to roll this data up to


a higher level.

6-24

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).

CREATE

CONFORMED

DIMENSIONS

Use Reference Structures with Fact Builds


Use lookups if you only
want to perform:

data integrity
checking

surrogate key
substitution

You must use hierarchies


if you want to perform
aggregation.

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.

surrogate key substitution. As a result,


each value in the period_no, state_cd,
and product_cd columns of the fact table
is validated against a corresponding
value in the appropriate lookup
(D_FiscalL, D_LocationL, or
D_ProductL).
In the bottom slide example, the
PRODUCT_NUMBER,
RETAILER_SITE_CODE, and
SALES_STAFF_CODE columns of the
fact table reference multi-level
hierarchies instead of lookups. We can
use these hierarchies to roll up
(aggregate) the fact data by any level in
the Product, Retailer, or Staff dimension.
For example, we may want to see sales
data summarized by product line rather
than by individual product.
Technical Information
On demand caching can only be used
with lookups, not hierarchies.

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-25

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Data Integrity Lookups: Overview


For data integrity checking, you only need the atomic level business
key and surrogate key.
Lookups are often sufficient for this purpose.

It is recommended that you refer to this


slide as often as necessary to continually
emphasize the "best practice" way of
using conformed dimensions.

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

Point out to the students that there are


usually two hierarchies for every
dimension. One hierarchy points to the
operational system, and another
hierarchy or lookup points to the
dimension table in the warehouse, as
shown in the slide.

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.

The hierarchy that points to the


dimension table should use the same
template that was created in the
dimension build. Using this template
helps to reduce the number of templates.
This is indicated in the slide by showing
only one template.
Templates will be covered later in this
course.
In the slide example, data from the
Product hierarchy is delivered to the
D_Product conformed dimension table
through a dimension build. This
dimension table references a template,
which lists the columns in the table and
how they behave.
The D_Product table is then referenced
by a lookup. This lookup only contains
the data necessary to perform data
integrity checking. The Sales fact build,
in turn, references this lookup. When the
Sales fact build processes incoming
transactional data, the lookup is used to
ensure that each transaction refers to a
product that already exists in the
D_Product table.

6-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).

CREATE

CONFORMED

DIMENSIONS

Create a Data Integrity Lookup


1. Select an existing dimension.
2. Create and name the lookup.
3. Select the dimension table template and required attributes.
4. Use a template for data access and select the source database and
table.
5. Reference the lookup in one or more fact builds using a dimension
element.

The process of creating a lookup is similar to creating a hierarchy within a


dimension.

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.

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-27

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 2
Create Data Integrity
Lookups

6-28

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).

CREATE

CONFORMED

DIMENSIONS

Demo 2: Create Data Integrity Lookups


Purpose:
In the process of building a data mart for use by the Great
Outdoors, you previously created three dimension builds and
then executed the builds to deliver three conformed dimension
tables. You will use these tables as the basis for three data
integrity lookups. Once you have created the lookups, you can
use them to validate incoming fact data.
Task 1. Create the FiscalL lookup.
1. In the tree, expand Dimensions, right-click Fiscal, and then click Insert
Lookup.
The Lookup Properties window opens.
2. In the Name box, type FiscalL, and then click the Attributes tab.
3. In the Template list, click D_Fiscal.
The attributes in the D_Fiscal template appear in the Available attributes
pane. The Dimension Build wizard created this template automatically
when you created the D_FiscalH dimension build in Demo 1. An attribute
was created for each column in the D_FiscalH table.
Because you are creating a data integrity lookup, you do not require all the
attributes in the template. You only need to add the minimum necessary to
perform fact data integrity checking; in this case, the surrogate key
(period_skey) and the business key (period_no).
4. In the Available attributes pane, double-click period_skey and period_no
to add them to the Chosen attributes pane.
5. In the period_no row, select the Id check box.
The result appears as shown below:

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.

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-29

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

8. Double-click dbo, click D_Fiscal, and then click OK.


9. Click OK to close the Lookup Properties window.
The result appears as shown below:

Task 2. Create the LocationL lookup.


1. In the tree, under the Dimensions folder, right-click Location, and then
click Insert Lookup.
The Lookup Properties window opens.
2. In the Name box, type LocationL, and then click the Attributes tab.
3. In the Template box, click D_Location1.
You are using the D_Location1 template instead of the D_Location
template. This is because the D_Location template was created for the
Location dimension build that you constructed in Demo 1 of Module 4,
and it does not include a surrogate key attribute. The D_Location1
template was created specifically for the D_LocationH dimension build
that you created in Demo 1 of this module, and it does include a surrogate
key attribute. As a result, you want to use the D_Location1 template as
the basis for the LocationL lookup.
4. In the Available attributes pane, double-click state_skey and state_cd to
add them to the Chosen attributes pane.
5. In the state_cd row, select the Id check box.
The result appears as shown below:

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

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).

CREATE

CONFORMED

DIMENSIONS

Task 3. Create the ProductL lookup.


1. In the tree, under the Dimensions folder, right-click Product, and then
click Insert Lookup.
The Lookup Properties window opens.
2. In the Name box, type ProductL, and then click the Attributes tab.
3. In the Template list, click D_Product.
4. In the Available attributes pane, double-click product_skey and
Product_product_cd to add them to the Chosen attributes pane.
5. In the Product_product_cd row, select the Id box.
The result appears as shown below:

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:

10. Save the catalog.

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-31

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Task 4. Explore the lookups.


1. Right-click the LocationL lookup, click Explore, and then click OK.
The LocationL lookup opens in Reference Explorer. There are 51 members
in this lookup.
2. In the Elements pane, click (AK).
In the Attributes pane on the right side, you can see that this member has
two attributes: an Id value of AK and a surrogate key value of 1. In a related
fact table, it will be the surrogate key value that is used for data integrity
checking, not the Id value.
3. Close Reference Explorer.
4. Repeat steps 1 and 2 to explore the FiscalL and ProductL lookups, and
then close Reference Explorer.
Results:
You created three data integrity lookups that you can use to
validate incoming fact data.

6-32

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).

CREATE

CONFORMED

DIMENSIONS

Demo 3
Create a Fact Build that
References Data
Integrity Lookups

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-33

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 3: Create a Fact Build that References Data


Integrity Lookups
Purpose:
In the previous demo, you created three lookups that reference
data from three conformed dimension tables. You will now
create a fact build that includes dimension elements that refer to
these lookups. By referencing these lookups, you can perform
surrogate key substitution. You will then execute the fact build
and view the results.
Task 1. Create the Sales fact build using the fact build
wizard.
1. On the toolbar, click Start the Fact Build Wizard.
The Fact Build wizard opens.
2. In the Enter the name of the build box, type Sales, in the Select the
connection into which the build is to deliver data list, click Output, and
then click Next.
3. Click Data Source, and then click Add.
The Data Source wizard opens.
4. In the Select the connection from which the data source is to read list, click
Sales, and then click Next.
5. Expand dbo, select the dm_sales check box, and then click Finish.
The data source is added to the build and a default transformation model is
specified. You will now modify three of the DataStream items so that they
are named the same as the surrogate keys that they will reference. This
naming convention will be carried over to the dimension elements of the
transformation model, and then to the columns of the resulting fact table.
6. In the Transformation Model pane, right-click the period_no row, and
then click Rename.
7. Type period_skey, and then press Enter.
8. Repeat steps 6 and 7 to rename state_cd to state_skey, and product_cd to
product_skey.
The result appears as shown below:

6-34

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).

CREATE

CONFORMED

DIMENSIONS

9. Click Next, and then click Next again.


10. Click in the Use Reference column of the period_skey dimension, click
the ellipsis, expand the Fiscal dimension, and then click the FiscalL
lookup.
11. Repeat step 7 for the state_skey and product_skey elements, referencing
the LocationL and ProductL lookups, respectively.
The result appears as shown below:

12.
13.
14.
15.

Click Next, click Next, and then click Next again.


Click Next, clear the Deliver dimensions check box, and then click Next.
Click Finish.
In the tree, click the Sales fact build (if necessary).
The Visualization pane appears as shown below:

16. In the Visualization pane, click the Transformation Model tab.


The result appears as shown below:

Each of the three dimension elements in the fact build (period_skey,


state_skey, and product_skey) references a separate data integrity lookup.
When you execute the fact build, each incoming business key value (for
example, a particular product code) will be matched against an existing one in
the appropriate lookup. This business key value will be substituted with the
appropriate surrogate key value, which will then be inserted into the fact table.

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-35

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Task 2. Execute the fact build and view the results.


1. Save the catalog, ensure that the Sales fact build is selected, and then on
the toolbar, click Execute.
The fact build executes and delivers 10,323 rows to the F_Sales fact table.
In the process, 206 rows were rejected. These rows were rejected due to an
invalid state code. You can flag these invalid state codes by creating an
optional lookup. Optional lookups are covered elsewhere in the course.
2. When the build has finished executing, 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_Sales, and then click Add table select statement.
A SELECT statement is added to the Query pane.
5. Click Return all rows.
Data Manager returns 10,323 rows of data. The result appears as shown
below:

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.

Each of the values in the period_skey, state_skey, and product_skey


columns is a surrogate key value. Each incoming business key value (such as
200701) was evaluated against an existing one in the appropriate lookup (in
this case, FiscalL). The business key value was then substituted with the
correct surrogate key before being inserted into the fact table.
6. Close SQLTerm.
Results:
You created a fact build that includes dimension elements that
refer to lookups. By referencing these lookups, you performed
surrogate key substitution. You then executed the fact build and
viewed the results.

6-36

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).

CREATE

CONFORMED

DIMENSIONS

Create Conformed Dimensions: Review


Input Hierarchies

Conformed Dimensions

Reference
Data
Reference
Sources

Data Sources
Product

Updates

Customer

Dimension Builds
Product

Customer

1. Create input hierarchies.

D_Customer
D_Customer

Customer

Product

D_Product
D_Product

2. Create and execute dimension builds


(include surrogate keys in the
dimension tables).

Data Warehouse

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-37

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Use Conformed Dimensions: Review


1. Create a second hierarchy or lookup
from each dimension table.
2. Reference these structures in fact build
dimension elements.

Conformed Dimensions

D_Customer
D_Customer

Avoid delivering dimension tables in


fact builds. (Best Practice)
Dimension Table
Hierarchies/Lookups
D_Product

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

...

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).

CREATE

CONFORMED

DIMENSIONS

Summary
In this module, we have:

examined conformed dimensions and their advantages

designed conformed dimensions

created conformed dimensions

created data integrity lookups that use conformed dimensions

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-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

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).

CREATE

CONFORMED

DIMENSIONS

Workshop 1: Create a Lookup and a Fact Table that Use


Conformed Dimensions
The Great Outdoors has forecast data that it uses to predict sales for future fiscal
years. These forecasts are tracked by quarter, rather than by month. You need to
create a star schema that includes this forecast data in a central fact table. You must
also create a time-based lookup that stores data at the quarter level. You then need
to create a new fact table containing forecast data that references this new lookup,
as well as two existing lookups (LocationL and ProductL).
To accomplish this:

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.

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-41

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 1: Task Table


TASK

WHERE TO WORK

HINTS

1. Create the QuarterL


lookup.

Dimensions folder, Build tree

Use the D_Fiscal


template.

Include the fiscal_qtr


attribute and specify it as
the ID attribute.

Use a template for data


access:

Connection: Output

Table: D_Fiscal

Use DISTINCT in
template table SELECT
statement.

Use the dm_forecast table


(in the Sales connection)
as the data source.

On the Create the


DataStream page of the
Fact Build wizard, rename
qtr_no to fiscal_qtr,
state_cd to state_skey, and
product_cd to
product_skey.

Right-click the F_Forecast


fact table to obtain a
SELECT statement.

2. Create the Forecast fact


build.

3. Execute the fact build and


view the results.

Fact Build wizard

SQLTerm

If you need more information to complete a task, see the Step-by-Step instructions
at the end of this workshop.

6-42

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).

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:

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-43

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 1: Step-by-Step Instructions


Task 1. Create the QuarterL lookup.
1. In the tree, under the Dimensions folder, right-click the Fiscal dimension,
and then click Insert Lookup.
The Lookup Properties window opens.
2. In the Name box, type QuarterL, and then click the Attributes tab.
3. In the Template list, click D_Fiscal, and then double-click the fiscal_qtr
attribute to add it to the Chosen attributes pane.
4. In the fiscal_qtr row, select the Id check box, and then click the Data
Access tab.
5. Select Use Template for data access, in the Connection list, click
Output, and then beside the Table name box, click Browse.
The Select Table dialog box appears.
6. Double-click dbo, click D_Fiscal, and then click OK.
7. Select the Use DISTINCT in template SELECT statement check box.
8. Click OK to close the Lookup Properties window.
Task 2. Create the Forecast fact build.
1. On the toolbar, click Start the Fact Build Wizard.
The Fact Build wizard opens.
2. In the Enter the name of the build box, type Forecast, in the Select the
connection into which the build is to deliver data list, click Output, and
then click Next.
3. Click Data Source, and then click Add.
The Data Source wizard opens.
4. In the Select the connection from which the data source is to read box, click
Sales, and then click Next.
5. Expand dbo, select the dm_forecast check box, and then click Finish.
6. In the Transformation Model pane, right-click quarter_no, and then click
Rename.
7. Type fiscal_qtr, and then press Enter.

6-44

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).

CREATE

CONFORMED

DIMENSIONS

8. Repeat steps 6 and 7 to rename state_cd to state_skey and product_cd to


product_skey.
The results appear as shown below:

9. Click Next, and then click Next again.


10. Click in the Use Reference column of the fiscal_qtr row, click the ellipsis,
expand Fiscal, and then click QuarterL.
11. Repeat step 10 for the state_skey and product_skey elements, using the
LocationL and ProductL lookups, respectively.
The result appears as shown below:

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

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).

Customize Reference Structures

IBM Cognos 8 BI

2008 IBM Corporation

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

7-2

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Objectives
In this module, we will:

create hierarchies manually using different approaches

examine the features of a hierarchy

examine literals

set data access for hierarchy levels

examine static and dynamic members

examine fostering

use derivations in a hierarchy

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-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.

Manually Create a Hierarchy: Overview


1. Create or select a dimension.

2. Insert the hierarchy.

3. Create a template and define the


attributes of the hierarchy.

4. Add a level and select its attributes


(as Id, Caption, Parent, others).

5. Define the data source(s) for the


level (as SQL statement(s)).
6. Map the data source columns to the
DataStream items.

3
6

7. Map the level attributes to the


DataStream items.
8. Explore the hierarchy.

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.

Technical Information (Cont'd)


Sometimes database columns can play more than one role in a hierarchy. For example, a
column returned by a SELECT statement can simultaneously serve as the ID and caption for a
level.

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.

The best practice is to define all attributes


for the hierarchy within one template, and
then use that template when adding each
level to the hierarchy.
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).

CUSTOMIZE

REFERENCE

Specify Features for a Hierarchy


Determine if and how data quality problems are to be handled by
specifying the hierarchy features.

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.

Determine how many detailed


warnings are to appear

Your situation

Option

You want to accept the item without receiving a warning.

Accept

You want to accept the item, but write a message to the log file.

Warn

You want to reject the item without receiving a warning message.

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

For example, lets say that you have a


Product dimension in your PowerCube. If
the category code for Camping Equipment
(at the Product Line level) is 1, then the
category code for Cooking Gear (at the
Product Type level) cannot also be 1.
When generating category codes,
Transformer will automatically ensure that
they are unique at each level if the source
values (from which the categories are
derived) are not already unique in the data
warehouse. For example, Transformer will
convert the category code for Cooking
Gear from 1 to something like 1~456.
Among other things, having tilde
characters (~) in your PowerCube
category codes can create problems with
drill-through reports (for example, from
Analysis Studio to Report Studio) that use
a PowerCube as a data source.

Technical Information (contd)


You can prevent Transformer from automatically generating these unique category codes by
ensuring that your data warehouse has unique IDs at each level of the dimension tables.
To do this, when building the hierarchies on which your dimension tables will be based, set the
Non-unique Ids feature to something other than Accept. Then, if you encounter non-unique IDs,
you can modify them to ensure uniqueness before delivering dimension tables to your data
warehouse.

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-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

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Demo 1
Manually Create a
Hierarchy

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-7

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 1: Manually Create a Hierarchy


Purpose:
Business analysts at The Great Outdoors Company want to
include product-related data in their reports. To enable them to
do so, you must create the ProductH hierarchy, which will serve
as the basis for a conformed dimension table that analysts can
access in their reports. You will manually create the required
dimension, hierarchy, and template. You will also add a data
source for each level and map the columns of data to the
appropriate hierarchy attributes.
The ProductH hierarchy that you will create in this demo consists of three levels:
ProductLine, ProductType, and Product. Each level will have an ID and a caption
attribute. Because the ProductType and Product levels are lower in the hierarchy,
they will also have parent attributes linking them to the higher levels.
The source table relationships, columns, and attributes are outlined in the following
table:
Level

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

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Task 1. Insert the ProductD dimension and the ProductH


hierarchy.
1. Open Data Manager.
2. In the Welcome dialog box, click Open an existing catalog.
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.
6. Right-click the Dimensions folder, and then click Insert Reference
Dimension.
The Dimension Properties window opens.
7. In the Name box, type ProductD, and then click OK.
8. Right-click the ProductD dimension, and then click Insert Hierarchy.
The Hierarchy Properties window opens.
9. In the Name box, type ProductH.
10. Click the Features tab, and then in the Non-unique Ids list, click Accept.
11. Click OK.
Task 2. Create the ProductT template.
1. Under the ProductH hierarchy, right-click the Templates folder, and then
click Insert Template.
The Template Properties window opens.
2. In the Name box, type ProductT, and then click the Attributes tab.
3. Click Import Table.
The Select Table dialog box appears.
4. Expand SourceConnect and dbo, click GOSProductLine, and then click
OK.
The columns from the GOSProductLine table are added to the Attributes
tab.
5. Repeat steps 3 and 4 to import the columns of the GOSProductType and
GOSProduct tables.
6. Double-click the ProductLine row, type ProductLineName, and then
press Enter.

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-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

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Task 4. Add a data source to the ProductLine level and


perform the necessary mapping.
1. Expand the ProductLine level, right-click DataStream, and then click
Insert Data Source.
The Data Source Properties window opens.
2. Click the Query tab, in the Database list, click SourceConnect (if
necessary).
3. In the Database objects pane, expand SourceConnect and dbo, right-click
GOSProductLine, and then click Add table select statement.
4. 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 DataStream.
The result appears as shown below:

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:

10. Click OK, and then save the catalog.


11. In the Visualization pane, right-click the ProductH hierarchy, and then
click Explore.
Reference Explorer opens.
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-11

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

12. Click OK.


The result appears as shown below:

13. Close Reference Explorer.


Task 5. Insert the ProductType level and select its
attributes.
1. In the tree, right-click the ProductH hierarchy, and then click Insert Level.
The Level Properties window opens.
2. In the Name box, type ProductType, click the Attributes tab, and then in
the Template list, click ProductT.
3. In the Available attributes pane, double-click ProductLineCode,
ProductTypeCode, and ProductTypeName to add them to the Chosen
attributes pane.
4. In the ProductTypeCode row, select the Id check box, in the
ProductTypeName row, select the Caption check box, and then in the
ProductLineCode row, select the Parent check box.
The result appears as shown below:

5. Click OK.

7-12

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Task 6. Add a data source to the ProductType level and


perform the necessary mapping.
1. Expand the ProductType level, right-click DataStream, and then click
Insert Data Source.
The Data Source Properties window opens.
2. Click the Query tab, and then in the Database list, click SourceConnect (if
necessary).
3. In the Database objects pane, expand SourceConnect and dbo, right-click
GOSProductType, and then click Add table select statement.
4. 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 DataStream.
5. Click OK, in the Visualization pane, right-click the DataStream for the
ProductType level, 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 ProductType 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 ProductTypeName from the Level Attributes pane to the
row beside the ProductType DataStream item, and then drag and drop
ProductTypeCode from the Level Attributes pane to the row beside the
ProductTypeCode Name DataStream item.
The result appears as shown below:

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.

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-13

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

12. Click OK, and then expand Camping Equipment.


The result appears as shown below:

13. Close Reference Explorer.


Task 7. Insert the Product level and select its attributes.
1. In the tree, right-click the ProductH hierarchy, and then click Insert Level.
The Level Properties window opens.
2. In the Name box, type Product, click the Attributes tab, and then in the
Template list, click ProductT.
3. In the Available Attributes pane, double-click ProductTypeCode,
ProductNumber, ProductName, ProductIntroductionDate,
ProductProductionCost, ProductMargin, ProductPicture,
ProductPictureURL, and ProductDescription to add them to the
Chosen attributes pane.
4. In the ProductNumber row, select the Id check box, in the ProductName
row, select the Caption check box, and then in the ProductTypeCode row,
select the Parent box.
The result appears as shown below:

5. Click OK.

7-14

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Task 8. Add a data source to the Product level and perform


the necessary mapping.
1. Expand the Product level, right-click DataStream, and then click Insert
Data Source.
The Data Source Properties window opens.
2. Click the Query tab, and then in the Database list, click SourceConnect.
3. In the Database objects pane, expand SourceConnect and dbo, right-click
GOSProduct, and then click Add table select statement.
4. Click the Result columns tab, ensure Prepare is selected, and then click
Refresh.
The columns of the data source are prepared for use in the DataStream.
5. Click OK, in the Visualization pane, right-click the DataStream for the
Product level, 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 Product level, and then
click Mapping.
The Level Mapping window opens.
8. Drag and drop the attributes from the Level Attributes pane so that the
result appears as shown below:

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.

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-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:

12. Close Reference Explorer.


Results:
You manually created the ProductD dimension, the ProductH
hierarchy, and the supporting ProductT template. You then
added a data source for each level and mapped the columns of
data to the appropriate attributes. Lastly, you examined the
hierarchy in Reference Explorer.

7-16

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Set Data Access for Hierarchy Levels


You can access data for each level of a hierarchy using either:

a template

data sources in the level or hierarchy DataStream

It is faster to create a hierarchy that uses template data access,


because no mapping is necessary.
Use a template for data access if:

the attribute names are identical to source column names

the attributes can be queried from a single table

no derivations are necessary

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

If you want to acquire data from


operational source systems, you will
data sources in the level or hierarchy DataStream
likely require custom SQL. Therefore,
template data access is rarely
A template creates its own SQL when it accesses data, which is very powerful when applicable against operational data,
unless you use a simple query. A basic
maintaining slowly changing dimensions (SCDs). However, you have no direct
control over the SQL that is created. If you want to write custom SQL statements SELECT statement only contains
column names from a single table. If
to acquire data for the hierarchy level, then you cannot use template data access.
you use template access, you cannot
join tables, calculate fields, or specify a
Use template data access in situations where no modification to an SQL statement WHERE, ORDER BY, or GROUP BY
is required. Template access requires you to specify a single table. If a DataStream
clause.

uses multiple tables, you cannot use template access.

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-17

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Use Templates in the Data Warehouse: Example


In a dimension, you will usually have two templates. The first
(source) template keeps track of incoming data.
The second (reference) template describes the columns of the target
dimension table, which includes surrogate key behavior.
Product

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.

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Static and Dynamic Members


Data Manager can use both dynamic members and static members to
populate each hierarchy level.
"ALL"

Static
member

Product
Classes
Product
Families

Dynamic
members

Products
Stock-keeping unit

Class
table
Family
table
Product
table
SKU
table

Use dynamic members when you want:

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

Use static members when:

you want the members to be predefined, not derived from SQL statements

you want to define an ALL member at the top of a hierarchy

you are tracking things that never change, such as months

the members you require do not exist explicitly in the source data

you want to create foster parent rows

member, not found in the database, to


the level.

Before adding a static member to a level,


ensure that you have the attributes for
that level already defined. To edit a static
member, double-click its cell, and then
enter a new value.

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-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

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Use a Derivation in a Hierarchy


If you need a calculated attribute, you can create it:
1.

in the SQL statement of the data source (avoid)

2.

as a derivation at the data source level (recommended)

3.

as a derivation at the DataStream level (recommended)


1

If you want to include a calculated attribute in a hierarchy level, it is recommended


that you create a derivation in the data source or DataStream of that level, instead
of modifying the source SQL. By creating using a derivation instead of modifying
the SQL, you reduce processing time.

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.

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-21

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Populate a Hierarchy Using Multiple


Data Sources
You can use multiple data sources in a hierarchy and hierarchy
levels.
Data must be accessed using a DataStream. The data from the
different sources is merged after it passes through the DataStream.
Merging in hierarchies is different from merging in fact builds.

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

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Multiple Data Sources and Derivations in


Hierarchies

This example will not produce a result, as the


derivation uses different data sources.

You can include a derivation in a data source or DataStream in a hierarchy. For


example, you can combine the FirstName and LastName items in the
DataStream instead of performing the same calculation in SQL.
Because merging is different in a hierarchy than in a fact build, derivations are
used differently. In a hierarchy or hierarchy level, you cannot create a derivation
that uses multiple data sources. A derivation that attempts to perform a
calculation that makes use of two or more different data sources may return
unexpected results.

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.

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-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

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Demo 2: Create a Hierarchy that Includes a Derivation


Purpose:
Managers want to create reports that contain data about the
sales staff of the Great Outdoors. To do so, you must create a
conformed dimension that will hold the necessary information.
You will create the StaffD dimension and the StaffH hierarchy.
You will then add a derivation to the lowest level of the hierarchy
that will concatenate the first and last name of each employee.
The StaffH hierarchy that you will create in this demo consists of three levels:
SalesCountry, SalesBranch, and SalesStaff. Each level will have an ID and a caption
attribute. All the levels except the top one (SalesCountry) will have a parent
attribute.
The source table relationships, columns, and attributes are outlined in the following
table.
Level
SalesCountry

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:

SalesFirstName (for example, Denis)


SalesLastName (for example, Pag)
SalesPosition
SalesWorkPhone
SalesExtension
SalesFax
SalesEmail
SalesDateHired

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

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-25

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Task 1. Create the StaffD dimension and the StaffH


hierarchy.
1. In the tree, right-click the Dimensions folder, and then click Insert
Reference Dimension.
The Dimension Properties window opens.
2. In the Name box, type StaffD, and then click OK.
3. Right-click the StaffD dimension, and then click Insert Hierarchy.
The Hierarchy Properties window opens.
4. In the Name box, type StaffH, and then click the Features tab.
5. In the Non-unique Ids list, click Accept, and then click OK.
Task 2. Create the StaffT template.
1. Under the StaffH hierarchy, right-click the Templates folder, and then
click Insert Template.
The Template Properties window opens.
2. In the Name box, type StaffT, and then click the Attributes tab.
3. Click Add, type SalesCountryCode, and then press Enter.
4. Repeat step 3 to add the remaining attributes so that the result appears as
shown below:

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

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Task 4. Create the data source for the SalesCountry level


and introduce the attribute names.
1. In the tree, expand the SalesCountry 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
GOSCountry, and then click Add table select statement.
4. In the Query box, modify the code so that it appears as shown below:

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:

8. Click OK, and then save the catalog.


9. In the Visualization pane, right-click the StaffH hierarchy, and then click
Explore.
The Reference Explorer window opens.
10. Click OK.
The top level of the hierarchy is shown. This level consists of countries,
such as France.
11. Close Reference Explorer.
Task 6. Create the SalesBranch level.
1. Right-click the StaffH hierarchy, and then click Insert Level.
The Level Properties window opens.
2. In the Name box, type SalesBranch, click the Attributes tab, and then in
the Template list, click StaffT.
3. In the Available attributes pane, double-click SalesCountryCode,
SalesBranchCode, and SalesBranchName to add them to the Chosen
attributes pane.
4. In the SalesCountryCode row, select the Parent check box, in the
SalesBranchCode row, select the Id check box, and then in the
SalesBranchName row, select the Caption check box.
5. Click OK.

7-28

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Task 7. Create the data source for the SalesBranch level


and introduce the attribute names.
1. In the tree, expand the SalesBranch 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
GOSSalesBranch, and then click Add table select statement.
4. Modify the SQL so that it appears as shown below:
SELECT

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.

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-29

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

6. In the DataStream Item column, click and drag SalesManagerCode to the


Level Attributes pane.
The Add Attribute dialog box appears.
7. In the Create a new attribute box, type SalesManagerCode, and then click OK.
8. Repeat step 7 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:

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.

Create the SalesStaff level.

1. Right-click the StaffH hierarchy, and then click Insert Level.


The Level Properties window opens.
2. In the Name box, type SalesStaff, click the Attributes tab, and then in the
Template list, click StaffT.
3. In the Available attributes pane, double-click SalesBranchCode,
SalesStaffCode, and SalesStaffName to add them to the Chosen
attributes pane.
4. In the SalesBranchCode row, select the Parent check box, in the
SalesStaffCode row, select the Id check box, and then in the
SalesStaffName row, select the Caption check box.
5. Click OK.

7-30

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).

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.

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-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

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).

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.

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-33

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Summary
In this module, we have:

7-34

created hierarchies manually using different approaches

examined the features of a hierarchy

examined literals

set data access for hierarchy levels

examined static and dynamic members

examined fostering

used derivations in a hierarchy

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Workshop 1
Create Dimension Builds

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-35

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 1: Create Dimension Builds


To deliver dimension data to the data mart, you must create and execute dimension
builds that reference the ProductH, VendorH, TimeH, and StaffH hierarchies.
These builds will include surrogate keys that start at 1000, which will help
distinguish them from the business keys, which start at 1. All the builds except the
one delivering the TimeH hierarchy will include change tracking attributes.
To accomplish this:

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.

Configure the D_ProductH output template by renaming the skey attribute


to product_skey and setting the start value to 1000. Modify the properties
of the dimension build so that the log file includes Progress, Detail, and
Executed SQL messages.

Execute the D_ProductH dimension build and examine the resulting


dimension table in SQLTerm.

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.

Configure the D_VendorH output template by renaming the skey attribute


to vendorsite_skey and setting the start value to 1000. Modify the properties
of the dimension build so that the log file includes Progress, Detail, and
Executed SQL messages.

Execute the D_VendorH dimension build and examine the resulting


dimension table in SQLTerm.

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.

Configure the D_TimeH output template by renaming the skey attribute to


day_skey and setting the start value to 1000. Modify the properties of the
dimension build so that the log file includes Progress, Detail, and Executed
SQL messages.

Execute the D_TimeH dimension build and examine the resulting


dimension table in SQLTerm.

7-36

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).

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.

Configure the D_StaffH output template by renaming the skey attribute to


salesstaff_skey and setting the start value to 1000. Modify the properties of
the dimension build so that the log file includes Progress, Detail, and
Executed SQL messages.

Execute the D_StaffH dimension build and examine the resulting


dimension table in SQLTerm.

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.

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-37

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 1: Task Table


TASK

WHERE TO WORK

HINTS

1. Create a dimension build


for the ProductH
hierarchy.

Dimension Build wizard

Deliver into
TargetConnect.

Index ID and Surrogate


columns.

Enable surrogates and


change tracking.

2. Configure the output


template and build
properties for the
D_ProductH dimension
build.

Template Properties window

Dimension Build Properties


window

Rename skey as
product_skey.

product_skey start
value=1000.

3. Execute the D_ProductH


dimension build and
examine the dimension
table in SQLTerm.

SQLTerm

Query the D_ProductH


table.

4. Create a dimension build


for the VendorH
hierarchy.

Dimension Build wizard

Deliver into
TargetConnect.

Index ID and Surrogate


columns.

Enable surrogates and


change tracking.

5. Configure the output


template and build
properties for the
D_VendorH dimension
build.

Template Properties window

Dimension Build Properties


window

Rename skey as
vendorsite_skey.

vendorsite_skey start
value=1000.

6. Execute the D_VendorH


dimension build and
examine the dimension
table in SQLTerm.

SQLTerm

Query the D_VendorH


table.

7-38

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).

CUSTOMIZE

REFERENCE

TASK

WHERE TO WORK

HINTS

7. Create a dimension build


for the TimeH hierarchy.

Dimension Build wizard

Deliver into
TargetConnect.

Index ID and Surrogate


columns.

Enable surrogates, but DO


NOT enable change
tracking.

8. Configure the output


template and build
properties for the
D_TimeH dimension
build.

Template Properties window

Rename skey as day_skey.

Dimension Build Properties


window

day_skey start value=1000.

9. Execute the D_TimeH


dimension build and
examine the dimension
table in SQLTerm.

SQLTerm

Query the D_TimeH table.

10. Create a dimension build


for the StaffH hierarchy.

Dimension Build wizard

Deliver into
TargetConnect.

Index ID and Surrogate


columns.

Enable surrogates and


change tracking.

Exclude partially populated


rows.

11. Configure the output


template and build
properties for the
D_StaffH dimension
build.

Template Properties window

Dimension Build Properties


window

Rename skey as
salesstaff_skey.

StaffKey start value=1000.

12. Execute the D_StaffH


dimension build and
examine the dimension
table in SQLTerm.

SQLTerm

Query the D_StaffH table.

STRUCTURES

If you need more information to complete a task, see the Step-by-Step instructions
at the end of this workshop.

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-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_VendorH dimension build appears in the Visualization


pane as shown below:

After construction, the D_TimeH 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

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Workshop 1: Step-by-Step Instructions


Task 1. Create a dimension build for the ProductH hierarchy.
1. On the toolbar, click Start the Dimension Build Wizard.
The Dimension Build wizard opens.
2. In the Name box, type D_ProductH, and then click Next.
3. In the Dimension to be delivered list, click ProductD, and then in the
Reference item to be delivered list, click ProductH (H).
4. In the Deliver into connection list, click TargetConnect, click Next, and
then click Next again.
5. In the Indexing strategy list, click Index ID and SURROGATE
columns, click Next, and then click Next again.
6. Select the Add Surrogate Keys to the Dimension Tables and Add
Change Tracking Attributes to the Dimension Tables check boxes.
7. Click Next twice, and then click Finish.
Task 2. Configure the output template and build properties
for the D_ProductH dimension build.
1. In the Visualization pane, double-click the D_ProductH template

The Template Properties window opens.


2. Click the Attributes tab, double-click the skey attribute name, and then
type product_skey.

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-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:

4. Click OK, and then in the Visualization pane, double-click the


D_ProductH 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 as well), and then click OK.
Task 3. Execute the D_ProductH dimension build and
examine the dimension table in SQLTerm.
1. Save the catalog, in the tree, click the D_ProductH dimension build, and
then on the toolbar, click Execute.
The build runs and delivers 115 rows to the D_ProductH dimension table.
2. Press Enter, and then open SQLTerm.
3. In the Database list, click TargetConnect, and then in the Database
objects pane, expand TargetConnect and dbo.
4. Right-click D_ProductH, and then click Add table select statement.

7-42

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).

CUSTOMIZE

REFERENCE

STRUCTURES

5. Click Return all rows.


Data Manager returns 115 rows of data.
Notice that each row includes a surrogate key column called product_skey
(the values start at 1000). Each row also includes columns such as eff_date,
which are used for tracking historical changes to dimension data. This topic
will be discussed in greater detail later in this course.
6. Close SQLTerm.
Task 4. Create a dimension build for the VendorH hierarchy.
1. On the toolbar, click Start the Dimension Build Wizard.
The Dimension Build wizard opens.
2. In the Name box, type D_VendorH, and then click Next.
3. In the Dimension to be delivered list, click VendorD, and then in the
Reference item to be delivered list, click VendorH (H).
4. In the Deliver into connection list, click TargetConnect, click Next, and
then click Next again.
5. In the Indexing strategy list, click Index ID and SURROGATE
columns, click Next, and then click Next again.
6. Select the Add Surrogate Keys to the Dimension Tables and Add
Change Tracking Attributes to the Dimension Tables check boxes.
7. Click Next twice, and then click Finish.
Task 5. Configure the output template and build properties
for the D_VendorH dimension build.
1. In the Visualization pane, double-click the D_VendorH template.
The Template Properties window opens.
2. Click the Attributes tab.
3. Double-click the skey attribute name, type vendorsite_skey, and then
press Enter.

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-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:

5. Click OK, and then in the Visualization pane, double-click the


D_VendorH 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-44

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Task 6. Execute the D_VendorH 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_VendorH dimension build, and then on the toolbar, click Execute.
The build executes and delivers 391 rows to the D_VendorH dimension
table.
2. Press Enter, and then open SQLTerm.
3. In the Database list, click TargetConnect, and then in the Database
objects pane, expand TargetConnect and dbo.
4. Right-click D_VendorH, and then click Add table select statement.
5. Click Return all rows.
Data Manager returns 391 rows of data.
Notice that each row includes a surrogate key column called
vendorsite_skey (the values start at 1000). Each row also includes columns
such as eff_date, which are used for tracking historical changes to
dimension data. This topic will be discussed in greater detail later in this
course.
6. Close SQLTerm.
Task 7. Create a dimension build for the TimeH hierarchy.
1. On the toolbar, click Start the Dimension Build Wizard.
The Dimension Build wizard opens.
2. In the Name box, type D_TimeH, and then click Next.
3. In the Dimension to be delivered list, click TimeD, and then, if necessary,
select TimeH (H) in the Reference item to be delivered list.
4. In the Deliver into connection list, click TargetConnect, click Next, and
then click Next again.
5. In the Indexing strategy box, click Index ID and SURROGATE
columns, click Next, and then click Next again.
6. Select the Add Surrogate Keys to the Dimension Tables check box, but
DO NOT select the Add Change Tracking Attributes to the Dimension
Tables box.
7. Click Next, and then click Finish.

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-45

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Task 8. Configure the output template and build properties


for the D_TimeH dimension build.
1. In the Visualization pane, double-click the D_TimeH template.
The Template Properties window opens.
2. Click the Attributes tab, double-click the skey attribute name, and then
type day_skey.
3. Double-click the Value box beside Start Value for the day_skey attribute,
type 1000, and then press Enter.
The result appears as shown below:

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

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).

CUSTOMIZE

REFERENCE

STRUCTURES

5. Click Return all rows.


Data Manager returns 3,652 rows of data.
Notice that each row includes a surrogate key column called day_skey (the
values start at 1000). However, unlike the D_ProductH and D_VendorH
dimension tables, the rows of this table do not include change tracking
columns.
6. Close SQLTerm.
Task 10. Create a dimension build for the StaffH hierarchy.
1. On the toolbar, click Start the Dimension Build Wizard.
The Dimension Build wizard opens.
2. In the Name box, type D_StaffH, and then click Next.
3. In the Dimension to be delivered list, click StaffD.
The StaffH hierarchy is automatically selected in the Reference item to be
delivered box.
4. In the Deliver into connection list, click TargetConnect, click Next, and
then click Next again.
5. In the Indexing strategy list, click Index ID and SURROGATE
columns, click Next, and then click Next again.
6. Select the Add Surrogate Keys to the Dimension Tables and Add
Change Tracking Attributes to the Dimension Tables check boxes.
7. Click Next twice, click Finish, and then save the catalog (click Save my
version if prompted).
8. In the Visualization pane, right-click the D_StaffH table, and then click
Properties.
The Dimension Table Properties window opens.
9. Select the Exclude Partially Populated Rows check box, and then click
OK.
If the Exclude Partially Populated Rows check box is selected, Data
Manager will not deliver rows for higher level members with no children. If
this check box is not selected, rows are delivered for higher level members
with no children, and the lower level columns are set to null.

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-47

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Task 11. Configure the output template and build properties


for the D_StaffH dimension build.
1. In the Visualization pane, double-click the D_StaffH template.
The Template Properties window opens.
2. Click the Attributes tab.
3. Double-click the skey attribute name, type salesstaff_skey, and then press
Enter.
4. Double-click the Start Value box for the StaffKey attribute, type 1000, and
then press Enter.
The result appears as shown below:

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

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Task 12. Execute the D_StaffH 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_StaffH dimension build, and then on the toolbar, click Execute.
The build executes and delivers 102 rows to the D_StaffH dimension table.
2. Press Enter, and then open SQLTerm.
3. In the Database list, click TargetConnect, and then in the Database objects
pane, expand TargetConnect and dbo.
4. Right-click D_StaffH, and then click Add table select statement.
5. Click Return all rows.
Data Manager returns 102 rows of data.
Notice that each row includes a surrogate key column called salesstaff_skey
(the values start at 1000). Each row also includes columns such as eff_date,
which are used for tracking historical changes to dimension data. This topic
will be discussed in greater detail later in this course.
6. Close SQLTerm.

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-49

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 2
Create Data Integrity Lookups

7-50

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).

CUSTOMIZE

REFERENCE

STRUCTURES

Workshop 2: Create Data Integrity Lookups


Now that you have delivered conformed dimension tables to the data mart, you can
create data integrity lookups that reference the data in these tables. You will later
reference the lookups in fact builds to validate incoming data and perform surrogate
key substitution.
Each lookup will retrieve data from a dimension table by using a template for data
access. In addition, each lookup will reference data at the lowest hierarchical level.
The lookups require only Id and surrogate key attributes.
To accomplish this:

Create the D_ProductL lookup. Specify the D_ProductH template and


include product_skey as the surrogate and ProductNumber as the Id.
Examine the lookup using Reference Explorer.

Create the D_VendorSiteL lookup. Specify the D_VendorH template and


include vendorsite_skey as the surrogate and VendorSiteCode as the Id.
Examine the lookup using Reference Explorer.

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.

Create the D_SalesStaffL lookup. Specify the D_StaffH template and


include salesstaff_skey as the surrogate and SalesStaffCode 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.

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-51

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 2: Task Table


TASK

WHERE TO WORK

HINTS

1. Create the D_ProductL


lookup.

Lookup Properties window

Surrogate: product_skey.

Reference Explorer

Id: ProductNumber.

Lookup Properties window

Surrogate: vendorsite_skey.

Reference Explorer

Id: VendorSiteCode.

Lookup Properties window

Surrogate: day_skey.

Reference Explorer

Id: DayId.

Lookup Properties window

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

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).

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_VendorSiteL lookup appears as shown


below:

When viewed in Reference Explorer, the D_DayL lookup appears as shown below:

When viewed in Reference Explorer, the D_SalesStaffL lookup appears as shown


below:

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-53

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 2: Step-by-Step Instructions


Task 1. Create the D_ProductL lookup.
1. Right-click the ProductD dimension, and then click Insert Lookup.
The Lookup Properties window opens.
2. In the Name box, type D_ProductL, click the Attributes tab, and then in
the Template list, click the D_ProductH template.
3. In the Available attributes pane, double-click product_skey and
ProductNumber to add them to the Chosen attributes pane.
4. In the ProductNumber row, select the Id check box.
5. Click the Data Access tab, select Use Template for data access, and
then in the Connection list, click TargetConnect.
6. Beside the Table name box, click Browse.
The Select Table dialog box appears.
7. Expand dbo, and then click D_ProductH.
8. Click OK, and then click OK to close the Lookup Properties window.
9. Save the catalog, in the Visualization pane, right-click the D_ProductL
lookup, and then click Explore.
10. Click OK.
The Reference Explorer window opens and displays the members of the
lookup.
11. Close Reference Explorer.
Task 2. Create the D_VendorSiteL lookup.
1. Right-click the VendorD dimension, and then click Insert Lookup.
The Lookup Properties window opens.
2. In the Name box, type D_VendorSiteL, click the Attributes tab, and then
in the Template list, click D_VendorH.
3. In the Available attributes pane, double-click vendorsite_skey and
VendorSiteCode to add them to the Chosen attributes pane.
In the VendorSiteCode row, select the Id check box.
4. Click the Data Access tab, select Use Template for data access, and then
in the Connection list, click TargetConnect.
5. Beside the Table name box, click Browse.
The Select Table dialog box appears.
6. Expand dbo, and then click D_VendorH.
7. Click OK, and then click OK to close the Lookup Properties window.

7-54

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).

CUSTOMIZE

REFERENCE

STRUCTURES

8. Save the catalog, in the Visualization pane, right-click the D_VendorSiteL


lookup, and then click Explore.
9. Click OK.
The Reference Explorer window opens and displays the members of the
lookup.
10. Close Reference Explorer.
Task 3. Create the D_DayL lookup.
1. Right-click the TimeD dimension, and then click Insert Lookup.
The Lookup Properties window opens.
2. In the Name box, type D_DayL, click the Attributes tab, and then in the
Template list, click D_TimeH.
3. In the Available attributes pane, double-click day_skey and DayId to add
them to the Chosen attributes pane.
4. In the DayId row, select the Id check box.
5. Click the Data Access tab, select Use Template for data access, and
then in the Connection list, click TargetConnect.
6. Beside the Table name box, click Browse.
7. The Select Table dialog box appears.
8. Expand dbo, and then click D_TimeH.
9. Click OK, and then click OK to close the Lookup Properties window.
10. Save the catalog, in the Visualization pane, right-click the D_DayL lookup,
and then click Explore.
11. Click OK.
The Reference Explorer window opens and displays the members of the
lookup.
12. Close Reference Explorer.

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-55

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Task 4. Create the D_SalesStaffL lookup.


1. Right-click the StaffD dimension, and then click Insert Lookup.
The Lookup Properties window opens.
2. In the Name box, type D_SalesStaffL, click the Attributes tab, and then
in the Template list, click D_StaffH.
3. In the Available attributes pane, double-click salesstaff_skey, and
SalesStaffCode to add them to the Chosen attributes pane.
In the SalesStaffCode row, select the Id check box.
4. Click the Data Access tab, select Use Template for data access, and
then in the Connection list, click TargetConnect.
5. Beside the Table name box, click Browse.
The Browse for Table dialog box appears.
6. Expand dbo, and then click D_StaffH.
7. Click OK, and then click OK to close the Lookup Properties window.
8. Save the catalog, in the Visualization pane, right-click the D_SalesStaffL
lookup, and then click Explore.
9. Click OK.
The Reference Explorer window opens and displays the members of the
lookup.
10. Close Reference Explorer, and then close Data Manager.

7-56

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).

Process Dimensional History and


Late Arriving Facts
IBM Cognos 8 BI

2008 IBM Corporation

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

8-2

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Objectives
In this module, we will:

examine slowly changing dimensions (SCDs)

use surrogate keys in SCDs

manage type 1 and type 2 changes to dimensional data

load historical data for a dimension

examine late arriving facts

process late arriving facts in a fact build

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).

8-3

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Examine Slowly Changing Dimensions (SCD)


OLTP systems tend to contain data about the current state of the
business.
A data warehouse is expected to hold data for several years.
Therefore, dimension data in the warehouse must often reflect
changes over time.
The term "Slowly Changing Dimension" (SCD) refers to this behavior.
By using surrogate keys, we can track these changes in the data
warehouse.

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

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).

PROCESS

DIMENSIONAL

HISTORY

AND

Use Surrogate Keys in SCDs


By including surrogate keys in dimension tables, you can keep track
of historical changes to the data.
Surrogate keys are:
unique integer values
internally assigned by Data Manager
used in conjunction with business keys

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

the sheer size of a data warehouse often makes data warehouse-assigned


surrogate keys preferable to those from the OLTP system(s)

you may want to track changes to the data warehouse (not the OLTP
system(s)) over time

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).

8-5

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Use Business Keys in a Data Warehouse: Example


Product Dimension

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

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).

PROCESS

DIMENSIONAL

HISTORY

Use Surrogate Keys in a Data Warehouse:


Example
Product Dimension

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.

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).

8-7

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Link Dimension Tables to Fact Tables Using


Surrogates
To track changes to a dimension over time, you must use surrogate
keys to link fact tables to dimension tables.
The underlying template for the dimension table must contain the
surrogate key(s).
You can add a surrogate key to each level of the dimension.

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.

In the slide example, the


D_Example_Retailer template has a
surrogate key called Surrogate. This
attribute is mapped to the
RETAILER_SITE_CODE business key
attribute. In the corresponding dimension
table that uses the D_Example_Retailer
template, each value of
A fact table in a data warehouse may be "single grain" (for example, it may only track RETAILER_SITE_CODE will have a
daily sales). When this is true, a dimension that is linked to the fact table only requires separate value for Surrogate.

a surrogate key at its lowest level.


However, in a data warehouse there are often multiple fact tables with different
grains. For example, one fact table may track daily sales, while another may track
monthly budgets. Both fact tables may reference the same dimension. In this case,
surrogate keys are required for more than just the lowest level.
Data Manager lets you determine whether surrogates are available at each level.

Technical Information (contd)


The templates for extracting the source data will not have surrogates. These templates do
not need surrogate attributes. Surrogates are required only when members are added to the
dimension tables in the data mart. Therefore, only the template associated to the dimension
build will contain the surrogate information.

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

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).

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.

This diagram is a simplified version of the


one used in Ralph Kimball et al.'s The Data
Warehouse Lifecycle Toolkit. See the book
for a more complex example of how the
business keys of a fact table can be
replaced with surrogate keys in the data
mart.

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).

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

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Demo 1: Manually Add a Surrogate Key to a Dimension


Table
Purpose:
The Great Outdoors has data that tracks their vendors. You want
to store this data in a conformed dimension table that can
potentially be used by multiple fact tables in the data mart. To
accomplish this, you will manually create a dimension build that
is based on the VendorCustomerH hierarchy. You will then
execute the dimension build to deliver the data to a single
conformed dimension table.
Task 1. Manually create the VendorCustomerH dimension
build.
1. Open Data Manager.
2. In the Welcome dialog box, click Open an existing catalog.
3. In the left pane, ensure that SQL Server (OLE-DB) is selected, in the
Username box, ensure that sa is entered, and then in the Password box,
ensure that Education1! is entered.
4. In the Server name box, ensure that (local) is selected, and then in the
Database name box, ensure that GO_Catalog is entered.
5. In the OLE DB Provider list, ensure that sqloledb (SQL Server 2000
OLEDB) is selected, and then click OK.
6. Right-click the Builds and JobStreams folder, and then click Insert
Dimension Build.
7.
8.
9.

10.

The Dimension Build Properties window opens.


In the Name box, type D_VendorCustomerH, and then click the
Dimension tab.
In the Dimension to be delivered list, click VendorD, and then in the
Hierarchy/Lookup to be delivered list, click VendorCustomerH (H).
In the Deliver into database list, click TargetConnect.
You want to deliver the dimension table to the database specified by the
TargetConnect connection.
Click OK to close the Dimension Build Properties window.
The Visualization pane appears as shown below:

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.

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).

8-11

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Task 2. Add a dimension table to the VendorCustomerH


dimension build.
1. In the Visualization pane, right-click the D_VendorCustomerH
dimension build, and then click Insert Table.
The Dimension Table Properties window opens.
2. In the Table name box, type D_VendorCustomerH.
3. Ensure that the Exclude Partially Populated Rows and Enabled check
boxes are selected, and then click the Columns tab.
4. In the Use template list, click VendorCustomerT.
The eight attributes in the template are listed.
5. In the Available Sources pane, expand the VendorCustomerH hierarchy,
and then expand the ALLVendorCustomers, Vendor, and VendorSite
levels.
6. Click and drag the ALLVendorCustomers [Id, Caption] attribute from
the Available Sources pane to the Sourced From column beside the
ALLVendorCustomers row.
The result appears as shown below:

8-12

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

7. Repeat step 6 to map the remaining hierarchy attributes to the columns of


the dimension table.
The result appears as shown below.

You now need to add a surrogate key to the dimension table.


Task 3. Add a surrogate key to the D_VendorCustomerH
dimension table.
1. Beside the Use template box, click Edit.
The Template Properties window opens.
2. Click the Attributes tab, and then click Add.
A new attribute called Attribute1 is added to the list of attributes in the
template.
3. With Attribute1 selected, type Surrogate, and then in the Behavior list,
click Surrogate Key.
4. In the Behavior column beside VendorSiteCode, ensure that Business
Key is selected, and then in the Value column, ensure that True is selected.
This specifies that the VendorSiteCode attribute is the primary key in this
template.
5. In the Surrogate row, click the Value box.

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).

8-13

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

6. Click VendorSiteCode, and then press Enter.


This associates each value of the surrogate key with a value of
VendorSiteCode. The result appears as shown below:

7. Click OK to close the Template Properties window.


We are returned to the Dimension Table Properties window. Notice that
the Surrogate column is added to the dimension table and is associated to
the VendorSiteCode column.
8. Click OK to close the Dimension Table Properties window.
The Build Visualization pane appears as shown below.

8-14

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Task 4. Execute the VendorCustomerH dimension build and


then view the results in SQLTerm.
1. Save the catalog, in the tree, click the D_VendorCustomerH build, and
then on the toolbar, click Execute.
The Vendor build runs and delivers 217 rows to the D_VendorCustomerH
table.
2. Press Enter to close the command window, and then open SQLTerm.
3. In the Database list, click TargetConnect.
4. In the Database objects pane, expand TargetConnect and dbo, right-click
D_VendorCustomerH, and then click Add table select statement.
A SELECT statement is added to the query pane.
5. Click Return all rows.
The query runs and returns 217 rows of data. The result appears as shown
below:

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.

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).

8-15

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Examine Issues With Slowly Changing Dimensions


Maintaining SCDs can be complex without surrogates.
Business
Key

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)

** (Emp. No + Branch + Position)


*** (Emp. No + Branch + Position + Salary)

As the key gets larger and larger, the


fact table would become difficult to
manage and query against.

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

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Use Different Methods to Handle Slowly Changing


Dimensions
Two most common ways of handling changing dimension data
(according to Kimball):

Type 1 - Overwrite the old value with the new value (do not
track the changes).

Type 2 - Add a new dimension row with a new surrogate key


(track changes over time).

A single row may have a combination of columns of different types.

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:

Type 1 - where no historical row is required

Type 2 - where an accurate historical row is required at any stage

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.

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).

8-17

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Track Type 0 Changes


Type 0 changes can only occur where:

type 2 changes are set to occur

the effective dates are timestamped according to the data

If there are multiple changes to an attribute on the same date,


rather than maintaining a history of each change, Data Manager
overwrites the current record for each change.

As with Type 1 and Type 2 changes, you specify Type 0 changes in the Dimension
Table Properties dialog box.

8-18

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Track Type 0 Changes: Example


This dimension table contains the Product reference data. The Prod_Desc attribute has been marked for a
type 0 update, and the Prod_Type attribute marked as a type 2 update.

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

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).

8-19

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Type 1: Overwrite the Original Value


The organization may not choose to track certain data changes
because:

the original data may have been incorrect

the change is not considered relevant for tracking


Sales Rep Dimension Table

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

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Type 2: Add a New Dimension Row


When a tracked change is detected, a new surrogate key is
assigned and a new row is added to the dimension table.
Usually, an effective begin/end date is also updated on the new
and old rows.
Multiple rows may have the same business key, but they will
always have unique surrogate keys.
Sales Rep Dimension Table
Sales Fact Table
RepSur Order Date
Key
11111
1/1/2008
11111
2/1/2008
11112
3/1/2008
11112
4/1/2008

Cust
Key
12345
12345
12345
12345

RepSur Rep
Key
Key

Name

Office
Office Eff
Eff
Date
Date

11111 00128 Mary Smith Dallas


9901
NYC
Dallas 200701
11112 00128 Mary Smith NYC 200803

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.

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).

8-21

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Use Templates to Manage Dimensional Changes

Surrogate key associated to a


business key attribute.

Date range between which the


row is currently valid.

Date when the row was created.

Date when the row was last


updated.
Flag indicating that the row is the current one or a past value.

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:

creating an insert for new members

updating existing members

that the row was last updated and another


column that indicates whether the row is
current. Having these columns provides
more flexibility when querying the
dimension table. For example, you can
limit your search to only those rows that
were modified after a certain date.

Data Manager determines what rows need to be inserted or updated based on


Type 2 SCDs by:

creating an insert for new members

modifying existing members 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

updating the prior version of the member to flag it as not current

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Use Business Keys with Type 2 Changes

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.

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).

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

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Demo 2: Apply SCDs to a Dimension Build


Purpose:
Five employees have been transferred to new locations. Using
SCDs, you can have your data mart automatically updated when
such transfers take place. You will add a data source to the
lowest level of the StaffH hierarchy and run the D_StaffH
dimension build to demonstrate.
Task 1. Add a connection to the catalog.
1. In the tree, right-click the Connections folder, and then click Insert
Connection.
The Connection Properties dialog box appears.
2. In the Alias box, type DM_Sources, and then click the Connection
Details tab.

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.

3. In the left pane, click SQLTXT, and then click browse.


The Select File dialog box appears.
4. Navigate to C:\Edcognos\B2480, and then click DM_Sources.def.
5. Click Open, and then click Test Connection.
A message appears, indicating that the connection was successful.
6. Click OK, and then click OK again to close the Connection Properties
dialog box.
You have added a connection to a data source that contains new employee
data. This data source will be used to simulate updates to the dimension
table from the source system.
Task 2. Add another data source for the SalesStaff level of
the StaffH hierarchy.
1. Expand the Dimensions folder, expand the StaffD dimension, and then
click the StaffH hierarchy.
2. In the Visualization pane, right-click the bottom DataStream (to the left of
the SalesStaff level), and then click Insert Data Source.
The Data Source Properties window opens.
3. Click the Query tab.
4. In the Database list, click DM_Sources.
5. In the Database objects pane, expand DM_Sources, right-click
Sales_Staff_Update, and then click Add table select statement.

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).

8-25

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

6. Click Return all rows.


Five rows are returned, showing the five employees who have changed
information.
7. Click the Result columns tab, ensure that Prepare is selected, and then
click Refresh to prepare the columns for use in the SalesStaff level.
8. Click OK to close the Data Source Properties window.
9. In the Visualization pane, right-click the bottom DataStream (to the left of
the SalesStaff level), and then click Properties.
The DataStream Properties window opens.
10. Click Auto Map.
The result appears as shown below:

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

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Task 3. Modify the D_StaffH dimension table so that it


includes Type 2 attributes.
1. In the tree, click the D_StaffH dimension build, in the Visualization pane,
right-click the D_StaffH dimension table, and then click Properties.
The Dimension Table Properties window opens.
2. Click the Columns tab, and then ensure that the Track changes (Slowly
Changing Dimension) check box is selected.
3. In the SalesDateHired and SalesBranchCode rows, select 2 in the Track
column (if it is not already selected).
The result appears as shown below:

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.

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).

8-27

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

4. Click OK to close the Dimension Table Properties window.


You will now modify the D_SalesH dimension table to allow null values in
the SalesFirstName, SalesLastName, and SalesDateHired columns (since
the new data source does not include values for these columns).
5. From the Start menu, point to All Programs\Microsoft SQL Server, and
then click Enterprise Manager.
6. In the left pane, expand Microsoft SQL Servers, SQL Server Group, and
(local) (Windows NT).
7. Expand Databases and the GO_Target database, and then click Tables.
8. In the right pane, right-click D_StaffH, and then click Design Table.
The Design Table window opens.
9. Select the Allow Nulls check boxes for the SalesFirstName,
SalesLastName, and SalesDateHired columns, and then on the toolbar,
click Save .
10. Close Enterprise Manager.

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).

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Task 4. Execute the D_StaffH dimension build to view the


five SCD changes.
1. In the tree, click the StaffH hierarchy.
2. In the Visualization pane, right-click the bottom DataSource1 (the one to
the left of the SalesStaff level), and then click Enabled.
DataSource1 is indicated as disabled in the Visualization pane.
3. Save the catalog, in the tree, right-click the D_StaffH dimension build, and
then click Execute.
4. Select the Override build settings check box, and then select the Detail,
SQL, and ExecutedSQL check boxes.
5. Ensure that the Progress check box is also selected, and then click OK.
The Staff dimension build executes and applies five SCD changes to the
existing D_StaffH dimension table. The result appears as shown below:

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.

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).

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:

11. Close SQLTerm.


Task 5. Re-enable the first data source and disable the
second data source.
1. In the tree, click the StaffH hierarchy.
2. In the Visualization pane, right-click the bottom DataSource1 (to the left
of the SalesStaff level), and then click Enabled.
The data source is shown as enabled in the Visualization pane.
3. In the Visualization pane, right-click DataSource2, and then click
Enabled.
DataSource2 is shown as disabled in the Visualization pane.
4. Save the catalog (click Save my version if prompted).
Results:
You have applied SCD changes to a dimension table by adding a
data source to a hierarchy and then re-executing the dimension
build that delivers this hierarchy.

8-30

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Type 1 and Type 2 Updates: Review


Business
Key

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.

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).

8-31

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Type 1 and Type 2 Updates: Logging

[PROGRESS - 16:29:59] Table 'D_Product': 0 new record(s)


[PROGRESS - 16:29:59] Table 'D_Product': 0 'Type 2' change(s)
[PROGRESS - 16:29:59] Table 'D_Product': 1 'Type 1' update(s) (by 'Product')
[11 row(s) affected, average 11]
[PROGRESS - 16:29:59] Table 'D_Product': 0 'Type 1' update(s) (by
'ProductCategories') [0 row(s) affected, average 0]
[PROGRESS - 16:29:59] Done - 0 00:00:01 elapsed
dimbuild -- completed (15-Dec-2008 16:29:59)

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.

update, but no Type 2 updates. Eleven


rows were updated because there was a
Type 1 change.
In the slide example, the ProductID
column was indexed.

8-32

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Load Historical Data for a Dimension


OLTP systems often contain historical information related to
day-to-day transactions; for example, employee status
changes.
You can load this historical dimension data into the warehouse
during initial loads or periodic runs.
You must specify an effective start date to let Data Manager
recognize multiple changes to the data and automatically
generate the effective end date for all except the most recent
change.
Product_Surrogate
1
2
3

Product_ID ProductName Price Effective_Start_Date Effective_End_Date


10000
Chai Tea
10
2008/01/01
2008/01/31
10000
Chai Tea
11
2008/02/01
2008/02/28
10000
Chai Tea
30
2008/03/01

Data Manager can load the history into a dimension table in the data warehouse.
This is useful if:

you want to load old data

when the dimensions change frequently

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.

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).

8-33

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Implement Dimensional History


Source Template

Reference Template

Delivered Dimension Table with History

To implement dimensional history, you must define an attribute that represents


the effective start date in the source template.
Data Manager derives the effective start date from the source data, instead of
automatically generating the effective start date.

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

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Process Dimensional History


Your dimension table may include attributes for which you are
tracking changes, such as product name.
When Data Manager encounters a change in an attribute for a
specific dimension member, it normally only checks the current
dimension row for that member when updating the dimension table.

Product Code
P1
P1
P1

Surrogate Key
1
2
3

Specification
Blue pen
Black pen
Red pen

Effective Date End Date


2002/11/01
2005/12/22
2005/12/23
2008/02/09
2008/02/10

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.

specification of product P1 occurred


sequentially. Product P1 was a blue pen
on Nov. 1, 2002, was reclassified as a
black pen later (Dec. 23, 2005), and was
then reclassified as a red pen even later
(Feb. 10, 2008).
In the slide example, Data Manager
checked the second last row of data
about product P1 before adding new data
to the last row.
Data Manager detected that the incoming
data about product P1 had a different
specification, which became effective at
an earlier date (Dec. 23, 2005). As a
result, a new row was added to the
dimension table with a new effective date
of Feb. 10, 2008.
Data Manager specified that the previous
row was no longer current by adding a
new end date value to that row. The end
date for this row is the date in which the
new row of data became effective minus
one day or one second.

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).

8-35

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Process Late Arriving Dimension Details


Incoming data for a specific dimension member may include
additional historical attribute changes which occurred prior to the
effective start date of the most current row. This data cannot be
written to the dimension table.
You can choose to reject this incoming data, or write information to
a file.
Data in original dimension table

Product Code
P1
P1
P1

Surrogate Key
1
2
3

Specification
Blue pen
Black pen
Red pen

Effective Date End Date


2002/11/01
2005/12/22
2005/12/23
2008/02/09
2008/02/10

Incoming dimension data


Product Code Specification Date
P1
Orange pen
2004/05/14
P1
Mauve pen
2007/04/27

Type 2 attribute changes to a dimension member that occurred prior to the


effective start date of the most current row for that member cannot be written to
the dimension table.

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

this dimensional history into the


existing dimension table.
Existing surrogate key and effective
date values in the dimension table
must be realigned to accommodate
the late arriving dimension details.
Reassigning surrogate key values
on dimension tables to
accommodate late arriving
dimension details creates problems
for the fact tables that use these
surrogate keys for referential
integrity.

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).

PROCESS

DIMENSIONAL

HISTORY

Specify the Source of the Effective Date


You can specify from where Data Manager should read the effective
start date for the initial row for a specific dimension member.
You have two options:

from source attribute: Data Manager sets the effective start


date to the date specified for each dimension member in the
dimension data. This is the default setting.

according to reference template: Data Manager uses the


template to set the effective date for all dimension rows.

Product Code Surrogate Key Specification Effective Date End Date


P1
1
Blue pen
2003/11/01
P2
4
White paper
2006/11/01
The initial row for each dimension member is different. You
can use these dates, or you can have the effective date set
automatically by the template for the dimension table.

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

You want to use the date that


corresponds to the timestamp set by
the dimension build.

Use data timestamp value

You want to use a variable to set the


date.

Variable

You want to set an explicit date and


time.

Date (yyyy-mm-dd hh:mm:ss)

You do not want to set a date value.

Null

This enables a second box in which


you type the variable name.

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.

This enables a second box in which


you type the date and time.

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).

8-37

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Specify Other Effective Date Options


You can control the way in which Data
Manager sets effective start dates and
effective end dates in the template
referenced by the dimension table.
Changing the template affects
effective date options for all
dimension tables referencing that
template.

Product Code Surrogate Key

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.

In the Set previous record Effective Date to


box, indicate how you want to set the
effective end date for the previous row of
data when Data Manager creates a new
row in the dimension table. You can set this
For example, if you are reporting on electricity rates and are using a date timestamp, effective start date to be the same as the
effective start date of the new dimension
your reports will not be accurate if the rate changes numerous times in one day.
However, using a timestamp that includes just the date may be valid for reporting data row, or the same date minus one day
or second.
on human resources data. For example, it is unlikely that an employee's personal

information will change twice in the same day.

If Date only is selected in the Effective date


granularity box at the top, you cannot
specify an explicit date and time, just the
date.

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.

Effective Date to box is set to minus one


day, not one second.

8-38

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Demo 3
Load Dimensional
History

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).

8-39

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 3: Load Dimensional History


Purpose:
The Great Outdoors recently acquired a new line of food and
beverage products. The data about the past sales of these food
and beverage products is stored in a separate database. You will
add a connection to this database, and then create a hierarchy
that shows the entire history of this dimension data, including
changes in product names and prices. Finally, you will construct
and execute a dimension build to deliver this history to a
dimension table and view the table's contents in SQLTerm.
Task 1. Add a connection to the database.
1. In GO_Catalog, right-click the Connections folder, and then click Insert
Connection.
The Connection Properties dialog box appears.
2. In the Alias box, type DM_Additional, and then click the Connection
Details tab.
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 dm_additional.
5. In the OLE DB Provider list, ensure that sqloledb (SQL Server 2000
OLEDB) is selected, and then click Test Connection.
A message appears, indicating that the connection is successful.
6. Click OK, and then click OK again to close the Connection Properties
dialog box.
Task 2. Create a hierarchy in the ProductD dimension and
add the Category level.
1. Under the Dimensions folder, right-click the ProductD dimension, and
then click Insert Hierarchy.
The Hierarchy Properties window opens.
2. In the Name box, type ProductHistoryH, and then click OK.
3. In the Visualization pane, right-click the ProductHistoryH hierarchy, and
then click Insert Level.
The Level Properties window opens.

8-40

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).

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.

to add the attributes to the Chosen

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.

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).

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:

13. Click OK to close the Level Mapping window.


Task 4. Explore the ProductHistory hierarchy.
1. Save the catalog, in the Visualization pane, right-click the
ProductHistoryH hierarchy, and then click Explore.
The Reference Explorer window opens.
2. Click OK.
The eight product categories are listed. The result appears as shown below:

3. Close Reference Explorer.


Task 5. Add the Product level to the ProductHistoryH
hierarchy.
1. In the Visualization pane, right-click the ProductHistoryH hierarchy, and
then click Insert Level.
The Level Properties window opens.
2. In the Name box, type Product, click the Attributes tab, and then in the
Template box, click ProductHistoryT.
3. Click Edit.
The Template Properties window opens.
4. Click the Attributes tab.
5. Click Add, and then type ProductID.
6. Repeat step 5 to add three more attributes called ProductName,
UnitPrice, and EffectiveStartDate.
7. In the Behavior list for EffectiveStartDate, click Effective Start Date.

8-42

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).

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:

9. Click OK to close the Template Properties window.


We are returned to the Level Properties window.
Task 6. Add attributes to the Product level and insert a data
source.
1. In the Available attributes pane, double-click ProductID to add ProductID
to the Chosen attributes pane.
2. Repeat step 1 for ProductName, UnitPrice, EffectiveStartDate, and
CategoryID.
3. In the ProductID row, select the Id check box, in the ProductName row,
select the Caption check box, and then in the CategoryID row, select the
Parent check box.
The result appears as shown below:

4. Click OK to close the Level Properties window.


5. In the tree, expand the Product level, right-click DataStream, and then
click Insert Data Source.
The Data Source Properties window opens.
6. Click the Query tab, and then in the Database list, click DM_Additional
(if necessary).

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).

8-43

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

7. In the Query pane, type the following code:


SELECT

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

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

8. Expand Beverages to view the 11 beverage products.


The result appears as shown below:

9. Close Reference Explorer.


Task 8. Create a dimension build to deliver the
ProductHistoryH hierarchy.
1. On the toolbar, click Start the Dimension Build Wizard.
The Dimension Build wizard opens.
2. In the Name box, type D_ProductHistoryH, and then click Next.
3. In the Dimension to be delivered list, click ProductD (if necessary), in the
Reference item to be delivered list, click ProductHistoryH (H), and then
in the Deliver into connection list, click TargetConnect.
4. Click Next, and then click Next again to accept the default naming
conventions.
5. Click Next twice to accept the default features and properties for the
dimension build.
6. Select the Add Surrogate Keys to the Dimension Tables and Add
Change Tracking Attributes to the Dimension Tables check boxes,
and then click Next.
7. Select the Track check boxes for all the available attributes except
EffectiveStartDate, and then click Next.
8. Click Finish.
The D_ProductHistoryH dimension build is added to the Tree 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).

8-45

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

9. In the Visualization pane, double-click the D_Product History dimension


build.
The Dimension Build Properties window opens.
10. Click the Dimension tab and then select the Remove Unused Foster
Parents box, if it is not already selected.
11. Click OK.
Task 9.

Modify the dimension table properties to maintain


dimension history.

1. In the Visualization pane, double-click the D_ProductHistoryH


dimension table.
The Dimension Table Properties window opens.
2. Click the Columns tab, and then clear the eff_date check box under
Column.
You will be obtaining the effective date value from the EffectiveStartDate
column in the underlying data source.
3. Click OK.
4. In the Visualization pane, double-click the D_ProductHistoryH template.
The Template Properties window opens.
5. Click the Attributes tab, select the eff_date attribute, and then click Delete
to remove this attribute from the template.
6. In the Behavior list beside EffectiveStartDate, click Effective Start Date,
and then press Enter.
7. In the Attribute Name column, change the value of skey to product_skey.
The result appears as shown below:

8-46

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

8. Click OK to close the Template Properties window.


9. In the Visualization Pane, double-click the D_ProductHistoryH
dimension table.
The Dimension Table Properties window opens, with the Dimension
History Options tab enabled.
10. Click the Dimension History Options tab, ensure that From source
attribute is selected in the Effective Start Date in initial records area, and
then click OK to close the Dimension Table Properties window.
Task 10. Execute the D_ProductHistoryH dimension build
and then view the results in SQLTerm.
1. Save the catalog (click Save my version if prompted), in the Visualization
pane, right-click the D_ProductHistoryH dimension build, 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 Detail, SQL, and ExecutedSQL check boxes.
3. Ensure that the Progress check box is also selected, and then click OK.
A command window opens and a log file is created as the build is
executing. Notice that 93 rows are delivered to the D_ProductHistoryH
dimension table.
4. When the build has finished executing, press Enter.
5. Open SQLTerm, in the Database list, click TargetConnect, and then in
the Database objects pane, expand TargetConnect and dbo.
6. Right-click D_ProductHistoryH, and then click Add table select
statement.
A SELECT statement is added to the Query pane.
7. Click Return all rows.
The query runs and returns 93 rows of data. It includes the complete
history of changes to the products, and the EffectiveStartDate column
indicates when each of these changes took place. The result appears as
shown below:

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).

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

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).

PROCESS

DIMENSIONAL

HISTORY

AND

What are Late Arriving Facts?


The dimension table may contain multiple instances of the same
business key.
Incoming fact rows may arrive after an associated dimension
has changed and a new dimension row exists.
The process must assign the correct surrogate key.
Sales Fact Table

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.

Sales Rep Dimension Table

RepSurKey RepKey Name


Office EffDate CurrInd
11111
00128 Mary Smith Dallas 200801 N
11112
00128 Mary Smith NYC 200803 Y

Keep in mind that all facts are initially


considered late arriving facts, because
they are typically processed after
dimension data has been loaded into the
data mart.

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.

Fact data is classified as being late arriving when:

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).

8-49

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Process Late Arriving Facts: Prerequisites


Before you can enable late arriving fact processing for a dimension
element, the following conditions must be met:

the fact build must not merge data

the fact build must not include any dimension deliveries for the
dimension

the dimension must use a lookup

the lookup must use a template for data access

the lookup must include an effective start date attribute that is


defined in the template

Technical Information (contd)


Specifying the date range limits for late arriving facts is important if you want to consider only a
specific range of dates for checking late arriving dimension data. For example, specifying a
range ensures that a late arriving fact can only occur up to three months ago. Any facts older
than three months should not be considered for late arriving fact processing.
A combination of rejecting rows out of range and setting a variable or specific date will allow you
to reject rows that are too old to process, for example, rows from the previous year.

8-50

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Demo 4
Create a Lookup and a Fact Build to
Process Late Arriving Facts

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).

8-51

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 4: Create a Lookup and a Fact Build to Process


Late Arriving Facts
Purpose:
You previously created a dimension build that preserves the
dimensional history of the product data in the
D_ProductHistoryH table. For example, you are now able to track
the changes of unit price for every product over time. Now, by
executing only one fact build, you want to deliver all of the
product sales fact data into the data warehouse, and to have
each fact table row reference its matching dimension table row.
Task 1. Add the ProductHistoryL lookup to the ProductD
dimension.
1. In GO Catalog, right-click the ProductD dimension, and then click Insert
Lookup.
The Lookup Properties window opens.
2. In the Name box, type ProductHistoryL, and then click the Attributes
tab.
3. In the Template box, click D_ProductHistoryH, and then double-click
the product_skey, ProductID, EffectiveStartDate, and UnitPrice
attributes to add them to the Chosen attributes pane.
4. In the ProductID row, select the Id box, click the Data Access tab, and
then select Use Template for data access.
5. In the Connection list, click TargetConnect, and then beside the Table
name box, click Browse.
The Select Table dialog box appears.

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.

6. Expand dbo, click D_ProductHistoryH, and then click OK.


7. Click OK to close the Lookup Properties window.
Task 2. Create the LateArrivingFacts fact build.
1. On the toolbar, click Start the Fact Build Wizard.
2. In the Enter the name of the build box, type LateArrivingFacts.
3. In the Select the connection into which the build is to deliver data, click
TargetConnect.
4. Select the Perform a full refresh on the target data check box.
5. Click Next, click Data Source, and then click Add.
The Data Source wizard opens.

8-52

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).

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. Click Finish to close the Data Source wizard.


9. In the Transformation Model pane, right-click ProductID, click Rename,
and then type product_skey.
10. In the Transformation Model, right-click UnitPrice, click Rename, and
then type UnitSalePrice.
The source column (UnitPrice) reflects the price of a product for a specific
order, not the seldom changed list price of a product. Therefore, to avoid
confusion, you will rename the resulting transformation model element
accordingly (from UnitPrice to UnitSalePrice).
11. Click Next to accept the DataStream, and then click Next to accept the
transformation model elements.
12. Click Next to accept the properties of the dimensions, click Next to accept
the default fact delivery, and then click Next to accept the default table and
column names.
13. Click Next to accept the summary of the fact build, and then clear the
Deliver dimensions check box.
14. Click Next, and then click Finish.
The LateArrivingFacts fact build is added to the Builds and JobStreams
folder.

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).

8-53

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Task 3. Modify the properties of the product_skey dimension


element to enable late arriving facts processing.
1. In the tree, click the LateArrivingFacts fact build, and then in the
Visualization pane, double-click product_skey.
The Dimension Properties window opens.
2. Click the Reference tab, in the Dimension list, click ProductD, and then
in the Structure box, click ProductHistoryL (L).
3. Click the Late Arriving Facts tab, and then select the Enable late
arriving fact processing check box.
4. In the Transaction date element list, select OrderDate.
5. In the Transaction date value actions area, beside the When NULL area,
select Use current reference member.
Selecting this option specifies that, if an incoming value for the OrderDate
column is null, Data Manager should use the current row in the
ProductHistoryL lookup.
6. Beside the When out of range section, select Use closest reference
member.
Selecting this option specifies that, if an incoming value for the OrderDate
column is outside the effective date range specified in the ProductHistoryL
lookup, Data Manager should use the closest matching row in the lookup.
The result appears as shown below:

7. Click OK to close the Dimension Properties window.

8-54

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Task 4. Add a derivation to retrieve the unit price of each


product from the ProductHistoryL lookup.
1. In the tree, expand LateArrivingFacts, right-click Transformation
Model, and then click Insert Derivation.
The Derivation Properties window opens.
2. In the Name box, type UnitPrice, and then click the Calculation tab.
3. In the Expression pane, double-click Reference Attributes, and then
double-click product_skey.UnitPrice.
4. Click OK to close the Derivation Properties window, click Yes to add the
element to existing fact deliveries, and then save the catalog (click Save my
version if prompted).
This column will show the seldom changed list price of a product, not the
price of a product for a specific order.
Task 5. Execute the LateArrivingFacts fact build and view
the results in SQLTerm.
1. Right-click the LateArrivingFacts fact build, and then click Execute.
The Execute Build dialog box appears.
2. Select the Override build settings check box, and then select the Detail,
SQL, and ExecutedSQL check boxes.
3. Ensure that the Progress check box is selected, and then click OK.
A command window opens and a log file is created, tracking the progress
of the fact build execution. Notice that 2,155 rows are inserted into the
F_LateArrivingFacts fact table.
4. When the build has finished executing, press Enter to close the command
window.
5. Open SQLTerm, in the Database list, click TargetConnect, and then in
the Database objects pane, expand TargetConnect and dbo.
6. Right-click F_LateArrivingFacts, and then click Add table select
statement.
A SELECT statement is added to the Query 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).

8-55

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

7. Modify the SELECT statement as follows:


SELECT
OrderDate,
OrderID,
ProductID,
a.product_skey,
CategoryID,
b.UnitPrice,
UnitSalePrice,
Discount,
Quantity
FROM
D_ProductHistoryH a, F_LateArrivingFacts b
WHERE
a.product_skey = b.product_skey
ORDER BY ProductID, a.product_skey
8. Click Return all rows, and then expand the OrderDate column.
The result appears as shown below:

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

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).

PROCESS

DIMENSIONAL

HISTORY

AND

LATE

ARRIVING

FACTS

Summary
In this module, we have:

examined slowly changing dimensions (SCDs)

used surrogate keys in SCDs

managed type 1 and type 2 changes to dimensional data

loaded historical data for a dimension

examined late arriving facts

processed late arriving facts in a fact build

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).

8-57

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

8-58

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).

Transform Data Using Lookups and Derived


Dimensions

IBM Cognos 8 BI

2008 IBM Corporation

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

9-2

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

Objectives
In this module, we will:

identify when to use lookups

identify the requirements for a lookup

create a translation lookup

create an optional lookup

add derived dimensions to fact builds

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).

9-3

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

When Can You Use Lookups?

9-4

Use a lookup when you want to organize dimension data nonhierarchically.

You can use lookups to:


1.

check the data integrity of fact rows against a single level


of a conformed dimension (data integrity lookup)

2.

perform data translation (translation lookup)

3.

clean complex, unstructured data from source systems


before hierarchies can be properly determined (optional
lookup)

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

Identify the Requirements for a Lookup


1. dimension (existing or new)
2. lookup object in the dimension
3. template to specify attributes
4. data access method (template or SQL)
5. DataStream and attribute mapping (if using SQL)

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).

9-5

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Use a Translation Lookup


You can use a lookup to translate certain values from the incoming
fact data into other values.
Once you have created the lookup, you reference it in
transformation model elements and filters of the fact build.
You then execute the fact build to actually translate the data.

A translation lookup does not usually use surrogate keys.


If a dimension element that references a translation lookup is only used for
calculations and filters, that element does not need to be delivered to the fact table.

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.

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

Demo 1
Convert Currency Data
Using a
Translation Lookup

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).

9-7

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 1: Convert Currency Data Using a Translation


Lookup
Purpose:
The Great Outdoors sells products throughout the world.
Business analysts from different regions in which the company
does business want to write reports that include revenues that
have been converted to their local currency without having to
perform the conversion in their reporting tool. You will include
this converted data in a fact table by using a translation lookup.
You will deliver all the incoming rows to the fact table, even
those that do not have the conversion rate specified. The rows
without a conversion rate will have zero values in the converted
revenues column.
Task 1. Add a data source to the TranslationLookup build.
1. Open Data Manager.
2. In the Welcome dialog box, click Open an existing catalog.
3. If necessary, 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.
6. On the toolbar, click Start the Fact Build Wizard.
The Fact Build wizard appears.
7. In the Enter the name of the build box, type TranslationLookup, in the
Select the connection into which the build is to deliver data list, click
TargetConnect, and then select the Perform a full refresh on the target
data check box.
8. Click Next, click Data Source, and then click Add.
The Data Source wizard appears.
9. In the Select the connection from which the data source is to read list, click
SourceConnect, and then click Next.

9-8

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

10. Type the following SQL code in the right pane:


SELECT

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.

3. Right-click the CurrencyD dimension, and then click Insert Lookup.


The Lookup Properties window opens.
4. In the Name box, type CurrencyL.

You can create the template attributes


manually (as we do in Task 2), or you
can add them by importing columns
from tables. If you import columns,
keep only the attributes that you
require for the CurrencyL lookup.

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).

9-9

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

5. Click the Attributes tab, and then click New.


The Template Properties window opens.
6. In the Name box, type CurrencyT.
7. Click the Attributes tab, click Add, and then type CountryCurrencyCode.
8. Click Add, and then type Country.
9. Click Add, type Rate, and then press Enter.
10. Click OK to close the Template Properties window.
Task 4. Add attributes to the CurrencyL lookup.
1. Click Add all attributes to move all the available attributes into the Chosen
attributes pane.
2. In the CountryCurrencyCode row, select the Id check box.
3. In the Country row, select the Caption check box.
4. Click OK.
Task 5. Create a data source for the CurrencyL lookup.
1. In the Visualization pane, right-click the CurrencyL lookup, and then click
Insert Data Source.
The Data Source Properties window opens.
2. Click the Query tab, and then in the Database list, click SourceConnect.
3. In the Database objects pane, expand SourceConnect and dbo, right-click
GOSConversionRate, and then click Add table select statement.
The SQL statement appears in the Query pane.
4. Modify the statement so that it appears as shown below:
SELECT

FROM
WHERE

"CountryCode",
"ConversionYear",
"ConversionMonth",
"ConversionToLocal",
"Country"
"dbo"."GOSConversionRate", "GOSCountry"
"CountryCode" = "SalesCountryCode"

5. Click Return all rows.


504 rows are returned.
6. Click the Result columns tab, ensure that Prepare is selected, and then
click Refresh to prepare the columns for use in the lookup.
7. Click the Derivations tab, and then click Add.
The Derivation Properties window opens.

9-10

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

8. In the Name box, type CountryCurrencyCode, and then click the


Calculation tab.
9. In the right pane, type Concat(ToChar(CountryCode), ToChar(100 *
ConversionYear + ConversionMonth)).
This formula will combine the values in the ConversionYear and
ConversionMonth columns, multiply this combination by 100, and then
concatenate these values with the values in the CountryCode column.
10. Click OK to close the Derivation Properties window, and then click OK to
close the Data Source Properties window.
Task 6. Map the DataStream items and lookup attributes.
1. In the left pane, ensure that CurrencyL is selected, in the Visualization
pane, right-click DataStream, and then click Properties.
The DataStream Properties window opens.
2. Drag and drop ConversionToLocal, Country, and
CountryCurrencyCode from the Data Source column to the DataStream
Items column to create and map the appropriate DataStream items.
The results appear as shown below:

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:

5. Click OK, and then save the catalog.

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).

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

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

Task 8. Create a derivation to convert currency data into


local currency.
1. Under TranslationLookup, right-click Transformation Model, and then
click Insert Derivation.
The Derivation Properties window opens.
2. In the Name box, type RevenueLocal, and then click the Calculation tab.
3. In the right pane, type the following:
(Quantity * UnitPrice) * ToDouble(CountryCode.Rate)
This formula will calculate the revenue generated by each order: the number
of units sold multiplied by the price of each unit. It will then convert the
revenue value by multiplying it by the appropriate currency rate.
4. Click OK, and then click Yes to add the element to the fact delivery.
Task 9. Map the CountryCode dimension element to the
appropriate column.
1. In the Visualization pane, double-click the DataSource1 data source.
The Data Source Properties window opens.
2. Click the Derivations tab, and then click Add.
The Derivation Properties window opens.
3. In the Name box, type CountryCode, and then click the Calculation tab.
4. In the right pane, type
Concat(CountryCode, (Concat(SubStr(ToChar(OrderDate), 1, 4),
SubStr(ToChar(OrderDate), 6, 2))))
This formula will concatenate each country code with the year and month
sections of each order date value. This concatenated value will be compared
against the values of the CountryCurrencyCode attribute of the CurrencyL
lookup.
5. Click OK to close the Derivation Properties window, and then click OK to
close the Data Source Properties window.
Task 10.

Map the incoming data to the TranslationLookup


transformation model.

1. In the Visualization pane, right-click DataStream, and then click


Properties.
The DataStream Properties window opens.
2. In the Data Source column, click the CountryCode data source derivation,
and then drag it to the DataStream Items pane.
The derivation is automatically mapped to the CountryCode DataStream
item.

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).

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:

4. Click OK, in the Visualization pane, right-click the Transformation Model


of the TranslationLookup build, and then click Mapping.
The Transformation Model Mapping window opens.
Ensure that the results appear as shown below:

If you still need to map the CountryCode DataStream item, in the


Transformation Model pane, expand the CountryCode dimension element
and the CurrencyL lookup. Then click and drag the
CountryCurrencyCode attribute from the Transformation Model pane to
the CountryCurrency DataStream item.
5. Click OK to close the Transformation Model Mapping window.
Now you need to provide a value for rows that do not have a match in the
reference data. By default, they will have NULL values in the RevenueLocal
column.

9-14

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

Task 11. Provide a value for NULL values.


1. In the Visualization pane, right-click the F_TranslationLookup table (on
the far right side), and then click Properties.
The Table Delivery Properties window opens.
2. Click the Table Properties tab (if necessary), click the RevenueLocal row,
and then in the Element Properties column, click the ellipsis.
The Delivery Element Properties dialog box appears.
3. In the Value if NULL box, type 0, click OK, and then click OK to close the
Table Delivery Properties window.
Task 12. Execute the TranslationLookup fact build and
analyze the results.
1. In the Visualization pane, double-click the DataStream.
The DataStream Properties window opens.
2. Click the Input tab, and then in the Maximum input rows to process box,
type 3000.
3. Click OK, and then save the catalog (click Save my version when
prompted).
4. In the tree, click the TranslationLookup build, and then on the toolbar,
click Execute.
3000 rows of data are inserted into the F_TranslationLookup table.
5. Press Enter to close the command window, and then open SQLTerm.
6. In the Database list, click TargetConnect.
7. In the Database objects pane, expand TargetConnect and dbo, right-click
F_TranslationLookup, and then click Add table select statement.
8. In the Query pane, at the bottom of the SELECT statement, type
ORDER BY "RevenueLocal".

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).

9-15

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

9. Click Return all rows.


The results appear as shown below (your rows may appear slightly different,
but they will be sorted in ascending order based on the values in the
RevenueLocal column).

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.

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

Use an Optional Lookup


You can use a lookup to flag unmatched members in a
dimension instead of rejecting them.
The fact build must have two elements: a dimension element to
reference the lookup, and a derivation element to calculate the
literal value for non-matching members.
You then execute the fact build to actually flag the unmatched
data.
Optional lookup flags rows with
matching State codes as found

Rows in the fact build that do not


contain valid state codes are flagged
as not found

Sometimes, data integrity checking is considered optional. That is, instead of


rejecting a fact row that has no match in the dimension table, you want the row to
be included in the fact table, but flagged as failing the check. You can flag this row
by using an optional lookup.
A value for matching rows is defined in the lookup, and a value for non-matching
rows is defined in the fact build.

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.

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).

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

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

Demo 2: Flag Invalid Data using an Optional Lookup


Purpose:
In one of your catalogs, you suspect that some incoming fact
data contains invalid location information. You want to accept all
fact rows, including those containing state codes that do not
exist in the Location dimension. However, you want to flag these
rows so that they can be investigated further.
Task 1. Create the StateLookupOptionalL lookup and
related template.
1. From the File menu, click Open Catalog, and then click OK.
The Open Catalog dialog box appears.
2. In the left pane, click ODBC, in the Data Source Name list, click
Day1Catalog, and then click OK.

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.

Day1Catalog opens in Data Manager.


3. Expand the Dimensions folder, right-click Location, and then click
Insert Lookup.
The Lookup Properties window opens.
4. In the Name box, type StateLookupOptionalL, click the Attributes tab,
and then click New.
The Template Properties window opens.
5. In the Name box, type StateLookupOptionalT, click the Attributes tab,
and then click Add.
6. Type state_cd and then click Add.
7. Type state_name and then click Add.
8. Type found and then click OK.
9. Click Add all attributes to add the three attributes to the Chosen attributes
pane.
10. In the state_cd row, select the Id check box, in the state_name row, select
the Caption check box, and then click OK.
Task 2. Specify a data source for the optional lookup.
1. In the Visualization pane, right-click StateLookupOptionalL, and then
click Insert Data Source.
The Data Source Properties window opens.
2. Click the Query tab, in the Database list, click Reference.

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).

9-19

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

3. In the Database objects pane, expand Reference and dbo, right-click


dm_location, and then click Add table select statement.
A SELECT statement is added to the Query pane.
4. Modify the statement so that it appears as shown below:
SELECT
FROM

"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

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

Task 4. Create a fact build that references the optional


lookup.
1. On the toolbar, click Start the Fact Build Wizard.
The Fact Build wizard opens.
2. In the Enter the name of the build box, type OptionalLookup, in the
Select the connection into which the build is to deliver data list, click
Output, and then click Next.
3. Click Data Source, and then click Add.
The Data Source Properties window opens.
4. In the Select the connection from which the data source is to read list, click
Sales, and then click Next.
5. Expand dbo and dm_sales, and then select the state_cd and revenue
check boxes.
A SELECT statement is created for the data source.
6. Click Finish, click Next, and then click Next again.
7. In the Use Reference column, click the ellipsis, and then expand Location.
8. Click StateLookupOptionalL, and then click Next.
9. Click Next three times, and then clear the Deliver dimensions check box.
10. Click Next, and then click Finish.
Task 5. Add a derivation to the fact build to flag unmatched
rows.
1. In the tree, expand the OptionalLookup fact build, right-click
Transformation Model, and then click Insert Derivation.
The Derivation Properties window opens.
2. In the Name box, type Found, and then click the Calculation tab.
3. Double-click the Reference Attributes folder, double-click
state_cd.found, and then click OK.
4. Click Yes to add the element to the fact delivery.
Task 6. Configure and execute the fact build.
1. In the Visualization pane, in the Transformation Model, double-click
state_cd.
The Dimension Properties window opens.
2. Click the Unmatched Members tab, select the Accept unmatched
member identifiers check box, 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).

9-21

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

3. In the Visualization pane, double-click the F_OptionalLookup table (on


the far right side)
The Table Properties window opens.
4. Click the Table Properties tab (if necessary), click the Found row, and
then click the ellipsis.
The Delivery Element Properties dialog box appears.
5. In the Value if NULL box, type N, and then click OK.
6. Click OK, save the catalog, and then in the tree, click the OptionalLookup
fact build.
7. On the toolbar, click Execute.
The build runs and delivers 10,529 rows to the F_OptionalLookup table.
8. Press Enter, and then open SQLTerm.
9. In the Database list, click Output, and then in the Database objects pane,
expand Output and dbo.
10. Right-click F_OptionalLookup, and then click Add table select
statement.
11. In the Query pane, under the SELECT statement, type ORDER BY
"state_cd", and then click Return all rows.
12. Scroll to near the middle of the result set, until NX appears in the state_cd
column.
The result appears as shown below (your rows may appear slightly different,
but the values in the state_cd column will be in ascending order):

The state with a code of NX does not exist in the StateLookupOptionalL


lookup. These rows were accepted into the fact table, but they were flagged
with a value of N in the Found column.
13. Close SQLTerm.
Results:
You used an optional lookup in a fact build to detect and flag
invalid state codes in the incoming fact data.

9-22

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

What is a Derived Dimension?


A derived dimension allows you to use a calculated expression
as the source for a dimension element.
You can use a derived dimension to perform lookups against
existing dimension data.
Derived dimensions reduce the need to stage data, or use the
Lookup function in a data source or DataStream derivation.
Single order on May 1, 2008
Three-pack Tent Pegs
19 individual tent pegs sold

Four-pack Tent Pegs


12-pack Tent Pegs

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.

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).

9-23

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

How to Create a Derived Dimension


1. Name the derived
dimension.

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.

3. Select the dimension and


reference structure (lookup or
hierarchy).

If the fact build has deliveries defined,


you are given the option of automatically
adding the derived dimension to the
deliveries.

To create a derived dimension:


1. Add a derived dimension element to the transformation model of the fact
build and provide a name for it.
2. Add a calculated expression as the source for the derived dimension.
3. Select the dimension and reference structure (lookup or hierarchy) that
holds the required information.

9-24

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

Demo 3
Use a Derived
Dimension Element in a
Fact Build

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).

9-25

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 3: Use a Derived Dimension Element in a Fact


Build
Purpose:
You have rows of transactional data that show the number of
items sold, by which sales person, on which date. The data
shows how many single, double, triple, or multi packs of items
were sold. Business analysts at The Great Outdoors Company
want to know both how many packs have been sold, as well as
the total number of individual items (for example, three tent pegs
in one three-pack). You will use a derived dimension and a
derivation to return the number of individual items that were
sold.

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.

Task 1. Examine ProductUOMLookup.


1. From the File menu, click Open Catalog.
A message appears, indicating that this will close the current catalog.
2. Click OK.
The Open Catalog box appears, prompting you to select a catalog.
3. In the left column, ensure that ODBC is selected, in the Data Source Name
list, click DS_Advanced, and then click OK.

The ProductDD lookup retrieves data


from the D_Product table in the
DS_Sources connection.
This demo is an example of using
derived dimensions to perform a
"lookup on a lookup."

The DS_Advanced catalog opens in Data Manager.


4. In the left pane, expand the Dimensions folder and the Product
dimension, right-click ProductUOMLookup, and then click Explore.
Reference Explorer opens.
5. Click OK.
ProductUOMLookup opens in Reference Explorer. You will reference this
lookup in your derived dimension element.

9-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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

6. In the Elements pane, click 2 (Double).


The result appears as shown below:

You can see that the product with a PRODUCT_UOM_CODE of Double


represents a double-pack of an item (for example, a pack containing two
tent pegs). The other values for PRODUCT_UOM_CODE represent
other pack sizes (Single, Triple, and Multi).
7. Close Reference Explorer.
Task 2. Explore the ProductDD lookup.
1. In the left pane, right-click the ProductDD lookup, and then click
Explore.
Reference Explorer opens.
2. Click OK.
The ProductDD lookup opens in Reference Explorer.
3. In the Elements pane, click Insect Bite Relief.
The result appears as shown below:

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.

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).

9-27

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

4. In the Elements pane, click TrailChef Water Bag.


You can see that this product has a value of Single for
PRODUCT_UOM_CODE. This indicates that the product is sold in a
single pack. Most of the products sold by the Great Outdoors are sold in
single packs.
5. Close Reference Explorer.
Task 3. Add the derived dimension element to the fact build.
1. In the left pane, expand the ProductSales fact build, right-click
Transformation Model, and then click Insert Derived Dimension.
The Derived Dimension Properties dialog box appears.
2. In the Name box, type UOM, and then select the Never Output check
box.
3. Click the Calculation tab, and then in the Expression pane, double-click
the Reference Attributes folder.
4. In the Expression pane, double-click
PRODUCT_CODE.PRODUCT_UOM_CODE.
The expression is added to the right pane. This expression will return the
PRODUCT_UOM_CODE value for each product (Single, Double, Triple,
or Multi).
5. Click the Reference tab, and then in the Dimension list, click Product.
6. In the Structure list, click ProductUOMLookup (L).
Data Manager will access the ProductUOMLookup that contains the
PRODUCT_UOM attribute. The PRODUCT_UOM attribute (not the
PRODUCT_UOM_CODE attribute) is the multiplier (a value of either of
1, 2, 3, or 4) that you require in order to calculate the number of individual
items that were sold.
For example, a product in the sales data may have a
PRODUCT_UOM_CODE value of Triple. This
PRODUCT_UOM_CODE is associated with a PRODUCT_UOM value
of 3. Therefore, the number of products (packs) that were sold will be
multiplied by three. This result represents the number of individual items
that were sold.
7. Click OK.

9-28

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

Task 4. Add a derivation that references the derived


dimension.
1. In the left pane, right-click Transformation Model, and then click Insert
Derivation.
The Derivation Properties dialog box appears.
2. In the Name box, type TOTAL_UNITS_SOLD, and then click the
Calculation tab.
3. In the left pane, double-click the Elements folder, and then double-click
QUANTITY.
The QUANTITY element is added to the right pane.
4. In the left pane, double-click the Operators and Mathematical folders,
and then double-click the * operator.
5. In the left pane, double-click the Reference Attributes folder, and then
double-click the UOM.PRODUCT_UOM attribute.
This expression will multiply the quantity (that is, the number of packs) that
was sold with the PRODUCT_UOM value, which defines the number of
items in each pack.
6. Click OK.
A message appears, prompting you to add the element to existing delivery
modules in the ProductSales fact build. You want to output this element to
the fact table.
7. Click Yes, and then save the catalog.
Task 5. Verify the data source connections, execute the
fact build, and then view the results.
1. Expand the Connections folder, right-click DS_Advanced_out, and then
click Properties.
2. Click the Connection Details tab, in the Data Source Name list, ensure
that DS_Advanced_out is selected, and then click OK.
3. Repeat steps 1 and 2 to verify the other data source connections:
DS_Marts - points to DS_Marts
GO_Sales - points to GOSales
GO_Vendors - points to GOVendors
MarketResearch - points to GOMarket
4. Save the catalog, in the left pane, click the ProductSales fact build, and
then on the toolbar, click Execute.
A command window opens and the fact build executes, delivering 43,063
rows to the ProductSales table.

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).

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):

Because you modified the SELECT statement to remove single-pack


orders, all of the values in the TOTAL_UNITS_SOLD column are higher
than the values in the QUANTITY column. The TOTAL_UNITS_SOLD
column made use of the UOM derived dimension element to return the
total number of individual items that were sold in each order (as opposed to
the number of packs).
For example, you can see that products with a PRODUCT_CODE of 3
contain three individual items (in this case, three containers of insect
repellent). The first row of the screen capture shows that 112 packs were
sold (since the QUANTITY column has a value of 112), which represents
336 individual containers (336 in the TOTAL_UNITS_SOLD column) of
insect repellent (3 * 112 = 336).

9-30

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).

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):

You can see that products with a PRODUCT_CODE of 24 contain four


individual items (in this case, four tent pegs). The first row of the screen
capture shows that 96 packs were sold (since the QUANTITY column has
a value of 96), which represents 384 individual tent pegs (4 * 96 = 384).
Since most of the products sold by the Great Outdoors are sold in single
packs, most of the values in the QUANTITY column will be identical to
the values in the TOTAL_UNITS_SOLD column.
12. Close SQLTerm, and then save the catalog.
Results:
You added a derived dimension and a derivation to a fact build.
By adding these elements, business analysts at the Great
Outdoors can see both the number of packs, as well as the total
number of individual items, that have been sold.

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).

9-31

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Summary
In this module, we have:

9-32

identified when to use lookups

identified the requirements for a lookup

created a translation lookup

created an optional lookup

added derived dimensions to fact builds

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

Workshop 1
Avoid Joins in a Data Source by using
Derived Dimensions

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).

9-33

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 1: Avoid Joins in a Data Source by using


Derived Dimensions
Business analysts at The Great Outdoors Company frequently track order return
rates, in a continuous effort to improve customer satisfaction. To make this effort
easier, you will create a fact table to store returns data. This fact table will require
data from three tables in the source database: GOSReturnedItem,
GOSOrderDetails, and GOSOrderHeader. To avoid numerous and cumbersome
joins in the data source, you will use lookups and derived dimensions instead. By
using lookups and derived dimensions, you will be able to create a fact build that
uses a query against a single table, instead of a query against multiple tables.
To accomplish this:

9-34

open the GO_Catalog, and then create the OrderDetailsL lookup


consisting of the following columns from GOSOrderDetails (use a
template for data access):

OrderDetailsCode (ID attribute)

OrderCode

ProductNumber

create the OrderHeaderL lookup consisting of the following columns from


GOSOrderHeader (use a template for data access):

OrderCode (ID attribute)

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.

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

Add the following derived dimension elements to the F_Returns fact build
(use surrogates when available):

ProductNumber: references the D_ProductL lookup and the


OrderDetailCode.ProductNumber reference attribute

OrderCode: references the OrderHeaderL lookup and the


OrderDetailCode.OrderCode reference attribute

DateOrder: references the D_DayL lookup and the


OrderCode.OrderDate reference attribute

VendorSiteCode: references the D_VendorSiteL lookup and the


OrderCode.VendorSiteCodeGO reference attribute

SalesStaffCode: references the D_StaffL lookup and the


OrderCode.SalesStaffCode reference attribute

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.

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).

9-35

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 1: Task Table


TASK

WHERE TO WORK

HINTS

1. Create the OrdersD


dimension, OrderDetailsL
lookup, and
OrderDetailsT template.

Dimensions folder

Open the GO_Catalog.

In the OrderDetailsT template,


import all the columns of the
GOSOrderDetail table. Ensure
that each of the attributes in
the template match those in
the table (press Enter after
changing any values).

Add OrderDetailCode,
OrderCode, and
ProductNumber to the lookup,
specifying OrderDetailCode as
the ID attribute.

Use a template for data access,


specifying the
GOSOrderDetail table.

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.

Use a template for data access,


specifying the
GOSOrderHeader table.

2. Create the OrderHeaderL


lookup and
OrderHeaderT template.

9-36

OrdersD dimension

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

TASK

WHERE TO WORK

HINTS

3. Create the Returns fact


build.

Fact Build wizard

Perform a full refresh on the


target data.

Select the SourceConnect


connection, and then select all
of the columns from the
GOSReturnedItem table.

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).

Select the Use surrogates when


available check box.

DateOrder, DateReturn,
VendorSiteKey, SalesStaffKey,
OrderCode, OrderDetailCode,
ReturnCode,
ReturnReasonCode,
ProductKey, ReturnQuantity

4. Add derived dimensions


to the Returns fact build.

Returns fact build,


Transformation Model
node

5. Modify column names and Table Delivery Properties


column order in the
window
F_Returns table delivery.

DIMENSIONS

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).

9-37

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

TASK

WHERE TO WORK

HINTS

6. Execute the Returns fact


build and view the results
in SQLTerm.

Execute button

SQL Term window

The build will deliver 706 rows


(no rejects) to the F_Returns
table.

If you need more information to complete a task, see the Step-by-Step instructions
at the end of this workshop.

9-38

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).

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:

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).

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

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

Workshop 1: Step-by-Step Instructions


Task 1. Create the OrdersD dimension, OrderDetailsL
lookup, and OrderDetailsT template.
1. From the File menu, click Open Catalog, and then click OK.
2. In the left pane, click SQL Server (OLE-DB), in the Username box, type
sa, and then in the Password box, type Education1!.
3. In the Server Name list, select (local), and then in the Database Name box,
type GO_Catalog.
4. In the OLE DB Provider list, ensure that sqloledb (SQL Server 2000
OLEDB) is selected, and then click OK.
5. In the left pane, right-click Dimensions, and then click Insert Reference
Dimension.
6. In the Name box, type OrdersD, and then click OK.
7. Right-click the OrdersD dimension, and then click Insert Lookup.
8. In the Name box, type OrderDetailsL, click the Attributes tab, and then
click New.
9. In the Name box, type OrderDetailsT, and then click the Attributes tab.
10. Click Import Table, expand SourceConnect and dbo, and then click
GOSOrderDetail.
11. Click OK.
12. Double-click the left cell in the first row, ensure that the attribute is called
OrderDetailCode (modify it if necessary), and then press Enter.

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.

If you receive this error message,


click OK to dismiss it. The attributes
will still be added to the template as
expected.

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:

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).

9-41

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

19. In the Visualization pane, right-click the OrderDetailsL lookup, click


Explore, and then click OK.
The members of the OrderDetailsL lookup are displayed.
20. In the left pane, click the first member in the list (47737).
The result appears as shown below:

21. Close Reference Explorer.


Task 2. Create the OrderHeaderL lookup and OrderHeaderT
template.
1. Right-click the OrdersD dimension, and then click Insert Lookup.
2. In the Name box, type OrderHeaderL, and then click the Attributes tab.
3. Click New, in the Name box, type OrderHeaderT, and then click the
Attributes tab.
4. Click Import Table, expand SourceConnect and dbo, and then click
GOSOrderHeader.
5. Click OK.
6. Double-click the left cell in the first row, ensure that the attribute is called
OrderCode (modify it if necessary), and then press Enter.
7. Click OK to close the Template Properties window, and then double-click
OrderCode, VendorSiteCodeGO, SalesStaffCode, OrderDate, and
OrderMethodCode to add them to the Chosen attributes pane.
8. In the OrderCode row, select the Id check box, and then click the Data
Access tab.

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

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).

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:

13. In the Visualization pane, right-click the OrderHeaderL lookup, click


Explore, and then click OK.
The members of the OrderHeaderL lookup are displayed.
14. In the left pane, click the first member in the list (1153).
The result appears as shown below:

15. Close Reference Explorer.


Task 3. Create the Returns fact build.
1. On the toolbar, click Start the Fact Build Wizard, in the Enter the name
of the build box, type Returns, and then in the Select the connection into
which the build is to deliver data box, select TargetConnect.
2. Select the Perform a full refresh on the target data check box, and then
click Next.
3. Click Data Source, and then click Add.
4. In the Select the connection from which the data source is to read list, select
SourceConnect, and then click Next.
5. Expand dbo, select the GOSReturnedItem check box, and then click
Finish.
6. Click Next, and then click ReturnCode.
7. Click Change Type, click To Attribute, and then click Next.
8. In the ReturnDate row, click the browse button beside (no reference),
expand TimeD, and then click D_DayL.

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).

9-43

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

9. Repeat step 8 to assign the OrderDetailsL lookup (within the OrdersD


dimension) to the OrderDetailCode dimension element.
The result appears as shown below:

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

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

Task 4. Add derived dimensions to the Returns fact build.


1. In the tree, expand the Returns fact build (if necessary), right-click
Transformation Model, and then click Insert Derived Dimension.
2. In the Name box, type ProductNumber, and then click the Calculation
tab.
3. In the left pane, double-click the Reference Attributes folder, and then
double-click OrderDetailCode.ProductNumber to add it to the
calculation.
4. Click the Reference tab, in the Dimension list, select ProductD, and then
in the Structure list, select D_ProductL (L).
5. Select the Use surrogates when available check box, click OK, and then
click Yes to add the element to existing delivery modules.
6. Repeat steps 1 to 5 to create the following derived dimensions as follows:
Name: OrderCode
Calculation: OrderDetailCode.OrderCode
Reference: OrderHeaderL (L) (within the OrdersD dimension)
***
Name: DateOrder
Calculation: OrderCode.OrderDate
Reference: D_DayL (L) (within the TimeD dimension)
***
Name: VendorSiteCode
Calculation: OrderCode.VendorSiteCodeGO
Reference: D_VendorSiteL (L) (within the VendorD dimension)
***
Name: SalesStaffCode
Calculation: OrderCode.SalesStaffCode
Reference: D_SalesStaffL (L) (within the StaffD dimension)
***

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).

9-45

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

The result appears as shown below:

7. Save the catalog, and then click the Mapping tab.


The result appears as shown below:

9-46

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).

TRANSFORM

DATA

USING

LOOKUPS

AND

DERIVED

DIMENSIONS

8. Click the Transformation Model tab.


The result appears as shown below:

Task 5. Modify column names and column order in the


F_Returns table delivery.
1. In the Visualization pane, click the Returns tab, and then double-click the
F_Returns table delivery.
2. Click the Table Properties tab (if necessary).
3. Click ReturnDate, and then in the Column Name column, type
DateReturn.
4. Repeat step 3 to rename the columns of the table delivery so that the result
appears as shown below:

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).

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

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).

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:

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).

9-49

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

9-50

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).

10

Customize Data Delivery

IBM Cognos 8 BI

2008 IBM Corporation

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

10-2

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).

CUSTOMIZE

DATA

DELIVERY

Objectives
In this module, we will:

configure fact and dimension delivery modules

create indexes on fact and dimension tables

update fact data using keys

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).

10-3

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Delivery Process to a Single Data Mart

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

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).

CUSTOMIZE

DATA

DELIVERY

Delivery Process to a Data Warehouse


Input Hierarchies
Reference
Data

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.

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).

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

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).

CUSTOMIZE

Deliver Fact Data to a Relational Table


Add a relational table delivery to a fact build if you want to format the
data into relational tables.
These tables can be accessed by client-server applications, or can
form the basis of standard reporting systems.
You can specify:

the name of the target database and table

how you want to refresh the data

which transformation elements you want to include as columns

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.

select the method by which rows


should be applied to the output
table. These are discussed later in
this module.
define the interval (in terms of
number of rows updated or inserted,
or both) between commits of data in
the output table (optional). If you
leave this blank, Data Manager will
commit all the rows at the end of the
load

The Update option is disabled for


columns that are acting as keys (that is,
those for which the Key option is
selected).

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).

10-7

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Configure Data Updating for a Relational Table


If you add a relational table delivery to your fact build, you can
specify how you want to update the rows in the table.
You may not know if an incoming row has the same key as one that
already exists in the table.
Depending on the profile of your data, choose either the Update or
Update/Insert delivery method.

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

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).

CUSTOMIZE

DATA

DELIVERY

Configure Data Updating for a Relational Table (cont'd)


By default, when Data Manager updates a
fact table, all columns in the table are
updated, with the exception of any
columns identified as key columns.
By excluding the columns that you do not
want to update, you will reduce
processing time and improve
performance.

Use the control attributes to track when rows


are updated or inserted into the fact table.

Clear check boxes for any columns that


you do not want to update in the
target table.

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.

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).

10-9

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Select the Update Detection Method for a


Relational Table
The way in which Data Manager updates or inserts data into the
table depends on the update detection method that you choose.
There are four update detection methods:

Update

Select

Key Cache

Select/Compare

The effect of each method depends on the delivery method that


you select.

If you select the Update/Insert delivery method:

choose the Update detection method, if most of the rows to be delivered


already exist in the target table, but need to be updated

choose the Select detection method, if most of the rows to be delivered


contain new data, and therefore need to be inserted rather than updated

choose the Key Cache method (in preference to Select) if performance is


an issue and either sufficient memory is available for a key cache in
memory, or an appropriate restriction can be used to restrict the number
of key value combinations for a key cache on disk.

choose the Select/Compare detection method, if the rows to be delivered


contain unique incoming row keys, most delivery rows already exist in the
target table and there are minimal changes, and you want individual
columns to be updated accurately, rather than updating the whole row

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.

For the Update delivery method:

choose the Update detection method, if most of the rows to be delivered


already exist in the target table and need to be updated

choose the Select detection method, if most of the rows to be delivered


already exist in the target table and there are minimal changes to the data,
and the delivery does not contain unique incoming row keys

10-10

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).

CUSTOMIZE

choose the Key Cache method (in preference to Select) if performance is an


issue and either sufficient memory is available for a key cache in memory, or
an appropriate restriction can be used to restrict the number of key value
combinations for a key cache on disk

choose the Select/Compare detection method, if most of the rows to be


delivered already exist in the target table and there are minimal changes, and
you want individual columns to be updated accurately, rather than updating
the whole row

DATA

DELIVERY

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).

10-11

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Deliver Fact Data to a Text File


Add a text file delivery to a fact build if you want to format the data
into simple text files.
These tables can then be imported into spreadsheets for crosstab
(pivot table) analysis, or distributed to other systems.
You can specify:

the full directory path and file name

line and field delimiters

which transformation elements you want to include as columns

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

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).

CUSTOMIZE

DATA

DELIVERY

Deliver Dimension Data in a Fact Build

To deliver dimension data in a fact build:


1.

Add the dimension delivery to the fact build.

2.

Add a relational table to the dimension delivery.

3.

Type or select a name for the dimension table.

4.

Create or select a template for the table.

5.

Map the data from the hierarchy or lookup to the template


attributes.

In general, you should not deliver dimension data in a fact build. However, there are
exceptions to this rule:

a demo or proof of concept

data mart delivery from a warehouse

dimension data available only in fact data

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).

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

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).

CUSTOMIZE

DATA

DELIVERY

Demo 1: Manually Add a Relational Table Delivery to a


Fact Build
Purpose:
You want to add a second relational table delivery to the
DemoSales fact build of the GO_Catalog. You will ignore
dimension delivery in this fact build because you have already
used dimension builds to create the dimension tables that you
require. You will add a new delivery called F_DemoFact, execute
the DemoSales build, and then view the results in SQLTerm.
Task 1. Associate lookups to dimension elements, and then
add a table to the fact delivery of the DemoSales
fact build.
1. Open Data Manager.
2. In the Welcome dialog box, click Open an existing catalog.

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.

3. If necessary, 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.
6. In the tree, expand the DemoSales fact build, in the Visualization pane,
right-click ProductNumber, and then click Properties.
The Dimension Properties window opens.
7. Click the Reference tab, in the Dimension list, click ProductD, and then
in the Structure list, click D_ProductL (L).
8. Select the Use surrogates when available check box, and then click OK.
9. Repeat steps 6 to 8 for the VendorSiteCode and DateOrder dimension
elements. Associate the VendorSiteCode element to the D_VendorSiteL
lookup in the VendorD dimension. Associate the DateOrder dimension
element to the D_DayL lookup in the TimeD dimension.
By associating the dimension elements to the appropriate lookups, you can
perform data integrity checking.
10. In the tree, under the DemoSales fact build, expand the Delivery
Modules folder (if necessary), right-click Fact Delivery, and then click
Insert Relational Table Delivery.
The Table Delivery Properties window opens.

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).

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

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).

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.

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).

10-17

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Create Indexes on Fact and Dimension Tables

Indexes are used to improve the performance of queries and data


updates.

Data Manager provides three index types:


1.

unique B-tree

2.

repeating B-tree (default)

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).

Keys ensure that the values in a column


are unique. For example, only one
employee can have a value of 1234 for
EmployeeCode.
Because indexes and keys are used for
different purposes, they are not
interchangeable. However, it is
recommended that you or the DBA
create indexes on key columns to
support both the logical and the
physical data structure.
Technical Information
The unique B-tree index builds a tree
structure of possible values with a list of
row unique identifiers that have the leaf
value. It involves moving up the tree
and finding the rows that contain a
given value. The index can be created
on one or many columns.
The repeating B-tree index is built in a
similar way to the unique B-tree index.
A bitmap index represents a string of
bits for each possible value of the
column. Each bit string has one bit for
each row. Each bit is set to 1 if the row
has the value that the big string
represents, and is set to 0 if the row
does not have that value.

10-18

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).

CUSTOMIZE

DATA

DELIVERY

Data Manager provides two options, single-column and


composite, for fact table indexes.

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.

For better performance and flexibility, a column can have a


single-column index and be a part of a composite index.

The most common need for a composite


index is to locate a fact row for updating.

Use Fact Table Indexes


When updating data in tables, using indexes makes it faster to
retrieve the rows that must be updated.

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 single-column index, created separately for each column

a composite index, which is a single index based on the fact table keys
represented by dimension elements

Composite indexes are of limited use in


reporting. Unless a query includes the
leading segment (column) of the
composite index, the last segment will
not be used.
All dimension tables must have a singlecolumn primary key and therefore one
unique index on that key. Larger
dimension tables have more than one
single-column index.
However, small dimension tables seldom
benefit from additional indexing. In a
dimension table that has both business
and surrogate key columns, the unique
index is created on the surrogate key
column, which is a primary key column.
The repeating index is created on the
business key column.
Indexes are important for faster data
retrieval. However, they are memory
consuming and slow the system's load
and maintenance processes. Although
indexes are important for updates, they
are not needed for inserts.
By selecting the Recreate Index box in
the Index Properties, you can drop the
index before an insert and re-create it
after. To ignore errors while Data
Manager is re-creating the index, select
the Suppress Errors box.

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).

10-19

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Specify Keys for a Fact Table


By default, Data Manager creates keys on the dimension element
columns in the fact table.
You can create keys on non-dimension columns if you want to use
them in the WHERE clause of the UPDATE statement.
However, as soon as you explicitly define the keys, Data Manager
overwrites the default key columns with the new ones.
Therefore, to preserve dimension element column keys after you
create keys on non-dimension columns, you must define them
explicitly.

10-20

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).

CUSTOMIZE

DATA

DELIVERY

Demo 2
Define Keys and Indexes on
Fact and Dimension Tables

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).

10-21

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Demo 2: Define Keys and Indexes on Fact and Dimension


Tables
Purpose:
The company wants to run updates to the F_DemoFact table. To
facilitate this process, you will define keys on the OrderCode and
dimension element columns. You must then create single-column
indexes on the OrderCode column and the dimension element
columns and a composite index on all key columns in the
F_DemoFact table. For convenience, you will create a separate
build to maintain updates to the table.
The company also requires regular updates on a dimension
table. You will create single-column indexes on the surrogate
and business key columns of the D_ProductH table. You will
then add static members to the lowest level of the ProductH
hierarchy, execute the D_ProductH fact build, and then view the
resulting log file.
Task 1. Define keys on OrderCode, ProductNumber,
VendorSiteCode, and DateOrder in the F_DemoFact
table.
1. In the Visualization pane, right-click the F_DemoFact table delivery (on
the bottom right side), and then click Properties.
The Table Delivery Properties window opens.
2. Click the Table Properties tab (if necessary), and then in the OrderCode
row, select the Key check box.
A button appears in the Element Properties column for OrderCode.
3. Click the ellipsis.
The Delivery Element Properties dialog box appears.
4. In the Value if NULL box, type 0.
5. Ensure that the Additive Update check box, if available, is not selected,
and then click OK.

10-22

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).

CUSTOMIZE

DATA

DELIVERY

6. Repeat steps 2 to 5 for ProductNumber, VendorSiteCode, and


DateOrder.
The result appears as shown below:

OrderCode, ProductNumber, VendorSiteCode, and DateOrder have been


specified as keys.
Task 2. Create single-column indexes on dimension element
columns in the F_DemoFact table.
1. In the ProductNumber row, select the Index check box.
An ellipsis button appears in the Index Properties column for
ProductNumber.
2. In the Index Properties column, click the ellipsis.
The Index Properties dialog box appears.
3. In the Name box, type F_DemoFact_i1.
Leave the Type list blank.
4. Select the Suppress Errors and Recreate Index check boxes, 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).

10-23

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

5. Repeat steps 1 to 4 for VendorSiteCode and DateOrder to create the


F_DemoFact_i2 and F_DemoFact_i3 indexes, respectively.
The result appears as shown below:

Task 3. Create a composite index on the F_DemoFact table


key columns.
1. Above the Columns pane, select the Index check box.
The Index Properties button is enabled.
2. Click Index Properties.
The Index Properties dialog box appears.
3. In the Name box, type F_DemoFact_ui1.
4. In the Type list, click UNIQUE.
5. Ensure that the Suppress Errors and Recreate Index check boxes are
selected, and then click OK.
6. Click the Module Properties tab, in the Refresh Type list, click
TRUNCATE, and then click OK to close the Table Delivery Properties
window.
7. Save the catalog (click Save my version if prompted), in the tree, right-click
the DemoSales build, and then click Duplicate.
The DemoSales:1 fact build is created.
Now you want to modify this new build so that it updates the F_DemoFact
table using the created keys and indexes.

10-24

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).

CUSTOMIZE

DATA

DELIVERY

Task 4. Modify the DemoSales:1 build properties.


1. Right-click DemoSales:1 and then click Properties.
The Fact Build Properties window opens.
2. In the Name and Business name boxes, type DemoSalesUpdate, and then
click OK.
3. In the tree, expand DemoSalesUpdate, Delivery Modules, and Fact
Delivery.
4. Under Fact Delivery, right-click F_DemoFact (Relational Table), and
then click Properties.
The Table Delivery Properties window opens.
5. In the Name and Business name boxes, type F_DemoFactUpdate.
6. Click the Table Properties tab, and then click Index Properties.
The Index Properties dialog box appears.
7. Clear the Suppress Errors and Recreate Index check boxes, and then
click OK.
8. In the Element list, click ProductNumber.
Buttons appear in the Index Properties and Element Properties columns.
9. In the ProductNumber row, click the ellipsis in the Index Properties
column.
The Index Properties dialog box appears.
10. Clear the Suppress Errors and Recreate Index check boxes, and then
click OK.
11. Repeat steps 9 and 10 for VendorSiteCode and DateOrder.
You must click the element before the button in the Index Properties
column will appear.
12. Click the Module Properties tab, in the Refresh Type list, click UPDATE,
and then click OK to close the Table Delivery Properties window.
Task 5. Execute the DemoSales fact build and analyze the
results.
1. Save the catalog, in the tree, right-click the DemoSales fact build, 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.

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.

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).

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

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).

CUSTOMIZE

DATA

DELIVERY

5. In the Type list, click UNIQUE.


6. Click OK.
7. In the ProductNumber row, select the Index check box (if it is not already
selected).
An ellipsis button appears in the Index column for the ProductNumber
row.
8. Click the ellipsis.
The Index Properties dialog box appears.
9. In the Name box, type D_ProductH_i1.
Leave the Type list blank.
10. Click OK, and then clear the index boxes for all the columns except
product_skey and ProductNumber.
The result appears as shown below:

11. Click OK to close the Dimension Table Properties window.


We want to see how Data Manager updates the dimension data through a
dimension build. Therefore, we will add extra rows as static members.

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).

10-27

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Task 8. Add static members to the Product level of the


ProductH hierarchy, and then execute the
D_ProductH dimension build.
1. Expand the Dimensions folder and the ProductD dimension (if
necessary), and then click the ProductH hierarchy.
2. In the Visualization pane, right-click the Product level, and then click
Edit Static Members.
The Static Members window opens.
3. Maximize the window if necessary, and then type 110 directly into the
ProductNumber column.

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

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).

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.

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).

10-29

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Summary
In this module, we have:

10-30

configured fact and dimension delivery modules

created indexes on fact and dimension tables

updated fact data using keys

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).

CUSTOMIZE

DATA

DELIVERY

Workshop 1
Manually Create a Fact Build and Add a Fact Delivery

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).

10-31

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 1: Manually Create a Fact Build and Add a Fact


Delivery
You need to create a separate fact table in the data mart that tracks the number of
products that were sold by the Great Outdoors over the past few years. Your
assignment is to manually create a fact build that will process the source data, and
then add a relational table delivery to this build. For this fact delivery, you want to
create indexes on all the dimension element columns.
To accomplish this:

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.

Add the product_skey, vendorsite_skey, salesstaff_skey, and day_skey


dimension elements to the transformation model. Ensure that these
dimension elements reference the appropriate lookup attributes. Specify
that you want to use surrogates when they are available.

Add the Quantity measure and OrderCode attribute to the transformation


model.

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.

Add a relational table delivery to the Fact Delivery folder.

Add single-column indexes to the table delivery. You want to create an


index for each of the dimension element columns (product_skey,
vendorsite_skey, salesstaff_skey, and day_skey). At this point, you want the
indexes to be recreated. However, you do not need to track any errors.

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

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).

CUSTOMIZE

DATA

DELIVERY

Workshop 1: Task Table


TASK
1. Manually create the Sales
fact build.

WHERE TO WORK
Build tree
Data Source Properties
window

SELECT

2. Add the product_skey,


vendorsite_skey,
salesstaff_skey and
day_skey dimension
elements to the fact build.
3. Add a measure and an
attribute to the build.
4. Map the data source
columns to DataStream
items, and the DataStream
items to fact build
elements.

Transformation Model

Use the D_ProductL,


D_VendorSiteL, D_SalesStaffL,
and D_DayL lookups, respectively.

Use surrogate values.

Quantity and OrderCode.

5. Add a fact delivery to the


Sales build.

Table Delivery Properties


window

Transformation Model

HINTS
Name the build Sales.

Use the following SQL code:

a."OrderCode",
"ProductNumber",
"Quantity",
"VendorSiteCodeGO",
"SalesStaffCode",
"OrderDate"
FROM
"GOSOrderDetail" a,
"GOSOrderHeader" b
WHERE
a."OrderCode" =
b."OrderCode"

DataStream Properties
window
Transformation Model
Mapping window

Call the delivery and table F_Sales.


On the Table Properties tab, select
a target database.

On the Module Properties tab,


click Truncate in the Refresh Type
box.
6. Create indexes on the fact
table and limit data input.

Table Delivery Properties


window
DataStream Properties
window

Add single-column indexes to the


product_skey, vendorsite_skey,
salesstaff_skey, and day_skey rows.

Call the indexes F_Sales_i1,


F_Sales_i2, F_Sales_i3, and
F_Sales_i4, respectively.

Suppress errors and recreate the


indexes.

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).

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.

Click the Progress, SQL, and


ExecutedSQL boxes to select
them in the Trace window.

If you need more information to complete a task, see the Step-by-Step instructions
at the end of this workshop.

10-34

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).

CUSTOMIZE

DATA

DELIVERY

Workshop 1: Results
The resulting log file appears similar to that shown below:

The result in SQL Term appears as shown below:

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).

10-35

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

Workshop 1: Step-by-Step Instructions


Task 1. Manually create the Sales fact build.
1. In the tree, right-click Builds and JobStreams, and then click Insert Fact
Build.
The Fact Build Properties window opens.
2. In the Name box, type Sales, and then click OK.
3. In the tree, expand the Sales build, right-click DataStream, and then click
Insert Data Source.
The Data Source Properties window opens.
4. Click the Query tab, and then in the Database list, click SourceConnect.
5. In the Database objects pane, expand SourceConnect and dbo, right-click
GOSOrderDetail, and then click Add table select statement.
The SELECT statement appears in the Query pane.
6. Edit the SQL code so that it appears as shown below:
SELECT

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

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).

CUSTOMIZE

DATA

DELIVERY

5. Repeat steps 1 to 4 to add the vendorsite_skey dimension element to the


build, selecting VendorD in the Dimension box and D_VendorSiteL (L)
in the Structure box.
6. Repeat steps 1 to 4 to add the salesstaff_skey dimension element to the
build, selecting StaffD in the Dimension box and D_SalesStaffL (L) in the
Structure box.
7. Repeat steps 1 to 4 to add the day_skey dimension element to the build,
using TimeD in the Dimension box and D_DayL (L) in the Structure
box.
Task 3. Add a measure and an attribute to the build.
1. Under the Sales build, right-click Transformation Model, and then click
Insert Measure.
The Measure Properties window opens.
2. In the Name box, type Quantity, and then click OK to close the Measure
Properties window.
3. Under the Sales build, right-click Transformation Model, and then click
Insert Attribute.
The Attribute Properties window opens.
4. In the Name box, type OrderCode, and then click OK to close the
Attribute Properties window.
Task 4. Map the data source columns to DataStream items,
and then map the DataStream items to fact build
elements.
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 are automatically mapped to DataStream items.
3. Click OK to close the DataStream Properties window.
4. In the Visualization pane, right-click the Transformation Model, and then
click Mapping.
The Transformation Model Mapping window opens.
5. In the Transformation Model pane, click and drag the OrderCode attribute
to the OrderCode DataStream item, and then click and drag the Quantity
attribute to the Quantity DataStream item.
6. In the Transformation Model pane, expand vendorsite_skey and
D_VendorSiteL, and then click and drag the VendorSiteCode attribute
beside the VendorSiteCodeGO DataStream item in the left 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).

10-37

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

7. In the Transformation Model pane, expand salesstaff_skey and


D_SalesStaffL, and then click and drag the SalesStaffCode attribute
beside the SalesStaffCode DataStream item in the left pane.
8. In the Transformation Model pane, expand product_skey and
D_ProductL, and then click and drag the ProductNumber attribute
beside the ProductNumber DataStream item in the left pane.
9. In the Transformation Model pane, expand day_skey and D_DayL, and
then click and drag the DayId attribute beside the OrderDate DataStream
item in the left pane.
The result appears as shown below:

10. Click OK to close the Transformation Model Mapping window.


Task 5. Add a fact delivery to the Sales build.
1. Under the Delivery Modules folder of the Sales build, right-click Fact
Delivery, and then click Insert Relational Table Delivery.
The Table Delivery Properties window opens.
2. In the Name box, type F_Sales, and then click the Table Properties tab.
3. In the Connection list, click TargetConnect, and then in the Table name
box, type F_Sales.

10-38

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).

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.

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).

10-39

IBM COGNOS 8 BI DATA MANAGER: BUILD DATAMARTS WITH ENTERPRISE DATA (V8.4)

10. Click Return all rows.


The result appears as shown below:

11. Close SQLTerm, and then close Data Manager.

10-40

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).

W W W. C O G N O S . C O M

S-ar putea să vă placă și