Vous êtes sur la page 1sur 410

TRAINING SERVICES

Cognos ReportNet -
Metadata Modeling
COGNOS REPORTNET – METADATA MODELING

Cognos ReportNet – Metadata Modeling Portions Copyright (C) 1998–2002 The OpenSSL Project. All
CR1052 rights reserved. This product includes software developed by
the OpenSSL Project for use in the OpenSSL Toolkit.
Published November 2003 (http://www.openssl.org/).
This product contains Webfx Copyright (C) Erik Arvidsson and
While every attempt has been made to ensure that the Emil A Eklund.
information in this document is accurate and complete, some Portions Copyright (C) Netegrity Inc. ALL RIGHTS RESERVED.
typographical or technical errors may exist. Cognos cannot Portions Copyright (C) 2002–2003, Systinet Corporation. All
accept responsibility for any kind of loss resulting from the use Rights Reserved.
of this document. Portions Copyright (C) 2001 MetaStuff, Ltd. All rights reserved.
This page shows the original publication date. The information Portions Copyright (C) 1995–1998 Jean–loup Gailly and Mark
contained in this book is subject to change without notice. Any Adler.
improvements or changes to either the product or the course Portions Copyright (C) 1999, 2000 Boris Fomitchev. This
will be documented in subsequent editions. software product includes STLPort libraries, which are provided
This guide contains proprietary information that is protected by "as is", with absolutely no warranty express or implied. Any use
copyright. All rights are reserved. No part of this document may is at your own risk. Permission to use or copy these libraries for
be photocopied, reproduced, or translated into another any purpose is hereby granted without fee provided this notice
language without the prior written consent of Cognos is retained on all copies.
Incorporated.
Restricted Rights Legend. The Software and all accompanying Permission to modify the code and to distribute modified code
materials are provided with Restricted Rights. Use, duplication, for the libraries is granted, provided this notice is retained, and a
or disclosure by the U.S. Government is subject to restrictions notice that the code was modified is included with the copyright
as set forth in subdivision (b) (3) (ii) of the Rights in Technical notice.
Data and Computer Software clause at 252.227–7013. The Portions of this software are Copyright (C) 1996–2002 The
Contractor is Cognos Corporation, FreeType Project (www.freetype.org). All rights reserved.
67 South Bedford St., Burlington, MA 01803–5164. This product includes software developed by IBM. Portions
Copyright (C) 1995–2002 International Business Machines
The following acknowledgments represent all packages of Corporation and Others. All rights reserved. This software is
ReportNet. Some may not apply to each component. provided "as is" and any expressed or implied warranties,
Portions Copyright (C) Sun Microsystems, Inc. Sun, Sun including, but not limited to, the implied warranties of
Microsystems, the Sun Logo, iForce, Solaris, and the Java logo merchantability and fitness for a particular purpose are
are trademarks or registered trademarks of Sun Microsystems, disclaimed. In no event shall IBM or its contributors be liable for
Inc. in the United States and other countries. any direct, indirect, incidental, special, exemplary or
Portions Copyright (C) Adobe Systems Incorporated. consequential damages (including but not limited to,
Portions Copyright (C) 2000 The Legion Of The Bouncy Castle procurement of substitute goods or services; loss of use, data,
(http://www.bouncycastle.org). or profits; or business interruption) however caused and on any
theory of liability, whether in contract, strict liability, or tort
Portions Copyright (C) 2000–2002 Glenn Randers–Pehrson.
(including negligence or otherwise) arising in any way out of the
Contributing authors Simon–Pierre Cadieux, Eric S. Raymond,
use of this software, even if advised of the possibility of such
Gilles Vollant.
damage.
Portions Copyright (C) Meta Integration Technology, Inc. 1997–
This product includes software developed by the Apache
2003 . All Rights Reserved. Meta Integration(R) Model Bridge
Software Foundation (http://apache.org/). Portions Copyright (C)
(MIMB), Works (MIW), Repository (MIR), Repository SDK
1999 The Apache Software Foundation. All rights reserved. This
(MIRSDK), and Database SDK (MIDBSDK) are trademarks of
software is provided "as is" and any expressed or implied
Meta Integration Technology, Inc.
warranties, including, but not limited to, the implied warranties of
Portions Copyright (C) JSQLConnect (TM) software merchantability and fitness for a particular purpose are
components are provided by Net Direct LLC. Copyright (C) disclaimed. In no event shall the Apache Software Foundation
1998–2003 Net Direct LLC. All rights reserved. JSQLConnect is or its contributors be liable for any direct, indirect, incidental,
a trademark of Net Direct LLC. special, exemplary or consequential damages (including but not
Portions Copyright (C) Three D Graphics, Inc. limited to, procurement of substitute goods or services; loss of
Sample product images with the pound symbol (#) in the lower use, data, or profits; or business interruption) however caused
right hand corner are copyright (C) 1998 PhotoDisc, Inc. and on any theory of liability, whether in contract, strict liability,
This product uses the Andalé WT typeface under license from or tort (including negligence or otherwise) arising in any way out
Agfa Monotype Limited. Copyright (C) Agfa Monotype Limited. of the use of this software, even if advised of the possibility of
All rights reserved. Andalé is a trademark of The Monotype such damage.
Corporation registered in the U.S. Patent and Trademark Office This software/documentation contains proprietary information of
and certain other jurisdictions. Cognos Incorporated. All rights are reserved. Reverse
Portions Copyright (C) 1986–2002 AccuSoft Corporation. engineering of this software is prohibited. No part of this
AccuSoft and ImageGear are registered trademarks or service software/documentation may be copied, photocopied,
marks, and the patent–pending ReviewNow, DocsNow, NetVue, reproduced, stored in a retrieval system, transmitted in any form
Image Guarantee, ScanDex, and the patented Network or by any means, or translated into another language without
Document Streaming technology are trademarks of AccuSoft the prior written consent of Cognos Incorporated.
Corporation. Other company and product names mentioned Cognos, the Cognos logo and Cognos ReportNet are
herein may be trademarks or registered trademarks of their trademarks or registered trademarks of Cognos Incorporated in
respective holders. the United States and/or other countries. All other names are
trademarks or registered trademarks of their respective
companies.

ii © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INSTRUCTOR PREFACE

Contents

CONTENTS............................................................................................................................ III
COURSE OVERVIEW.......................................................................................................... IV
COURSE OVERVIEW ................................................................................................................IV
INTENDED AUDIENCE ..............................................................................................................IV
TOPICS COVERED ....................................................................................................................IV
COURSE PREREQUISITES .........................................................................................................IV
COURSE OUTLINE................................................................................................................ V
INSTRUCTIONAL MATERIALS .................................................................................... VIII
STUDENT GUIDE.................................................................................................................... VIII
INSTRUCTOR GUIDE .............................................................................................................. VIII
INSTRUCTOR INSTALLATION CD .............................................................................................IX
IMPORTANT SETUP INSTRUCTIONS FOR THIS COURSE......................................... X
CONFIGURE THE INSTRUCTOR AND STUDENT COMPUTER CHECKLIST ......................................X
INSTALL MICROSOFT SQL SERVER 2000 ...................................................................XII
CREATE THE REPORTNET CONTENT STORE .........................................................XIV
RESTORE THE SAMPLE DATABASES .......................................................................... XV
CONFIGURE REPORTNET...........................................................................................XVIII
CREATE LOCAL NT USERS............................................................................................XIX
SET UP WEB ALIASES....................................................................................................... XX
PREPARE FOR SAMPLES AND SOLUTIONS DEPLOYMENT............................... XXII
IMPORT SAMPLE REPORTS, AND DEMO AND WORKSHOP SOLUTIONS.....XXIII
REMOVE ADMINISTRATIVE TOOLS FOR REPORT AUTHORS ......................... XXV
TEST DEPLOYMENT AND SECURITY ......................................................................XXVI
INSTALL AND CONFIGURE CONCURRENT VERSION SYSTEM SOFTWARE
........................................................................................................................................... XXVII
GENERAL SETUP AND INSTRUCTOR PREPARATION .....................................XXVIII
PRE–CLASS AGENDA ....................................................................................................... XXVIII
PREPARE TO TEACH ......................................................................................................... XXVIII
DOCUMENT CONVENTIONS.......................................................................................XXIX
POWERPOINT TIPS ........................................................................................................ XXX
GET THE CLASS STARTED..........................................................................................XXXI
STUDENT GUIDE TABLE OF CONTENTS .............................................................. XXXII
POST–CLASS AGENDA ..............................................................................................XXXIII
SUBMIT FEEDBACK AND LOCATE ADDITIONAL PRODUCT INFORMATION
..........................................................................................................................................XXXIV
SUBMIT FEEDBACK .......................................................................................................... XXXIV
ADDITIONAL PRODUCT INFORMATION.............................................................................. XXXIV

© 2003, Cognos Incorporated iii


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Course Overview

Course Overview
Cognos ReportNet – Metadata Modeling is a two–day instructor–led course
that covers how to use the Framework Manager environment to import
metadata, prepare it for presentation and publish it to the web so that end
users can easily author reports. Attendees will learn how to create
calculations, filter data and apply security to model objects as well as learn
some advanced modeling techniques.

Intended Audience
This course is intended for data modelers.

Topics Covered
In this course we will:

• examine the Cognos ReportNet and Framework Manager workflow


processes

• explore the Framework Manager environment

• create and modify Framework Manager models to meet business


requirements

• publish models for use by ad–hoc query and report authors

• perform model management activities

• secure metadata to allow appropriate access by users

• identify advanced modeling techniques

Course Prerequisites
Participants should have attended:

• Cognos ReportNet – Introduction to Report Authoring

• Cognos ReportNet – Ad Hoc Querying

• Knowledge of SQL and data modeling

iv © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
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: Introduction to Framework Manager

Topics Slides Demos Workshops Est. Time

• define Framework Manager and its 19 1 0 1hr. 10


purpose mins
• describe the Framework Manager
environment
• examine the Cognos ReportNet and
Framework Manager workflow
processes
• examine the Framework Manager
user interface

Module 2: Design and Create a Project

Topics Slides Demos Workshops Est. Time

• identify and apply model structure 19 2 1 1hr. 20


best practices mins.

• create a project

• import Metadata

• define function sets

• organize objects

• publish the model

Module 3: Prepare the Metadata

Topics Slides Demos Workshops Est. Time

• examine Limited Local versus 38 8 3 3 hrs. 30


Database Only processing mins.

• create relationships between query


subjects

• modify query item properties

© 2003, Cognos Incorporated v


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Module 3: Prepare the Metadata (cont’d)

Topics Slides Demos Workshops Est. Time

• create and test new query subjects 3 hrs. 30


mins.
• create calculations

• create macros using parameter


maps and session parameters

Module 4: Prepare the Business View

• add a presentation layer to our 17 3 2 1 hr. 30


model mins.

• create stand–alone and embedded


filters

• use a prompt value to refine a query

Module 5: Manage Packages

• edit governors for our model and 20 2 1 1 hr. 20


packages mins.

• create and modify packages

• specify package languages and


function lists

• analyze the impact of publishing a


package

• publish packages and set their


model version control

Module 6: Set Security in Framework Manager

• examine the ReportNet security 17 3 1 1.0 hr. 10


environment mins.

• create and apply security filters

• restrict access to query subjects and


query items

• restrict access to packages

vi © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INSTRUCTOR PREFACE

Module 7: Manage Projects

Topics Slides Demos Workshops Est. Time

• implement repository control 19 3 0 1.0 hr.

• segment and link a model

• examine action logging and project


synchronization

• check a project

Module 8: Use Advanced Modeling Techniques

Topics Slides Demos Workshops Est. Time

• resolve recursive relationships 18 3 0 1 hr. 20


mins.
• specify dimensional information

• create star schema groupings

Note: The course also includes an Introduction module and a Start


presentation. The estimated time for these is 30 minutes. Also add 10 minutes
after Module 8 for a Summary discussion.

© 2003, Cognos Incorporated vii


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Instructional Materials

Student Guide
The Student Guide contains explanations and 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 some of the modules, a supplementary workshop is included. If participants


followed the concepts in class without difficulties, they can probably complete
the exercise with no additional information. The second page for each exercise
contains a task table that identifies each task, where to work in the application,
and any applicable hints to help the participants. Step–by–step solutions for all
workshop exercises are in Appendix A. Participants may want to follow these
instructions if they were not able to complete the exercise 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.

viii © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INSTRUCTOR PREFACE

Instructor Installation CD
The Instructor Installation CD contains an executable file that can install any or
all of the following files. By inserting the CD into your computer and following
the prompts as the auto install runs, these files will be installed in
C:\Edcognos\CR1052.

Instructor Slides

These files contain the Microsoft PowerPoint slide presentation for each
module of the course as presented in the Student Guide:
• StartCR1052.ppt
• IntroCR1052.ppt
• Mod1CR1052.ppt
• Mod2CR1052.ppt
• Mod3CR1052.ppt
• Mod4CR1052.ppt
• Mod5CR1052.ppt
• Mod6CR1052.ppt
• Mod7CR1052.ppt
• Mod8CR1052.ppt

PDF version of the Instructor Guide

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

Student Data

The CD contains the files that are necessary to complete the demos and
workshops. By inserting the CD into the student PCs and allowing the auto
install to run, these files will be installed to the C:\Edcognos\CR1052 directory.
The Student Data CD contains the following folders and files:
• solutions folders with models as completed in the demos and
workshops
• cvs–1.11.5.exe
• Run Locale Map.txt
• GOSL
• CR1052_Report_Solutions.zip
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.

The previous items cannot be accessed directly from the CD. They must be
installed on your computer by using the EXE auto install.

© 2003, Cognos Incorporated ix


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Important Setup Instructions for This Course

Configure the Instructor and Student Computer Checklist


Use the following checklist when configuring both the instructor and student
computers:

Setup Complete

Installation requirements:
• Windows 2000 with Internet Information Services installed
• RAM Minimum: 512 MB, Recommended: 1 GB
• Disk space Minimum: 1 GB
• A Web server installed and started
• one of the following databases available to store Cognos data: Oracle
(version 8.1.7.2 or later if Oracle Server is on a different operating
system from ReportNet), DB2, or Microsoft SQL Server and all
recent patches.
For all Web browsers, the following enabled:
• cookies
• JavaScript
• Microsoft Data Access Component (MDAC) 2.6 or later for use with
product samples
For IE only, the following enabled:
• Run ActiveX controls and plug–ins
• Script ActiveX controls marked safe for scripting
• Active scripting
• a Web browser configured to accept cookies
• use v.6.0 or later
Perform a default installation of ReportNet. Finish the installation without
configuring.
Perform a default installation of Framework Manager. Finish the installation
without configuring.
Install Microsoft SQL Server 2000. See steps on Page xii.
Create ReportNet Content Store in Microsoft SQL Server Enterprise
Manager. See steps on Page xiv.
Restore the Sample Databases. See steps on Page xiv.
Configure ReportNet. See steps on Page xviii.
Create Local NT users. See steps on Page xix.
Set up Web Aliases. See steps on Page xx.

x © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INSTRUCTOR PREFACE

Setup Complete

Prepare for Samples and Solutions Deployment. See steps on Page xxii.
Import Sample Reports and Demo and Workshop Report Solutions. See
steps on Page xxiii.
Remove Administrative Tools for Report Authors. See steps on Page xxv.
Test Deployment and Security. See steps on Page xxvi.
Install and Configure Concurrent Version System (CVS) Software on Page
xxvii
Customize the introductory slide in STARTCR1052.PPT (optional).

© 2003, Cognos Incorporated xi


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

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.
1. Start the install.
2. Click SQL Server 2000 Components.
3. Click Install Database Server.
4. 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.
8. Accept the License Agreement.

9. Click Server and Client Tools, and then click Next.

xii © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INSTRUCTOR PREFACE

10. Select Default as the Instance Name, and then click Next.

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

12. For Services Accounts, click Use a Domain User account (and use your
account to your domain), or click Use the Local System account, which
should be Administrator.
13. Click Next.

14. For Authentication Mode, click Mixed Mode, and type sa in the Enter
password and Confirm password boxes.
15. Click Next.
16. Click Next again.
The installation continues, and the Microsoft Data Access Components are
installed. The complete installation may take a few minutes.
17. Once the install is complete, click Finish.
18. Install and run any recent patches.

© 2003, Cognos Incorporated xiii


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Create the ReportNet Content Store

1. Navigate to Start\Programs\Microsoft SQL Server, and click Enterprise


Manger to open Microsoft SQL Server Enterprise Manager.
2. Expand Microsoft SQL Servers and SQL Server Group.
3. Expand <machine name>, 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 drop–down list, select Latin1_General_CI_AS, and
then click OK.

xiv © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INSTRUCTOR PREFACE

Restore the Sample Databases

Task 1. Add the databases.


1. While still in Microsoft SQL Server Enterprise Manager, right–click
Databases, and then click New Database.
2. In the Name box, type GOSL, and then click OK.
3. Repeat steps 1 and 2 to add two new databases called GORT and GOSLDW.
Task 2. Restore the databases.
1. Right–click the GORT database, point to All Tasks, and then click Restore
Database.
2. In the Restore database dialog box, click the From device radio button.
3. Under Parameters, click Select Devices.
4. In the Choose Restore Devices dialog box, click Add.
5. In the Choose Restore Destination dialog box under File name, click the
Ellipsis and browse to <Cognos ReportNet installation
location>\Program Files\Cognos\crn\webcontent\samples\
db\sqlserver\GORT, and then click OK.
6. Click OK, and then click OK again.
7. In the Restore Database dialog box, click the Options tab.
8. Click the Force restore over existing database checkbox to select it.

© 2003, Cognos Incorporated xv


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

9. In the Restore database files as pane, ensure the Restore as path for both files
in the Move to physical file name column points to the location of the GORT
database.
If you chose the default location when you created the database, the path
should read, <SQL Sever location>\MSSQL\Data\GORT.mdf for the first
file, and <SQL Sever location>\MSSQL\Data\GORT_log.ldf for the
second file.
Please note: The GORT.mdf file may be called GORT_Data.mdf.
The result should appear similar to the one shown below:

In the screen capture, the data file is listed first in the logical file name column,
followed by the log file. If the positions are reversed (in other words, if the log
file is listed first), ensure that each logical file name points to the correct
physical file location.
10. Click OK.
A message appears saying the restoration was successful.
11. Click OK to close the message.
12. Repeat Task 2 to restore the databases for GOSL and GOSLDW (with the
exception that GOSL will be restored from C:\Edcognos\CR1052). Ensure
the logical files are pointing to the correct databases.

xvi © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INSTRUCTOR PREFACE

Task 3. Set login properties.


1. Expand the Security folder.
2. Click Logins, and then in the right pane, right–click sa, and then
click Properties.
The SQL Server Login Properties – sa dialog box appears.
3. Under Authentication, change the password to sa, and then click OK.
4. In the Confirm Password dialog box, type sa, and then click OK.
5. The default username and password used by ReportNet is sa.
6. Close SQL Server Enterprise Manager.

© 2003, Cognos Incorporated xvii


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Configure ReportNet

1. From the Start menu, point to Programs\Cognos ReportNet, and then


click Cognos Configuration.
2. In the Explorer pane of 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. The results appear as follows:

6. Click the cell in the Namespace ID row and the Value column, and type Local
NT ID, and then press Enter.
7. In the Explorer pane under Authentication, click Cognos.
8. To the right of Allow anonymous access, click True in the Value column, and
then click False to change the setting.
With Anonymous access now set to False, students will need to log in to
Cognos Connection and provide a user name and password.
9. In the Explorer pane under ReportNet service, click Cognos ReportNet.
10. In the Dispatcher maximum memory in MB row, change the value to 512.
This property specifies the maximum amount of memory in MB that can be
used by the ReportNet dispatcher. The value specified here determines the
amount of memory used by the Java Virtual Machine and depends on how
much memory is available. If you are using a computer that has a lower
amount of RAM, increasing this value will improve performance.

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


14. When all services are started, click Close.
15. Close Cognos Configuration.

xviii © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INSTRUCTOR PREFACE

Create Local NT users

1. From the Start menu, point to Settings, and then click Control Panel.
2. Double–click Users and Passwords.
3. In the Users and Passwords dialog box, click the Advanced tab, and then
under Advanced User Management, click the Advanced button.
4. In the Local Users and Groups window, in the left pane, right–click Users, and
then click New User.
5. In the New User dialog box, in the User name box, type report_author, and
then in the password and confirm password boxes, type ra1234.
6. Click the User must change password at next logon checkbox to clear it,
click the Password never expires checkbox to select it, and then click Create.
7. With the New User dialog box still open, repeat steps 4–6 to create the
following users:
User Name = admin_person, password = admin1234
User Name = atorta, Full Name = Allessandra Torta, password = password
User Name = arodriguez, Full Name = Alex Rodriguez, password =
password
8. Click Close to close the dialog box.
9. In the left pane, click Users to ensure that the four users have been added.
10. Close the Local Users and Groups window, and the Users and Passwords
dialog box.

© 2003, Cognos Incorporated xix


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Set up Web Aliases

Task 1. Set up alias for ReportNet.


1. From the Control Panel, open Administrative Tools, and then open Internet
Services Manager.
2. In Internet Information Services, expand <machine name>, and then expand
Default Web Site.
3. Right–click Default Web Site, point to New, and then click Virtual
Directory.
The Virtual Directory Creation Wizard appears.
4. Click Next.
5. Under Alias, type crn, and then click Next.
6. Browse to <Cognos ReportNet installation location>\Program
Files\cognos\crn\webcontent, click OK, and then click Next.
7. Click the Run scripts checkbox to clear it, so only Read is selected, and then
click Next.
8. Click Finish.
Task 2. Set up virtual directory for cgi–bin.
1. Right–click the crn 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 <Cognos ReportNet installation location>\Program
Files\cognos\crn\cgi–bin, click OK, and then click Next.
5. Click the Execute checkbox to select it, so that Read, Run scripts, and
Execute are selected, and then click Next.
6. Click Finish.

xx © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INSTRUCTOR PREFACE

Task 3. Set up virtual directory for help.


1. Right–click the crn virtual directory folder, point to New, and then
click Virtual Directory.
The Virtual Directory Creation Wizard appears.
2. Click Next.
3. Under Alias, type help, and then click Next.
4. Browse to <Cognos ReportNet installation location>\Program
Files\cognos\crn\ webcontent\documentation, click OK, and then
click Next.
5. Click the Run scripts checkbox to clear it, so that only Read is selected, and
then click Next.
6. Click Finish.

© 2003, Cognos Incorporated xxi


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Prepare for Samples and Solutions Deployment

1. Open Windows Explorer.


2. Navigate to <Cognos ReportNet installation location>\Program
Files\cognos\crn\ webcontent\samples\content.
3. Copy the Cognos_Samples.zip file.
4. Navigate to <Cognos ReportNet installation location>\Program
Files\cognos\crn\deployment, and then paste in the zip file.
5. Copy the CR1052_Report_Solutions.zip file from C:\Edcognos\CR1052.
The CR1052_Report_Solutions.zip file contains reports that serve as data for
Demo I-1 in IGIntroCR1052.doc. This is an instructor-led demo. As a result,
this data is not required on student machines. This demo involves running
reports in Query Studio and Report Studio that have been created using the
GO Model. The GO Model is the Framework Manager model that students
will be creating throughout the course. The intent is to provide students with
an understanding of the modeling process by showing them the end result right
at the beginning of the course.
This is also an optional demo. Therefore, you do not have to deploy the
CR1052_Report_Solutions.zip archive if you do not intend to perform this
demo. Alternatively, if you intend to perform this demo and continue to deploy
this archive, please note that steps in Demo 2-1 Task 4 will be impacted
(instructor machine only). These steps involve creating a new data source called
GOSL. As a result of deploying the CR1052_Report_Solutions.zip archive,
this data source will already be available. See the Instructor note on page XIX
in IGIntroCR1052.doc for instructions on how to handle this scenario.
6. In Windows Explorer, navigate to <Cognos ReportNet installation
location>\Program Files\cognos\crn\deployment, and then paste in
the zip file.
7. Close Windows Explorer.

xxii © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INSTRUCTOR PREFACE

Import Sample Reports, and Demo and Workshop


Report Solutions

Task 1. Import the samples and solutions.


1. Open your browser, and then in the address bar, type localhost/crn, and
press Enter.
2. On the Log In screen, in the User ID box, type admin_person, in the
Password box, type admin1234, and then click OK.
The Cognos Connection welcome page appears.
3. In the top right corner, click the Deployment link.

4. Click the Import tab, and then on the toolbar, click New Import .
5. On the Select a deployment archive screen, ensure the Cognos_Samples
archive is selected, and then click Next.
6. On the Specify name and description screen, click Next.
7. On the Select the public folders screen, click the checkbox beside the
GO Sales and Retailers folder to select it, and then click Next.
8. On the Specify the general options screen, click Next.
9. On the Review the summary screen, click Import Now, and then in the Finish
screen, click Finish.
10. Repeat step 4 to 9 to import the demo and workshop report solutions.
This is only required for the instructor’s machine.
For step 5, select the CR1052_Report_Solutions archive, and enter the
encryption password of admin1234. In step 7, select the
CR1052_Report_Solutions and GO Model folders.
11. In the top right corner, click Return.
Task 2. Create data sources.
1. At the top of Cognos Connection beside Tools, click the Directory link.
2. On the Directory screen, click the Data Sources tab.

3. Click New Data Source .


4. Under Name, type gosales, and then click Next.
5. Under Type, select Microsoft SQL Server, and then click Next.
6. In the Server name box, type localhost, and then under Database name,
type GOSL.

© 2003, Cognos Incorporated xxiii


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

7. Under Signon, click the checkbox beside User ID to select it, and
click the Password checkbox to select it.

8. In the User ID box, type sa, and in the Password and Confirm password
boxes, type sa, and then click Finish.
9. Repeat steps 3 to 8 to create the following data sources:
Data source name = goretailers, Database name = GORT
Data source name = GOSLDW, Database name = GOSLDW
Note: The last data source (GOSLDW) is specific to the course, whereas the
first two are specific to the bundled ReportNet examples.
10. Click Return.

xxiv © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INSTRUCTOR PREFACE

Remove Administrative Tools for Report Authors

1. At the top of Cognos Connection beside Tools, click the Directory link
The Directory page shows two namespaces, Cognos and Local NT.

2. Click the Cognos link, and then click Set properties for the
Consumers role.
3. On the Set properties – Consumers page, click the Members tab.
We are going to make report_author a member of the Consumers role,
because members of this role do not have access to the administrative tools.
We also need to remove the Everyone group because all users in this group
(which is everyone including Anonymous users) have access to the
administrative tools.
4. Click the Add link to add a member to the Consumers role.
5. Click the Show users in the list checkbox to select it, and then click the
Local NT link to access users in that namespace.
6. Click the checkbox beside report_author, and then click Add.
7. Scroll down to the bottom of the page, under Entries to be added, click the
checkbox beside report_author, and then click OK.
The report_author user is added to the Consumers role.
8. Click the checkbox beside Everyone, click the Remove link, and then
click OK.
9. On the Directory page, click Set properties for the System Administrators
role.
10. Repeat steps 3 to 8 to add the admin_person user to, and remove the
Everyone group from the System Administrators role.
We need to add a member to this role before removing the Everyone group
because we do not want the role to be empty.

© 2003, Cognos Incorporated xxv


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Test Deployment and Security

Perform steps 4 –6 on the instructor machine only and the remaining steps on all
machines.
1. In the top right corner of the screen, click Log Off, and then
click Log on again.
2. In the User ID box, type report_author, in the Password box, type ra1234,
and then click OK.
The Cognos Connection welcome page appears with all tools in the upper
right corner removed except for Schedule Management.
3. In Cognos Connection, click the Public Folders tab.
4. Click the CR1052_Report_Solutions link, and then click the Calculations
link.
Query Studio opens and generates a simple list report.
5. Click Return to go back to Cognos Connection.
6. In the top left corner, click the Public Folders link.
7. Click the GO Sales and Retailers link, and then click the Report Studio
Report Samples link.
8. Click the Actual Sales against Target Sales link.
The report appears in Report Viewer.
9. Navigate through the report using the Page down links at the bottom
of the report.
10. Click Return to go back to Cognos Connection.
11. Close Internet Explorer.

xxvi © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INSTRUCTOR PREFACE

Install and Configure Concurrent Versions System


Software

1. In Windows Explorer, create the following directory structure:


C:\CVS\CVSROOT.
2. Navigate to C:\Edcognos\CR1052, and then copy cvs–1.11.5.exe to
C:\CVS.
3. From your desktop, right–click My Computer, and then click Properties.
4. Click the Advanced tab, and then click Environment Variables.
5. Create a New System Variable with the following properties:
Variable name – CVSROOT
Variable value – :local:C:\CVS
6. Click OK to close the New System Variable, the Environment Variables, and
the System Properties dialog boxes.
7. From the Start menu, point to Programs\Cognos ReportNet, and then click
Cognos Configuration.
8. In the Explorer pane, expand the Environment node, right–click Source
Control Systems, point to New Resource, and then click Source Control
System.
9. In the Name box, type LocalCVS, in the Type list, ensure CS–CVS is selected,
and then click OK
10. In the Source control system executable file (.exe) location box, type
C:\CVS\cvs–1.11.5.exe, and then press Enter.
11. From the File menu, click Save, and then from the toolbar, stop and restart
your ReportNet service.
12. Close Cognos Configuration.

© 2003, Cognos Incorporated xxvii


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

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 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 and that
they have the student data files so that they can practice after leaving
the course.

xxviii © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
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.

Help Footnotes are used to reference the Help file


for other information and to expand on a topic
covered in the page content.

© 2003, Cognos Incorporated xxix


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

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 E

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 Alt+Tab or click the application name on the
the product 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:

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

xxx © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INSTRUCTOR PREFACE

Get the Class Started


Welcome participants to the course. Use the slide show, STARTCR1052.PPT, to
introduce yourself, the participants, and the agenda for the training (optional).

Instructor Introduction Use this slide to welcome the participants to the


course, to introduce yourself, and to mention your
ƒ Course Name
ƒ Instructor Name
background (for example, how long you have been
ƒ Instructor Background 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.

Student Introductions Have the participants take turns introducing


themselves with respect to the items listed on this
ƒ Name
ƒ Company
slide. The intent of the slide is to act as an icebreaker
ƒ Position and to encourage participation.
ƒ Product Experience
ƒ 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 Use this slide to explain the class format and
emphasize that participants are encouraged to actively
ƒ lecture with slides
ƒ student guides as
perform the hands–on demos while following along
ƒ
reference material

hands-on demos to learn


with the instructor.
and practice

ƒ independent workshop
exercises for more practice

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.

© 2003, Cognos Incorporated xxxi


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Student Guide Table of Contents

Introduction

Module 1: Introduction to Framework Manager

Module 2: Design and Create a Project

Module 3: Prepare the Metadata

Module 4: Prepare the Business View

Module 5: Manage Packages

Module 6: Set Security in Framework Manager

Module 7: Manage Projects

Module 8: Use Advanced Modeling Techniques

Appendix A: Step-by-Step Solutions to the Workshops

Appendix B: Additional Tips and Techniques for Modeling in


Framework Manager

Index

xxxii © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INSTRUCTOR PREFACE

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.

© 2003, Cognos Incorporated xxxiii


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

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. Please send your comments to ges@cognos.com.

In the Instructor Support Community on myCognos, your suggested course


corrections and course–related supplementary information (for example
additional demos you use, diagrams you have 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, course development templates) in the Instructor Support
Community, which you may find useful when preparing for courses.

Suggestions for significant course enhancements will be added to our internal


Feedback Database for review and 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.

xxxiv © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
Introduction

Cognos ReportNet – Metadata Modeling


COGNOS REPORTNET – METADATA MODELING

II © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION

Objectives

ƒ In this course, we will:


ƒ examine the Cognos ReportNet and Framework Manager
workflow processes
ƒ explore the Framework Manager environment
ƒ create and modify Framework Manager models to meet business
requirements
ƒ publish models for use by ad hoc query and report authors
ƒ perform model management activities
ƒ secure metadata to allow appropriate access by users
ƒ identify advanced modeling techniques

© 2003, Cognos Incorporated III


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

1. Introduction to Framework Manager


2. Design and Create a Project
3. Prepare the Metadata
4. Prepare the Business View
5. Manage Packages
6. Set Security in Framework Manager
7. Manage Projects
8. Use Advanced Modeling Techniques

Cognos ReportNet – Metadata Modeling

Cognos ReportNet – Metadata Modeling is a two-day instructor-led course that covers


how to use the Framework Manager environment to import metadata, prepare it for
presentation, and publish it to the Web so that end users can easily author reports.
Attendees will learn how to create calculations, filter data, and apply security to model
objects as well as learn some advanced modeling techniques.

Intended Audience

• Modelers

Prerequisites

• Cognos ReportNet – Introduction to Report Authoring

• Cognos ReportNet – Ad Hoc Querying

• Knowledge of SQL and data modeling

IV © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION

Framework Manager Help


Cognos ReportNet Help files are written and designed to help you find information
quickly and easily while you work.
The documentation available to you will depend on the components selected during
installation. Contact your administrator if you want access to documentation listed in
the Documentation Roadmap or Books for Printing.
ReportNet documentation includes reference books and online help to meet the needs
of our varied audience.
We use different media for different information, all designed to meet your changing
needs for documentation. Here is how you can use the different kinds of
documentation we provide.
Help type When to use Location

Task-oriented You are working in the product and you need Framework Manager – Help
online specific task-oriented help. menu/Contents

Books for Printing You want to use search engines to find Framework Manager - Help
(.pdf) information. You can then print out selected menu\Contents\Introduction,
pages, a section, or the whole book. click an online book

Use online books (.pdf) if you want to know Documentation CD


how to get something done but prefer to read
about it in a book. The online books contain <Cognos ReportNet install
the same information as the online help location>\webcontent\
although the method of presentation may be documentation\<language>,
different. scroll down and choose
ug_fm.pdf

Windows Start
menu/Programs/Cognos
ReportNet/Documentation/
Framework Manager

© 2003, Cognos Incorporated V


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task-Oriented Help

The Help function is always available from the main menu bar.

From the Help menu, click Contents.

The following dialog box appears with the Contents tab selected:

Contents

The Contents tab allows you to browse through topics by category.

VI © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION

Click the Index tab. The dialog box changes as shown below.

Index

An index is a tool that points to or leads you to the related topic. Each topic in a help
file has one or more index terms from which that topic can be accessed. Either type the
term you are looking for or scroll through the interactive list of terms available.

© 2003, Cognos Incorporated VII


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Click the Search tab, in the box type relationship, and then click the Search button.
The dialog box changes as shown below:

Search

The Search tab accesses a search engine that will find instances of a term within the
contents of the help file. Use this tab when you cannot find a term in the index.

For example, ancestor is not an index term. Using the Search tab, type ancestor, and
the search engine will find this term. You can then display this help topic, and all
instances of the term builds will be highlighted.

Use the Search tab to search for words or phrases that do not have an index entry.

VIII © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION

Online help

If you navigate to Start\Programs\Cognos ReportNet\Documentation\Cognos


ReportNet, you will see the following list of documents for online help:

© 2003, Cognos Incorporated IX


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

From any help window, you can click Additional Materials to open an online guide.

X © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION

Business Scenario

ƒ Organization
ƒ Great Outdoors Company
ƒ Role
ƒ data modeler
ƒ Task
ƒ Provide report authors and query users with a business
presentation of the information in the corporate data sources.
ƒ Business requirements have been established.
ƒ Tool
ƒ Framework Manager

Instructional Tips
• The Great Outdoors Company is a sporting goods and camping
Inform students that this scenario will be
equipment wholesaler with operations in Europe, the Americas, and used throughout the demos and workshops
Asia Pacific. of this course. They will create a project,
and then model the metadata within that
• You are a data modeler tasked with providing report and ad hoc query project. They will learn and apply the
authors at the Great Outdoors Company with a business presentation Framework Manager workflow process.
of the information in the corporate data sources so that they can easily
build reports.

• Users have already indicated what data they need to use, and how they This course uses the GO Sales and GO
Retailers databases, which are MSSQL
need to use it. The Great Outdoors Company has just purchased the databases containing transactional and
Cognos ReportNet solution, and you will use Framework Manager to operational data for the fictional Great
prepare the appropriate metadata models. Outdoors Company. It also uses the GO
Sales DW database, which is also a
MSSQL database, but set up to support
dimensional analysis, through multiple star
schemas.

© 2003, Cognos Incorporated XI


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo I-1 (Instructor Only)

ƒ Explore Reports Built with the GO Model

Instructional Tips
This is an optional, instructor-led demo.
The data (reports) required to complete this
demo will not be installed on the students’
machines.

XII © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION

Demo I-1: Explore Reports Built with the GO Model

Purpose:
Show examples of reports that have been created in Report Studio
and Query Studio based on the Framework Manager GO Model.
This is the model that students will be developing throughout the
course.

Task 1. Show aggregation, formatting, prompting,


descriptions, and screen tips.
1. Open Internet Explorer, and then in the Address box type
http://localhost/crn/cgi-bin/cognos.cgi, and then press Enter.
The Log on page appears.
2. In the User ID box, type admin_person, in the Password box, type
admin1234, and then click OK.
The Welcome page for Cognos Connection appears.
3. Click the Public Folders tab, and then click the CR1052_Report_Solutions
link.
4. Beside the Aggregation_Formatting_Prompting_Descriptions_ScreenTips

report, click Edit with Report Studio .


The report opens in Report Studio in the Page Design view. The GO Model
also appears in the Insertable Objects pane
5. In the Insertable Objects pane, expand the Database layer and gosales
folders.
6. Expand the SALES_BRANCH query subject, right-click the CITY query Additional Information
item, and then click Properties. The usage and aggregate properties are
set on query items to control how
Notice that the usage of this query item is set to attribute. This is a property aggregate values will be determined in
that is set during the modeling process in Framework Manager. reports. These are set in Framework
Manager, but the aggregate property can
7. Click Close. be overridden in Report Studio.
8. In the Page Design view, click the UNIT_COST column, and then in the
Properties pane, scroll down to the Data Item heading.
Notice that the value of the Aggregate Function property is set to Average. In
Framework Manager, this initial setting for this property in the model is Total.
During the modeling process, this setting is changed to Average for the
UNIT_COST, UNIT_PRICE, and UNIT_SALE_PRICE query items.

© 2003, Cognos Incorporated XIII


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

9. On the toolbar, click Run Report .


A prompt page appears. This page is built automatically and includes controls
for selecting a specific date range rather than a date and time range. During the
modeling process in Framework Manager, a prompt control setting is specified
on the Order Date query item.
10. In the From calendar control select a date of May 3, 2001, and then in the To
calendar control select a date of May 2, 2002.
11. Click Finish, and then click Bottom.
The result appears as shown below:

Only data from the dates specified in the prompt appear in the report. The
values in the UNIT_COST, UNIT_PRICE, and UNIT_SALE_PRICE
columns are averaged, while the QUANTITY column is totaled and is
unformatted. The UNIT_COST, UNIT_PRICE, and UNIT_SALE_PRICE
columns are formatted as currency. The default formatting of these query items
is set in Framework Manager.
12. Close the Report Viewer, and then in the Insertable Objects pane, expand
Order Header, and then point to the Order Number query item to view the
screen tip.
The Order Number – Order No. screen tip is a property set on the Order
Number query item in Framework Manager.

XIV © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION

13. Right-click the Order Number query item, and then click Properties.
The Description box in the Properties dialog box shows a description that was
set as a property on the Order Number query item in Framework Manager.
14. Click Close, and then close Report Studio.
Task 2. Show localized metadata titles and properties.
1. Beside Localized_Metadata_Titles_Properties, click Edit with Report Studio.
2. From the File menu, click Model Connection.
The Model Connection dialog box appears.
3. In the Language box, click French, and then click OK.
4. Click OK to close the message that says the report specification is valid.
Notice that the contents of the Insertable Objects pane have changed to reflect
the new language. The (fr) Presentation Layer and (fr) Database Layer folder
names have not been translated for this model. These are placeholder names
for the text properties for these objects. We will look at an example of some
text properties of objects that have been translated.
5. In the Insertable Objects pane, expand the (fr) Database layer folder and the
(fr) gosales namespace.
Notice that one of the query subjects is named Pays. This is the French
translation for Country. This name represents the translated Country query
subject.
6. In (fr) gosales, expand (fr) SALES_BRANCH.
Notice one of the query items is named VILLE. This is the French translation
for City. This name represents the translated City query item.
To accomplish the translation, the French language is added to the Framework
Manager model, after which an external translation file is imported into the
model. The translation file is used to translate the text properties of all the
objects. The model is then published with the appropriate languages and is
available for use.
7. Close Report Studio.

© 2003, Cognos Incorporated XV


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 3. Show a report that contains a stored procedure query


subject.
1. Click the Stored Procedure (hard coded) report.
The report runs in Query Studio. This report returns data about orders made in
2001. The result appears as shown below:

2. Click Bottom.
The report shows only data from the year 2001.
3. In the Menu, click Insert Data, and then expand the Database layer and
gosales folders.
4. Expand the Orders for 2001 query subject.
The report uses the query items from this query subject. This query subject was
created in the Framework Manager model and is based on a stored procedure
that exists in the data source. This stored procedure will return only dates
between 2001-01-01 and 2001-12-31.
5. Click Return.
Task 4. Show a report that contains calculated columns
created in Framework Manager.
1. Click the Calculations report.
The report opens in Query Studio. The GROSS_PROFIT and MARGIN
calculated query items are displayed in the report
2. In the Menu, click Insert Data.

XVI © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION

3. Expand Database layer, gosales, and ORDER_DETAILS.


The GROSS_PROFIT and MARGIN calculated query items are in the model.
These calculations were created in Framework Manager and do not exist in the
data source. They have been included as query items in the
ORDER_DETAILS query subject, and they have been used to create this
report.
4. Click Return.
Task 5. Show a report that contains multi-lingual data.
1. In Cognos Connection, click Preferences, in the Content language section,
select Use the following language, and then in the Use the following
language box, click French.
2. Click OK.
3. Click the Multilingual_Data report.
The report opens in Query Studio and appears as shown below.

Notice that the data in the report appears in French. Our data source contains
data for multiple languages. For reporting purposes, we have made changes to
the Framework Manager model to accommodate these languages. The result is
that the language of the data will appear according to the language preference
of the user.
4. Click Return, and then in Cognos Connection, click Preferences.
5. In the Content language section, select Use the default language, and then
click OK.

© 2003, Cognos Incorporated XVII


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 6. Examine a report that uses query items from a


presentation layer versus a database layer.
1. Click the Presentation Layer vs Database Layer report.
The report opens in Query Studio.
2. Under menu, click Insert Data.
3. Expand the Presentation Layer, Order Information, and Product
Information folders.
4. Expand the Orders and Products query subjects.
The query items in the report come from these query subjects.
Product Line from Products
Product Type from Products
Order Method from Orders
Actual Revenue from Orders
This folder structure is created in the Framework Manager model. This Additional Information
structure is a best practice for presenting model objects for use by report and An example of an object that maps directly
query authors. This structure allows a modeler to logically group query subjects back to an object in the data source would
be a data source query subject that maps
so that the authoring experience is intuitive. The Database layer represents
to a table in a relational database. An
foundation objects in the model, and are typically not available for use by example of a reusable objects would be a
authors. These objects map directly back to objects in the data source or are calculation that is used in more than one
reusable objects for use in one or more presentation layers. presentation layer.
5. Click Return.
Task 7. Show a report that contains filters created in
Framework Manager.
1. Click the Filters report.
The report opens in Query Studio.
2. Click the Bottom link.
Notice that only data for the Camping Equipment product line is included.
3. Click the Camping Equipment filter at the top of the report.
4. In the Filter Description page, click Remove, and then click the Bottom link.
Notice that data for all product lines is now included in the report.
5. In the Menu, click Insert Data.

XVIII © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION

6. Expand the Presentation Layer and Product Line Filters folders.


7. Drag and drop the Mountaineering Equipment filter onto the report, and
then click the Bottom link.
Notice that only data for the Mountaineering Equipment product lines is
included. The filters included in the report are based on Filters that have
created in Framework Manager and have been published with the model.
8. Click Return without saving the report. Instructional Tips
Open Cognos Connection, log in with
9. Close Cognos Connection. User ID = admin_person,
Password = admin1234, and then
Results: delete the GOSL and GORT data
You have shown examples of reports that have been created in sources from the Data Sources tab in
Report Studio and Query Studio based on the Framework Manager the Directory tool. Otherwise, these
data sources will be shown when you
GO Model.
perform Demo 2-1, Task 4 - Create a
data source and test the connection.

© 2003, Cognos Incorporated XIX


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

XX © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
1

1. Introduction to Framework Manager


2. Design and Create a Project
3. Prepare the Metadata
4. Prepare the Business View
5. Manage Packages
6. Set Security in Framework Manager
7. Manage Projects
8. Use Advanced Modeling Techniques

Cognos ReportNet – Metadata Modeling


COGNOS REPORTNET – METADATA MODELING

1-2 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION TO FRAMEWORK MANAGER

Objectives

ƒ In this module, we will:


ƒ define Framework Manager and its purpose
ƒ describe the Framework Manager environment
ƒ examine the Cognos ReportNet and Framework Manager
workflow processes
ƒ examine the Framework Manager user interface

Instructional Tips
Emphasize that this module not only
provides an introduction to Framework
Manager, but also serves as an
introduction to the topics and the flow of the
topics, throughout the course.

© 2003, Cognos Incorporated 1-3


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

What is Framework Manager?

ƒ Framework Manager provides the metadata model development


environment for Cognos ReportNet.
ƒ Use Framework Manager to model the business presentation of data
derived from one or more data sources.
ƒ In Framework Manager, you work in a project, which contains:
ƒ a model
ƒ namespaces
ƒ data sources
ƒ parameter maps
ƒ packages

Additional Information
• Framework Manager provides the metadata model development
Framework Manager is a Windows-based
environment for ReportNet. client application as opposed to Query
Studio, Report Studio, and Cognos
• When you work in Framework Manager, you work in a project. A project Connection, which are Web-based
contains metadata objects (the model) organized for report authors applications.
according to the business model and rules.
A model in Framework Manager is a
business presentation of the structure of
• At the highest level, objects in a project include a model, namespaces, the data from one or more data sources. A
data sources, parameter maps, and packages. model describes data objects, structure,
and grouping, as well as relationships and
• After you define a Framework Manager project and namespace, you can security.
publish a package containing metadata information to the ReportNet
The terms model and project are often
server for use by authors and query users. used interchangeably in the
documentation. A clearer distinction is
provided on upcoming slides.

At a lower level of model granularity, other


objects include query subjects, query
items, relationships, folders, expressions.
All these objects are grouped together for
security, administration, and for sharing
information.

1-4 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION TO FRAMEWORK MANAGER

Describe the Framework Manager Environment

ƒ In a Framework Manager project, you will interact with the following


objects:
ƒ model
ƒ namespace
ƒ folder
ƒ query subject
ƒ query item
ƒ relationship
ƒ parameter map
ƒ package
Instructional Tips
Additional information on projects, models,
and query subjects will be presented on
• In Framework Manager, you will interact with the following objects: upcoming slides.

Parameter maps are similar to data source


• project – contains metadata objects organized for report authors look-up tables. Parameter Maps will be
according to the business model and rules discussed in Module 3 – Prepare the
Metadata.
• model – the set of metadata that is available for publishing to the Additional Information
ReportNet server The term namespace in Framework
Manager has nothing to do with the term
• namespace – container for an object; provides a unique name namespace in Access Manager. The
namespace in Framework Manager plays
no role in authentication.
• folder – used to organize objects
Use folders to organize objects according
• query subject – maps to a corresponding object in the data source to specific business views, for example,
and uses an SQL statement to retrieve the data Sales, HR, and Inventory.

Query subjects map to objects in the data


• query item – contained within a query subject; maps to a column in source, such as tables, views, synonyms,
the data source procedures, or functions.

• relationship – connection that explains how the data in one query


subject relates to the data in another When you create a relationship, you define
the cardinality of each end of the
relationship.
• parameter map - use parameters to create conditional query subjects
that allow for substitutions at report run time The package could also contain the
complete set of metadata within a project.
• package – contains a subset of the query subjects and other objects
defined in the project; published for use as a model by report authors

© 2003, Cognos Incorporated 1-5


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Examine the Project

ƒ A project appears in a file system as a folder that contains a


project file (.cpf) and XML files.

Additional Information
The project and the project’s associated
files are contained in a project folder. It is
• A Framework Manager project appears as a folder that contains a project recommended that no other files be added
file (.cpf) and the specific XML files that define the project. to this project folder.

File definitions:
• The files in a project folder are unique to each project. • <project name>.cpf - the
Framework Manager project file,
which references the XSD and
XML files used to define a project
• model.xml - the actual model
data created by Framework
Manager users
• Preferences.xml - the
preferences for Framework
Manager projects
• customdata.xml - the stored
diagram information. For
example, the diagram layout,
notation, font, color, etc.
• repository.xml (not shown) - the
logged version history for each
project or segment that has been
added to a repository

1-6 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION TO FRAMEWORK MANAGER

Examine the Model

ƒ Examine the model from the perspective of the report or ad hoc


query author.

• There is a difference between the Framework Manager model and the


model used by report and ad hoc query authors:

• Within Framework Manager, modelers interact with a development


model, which exists within the XML based project located on the file
system.
Additional Information
• A report or ad hoc query author interacts with a run-time version of
Framework Manager publishes XML to the
the Framework Manager model. This model appears as the set of ReportNet server. The server compiles
published metadata on which reports and queries are based. XML into binary run-time information after
each publish. There may be a short delay
on first use due to compile time.

© 2003, Cognos Incorporated 1-7


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Examine Query Subject Types

ƒ Data source query subject


ƒ SQL query that acts as a view into the underlying query data
source
ƒ default data source query subjects are created based on
imported objects
ƒ Model query subject
ƒ contains query items based on other existing objects in the
model
ƒ Stored procedure query subject
ƒ contains query items based on the return list of a stored
procedure

Additional Information
• The most important component of the Framework Manager project is
The query subject for importing a table
the query subject. uses the following general SQL syntax:
select * from <table>.
• During the initial metadata import operation, a default data source query
subject is created for each object you select (for example table) and Model query subjects - can be enhanced
creates the default relationships between query subjects for you even further, perhaps by adding filters or
calculations to create more query items.
automatically.

1-8 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION TO FRAMEWORK MANAGER

Cognos ReportNet Workflow

PLAN MANAGE MODEL AUTHOR CONSUME

Plan for Framework Run, View,


Manager Author
Install Print
Implementation Reports
Projects Reports

Configuration Publish
Package
Instructional Tips
Setup &
Maintain
Before explaining this slide, instructors
Security should be pointing students to the Services
Reference Card, which contains the
Administer
Cognos Solution Framework slide. This
Servers
& Reports card will be available and should be given
out prior to the start of the course.
Instructors will use the card to explain how
ReportNet provides the Query and
Reporting component of the enterprise
• As part of the Cognos ReportNet workflow, you use Framework platform.
Manager to develop metadata models. The Cognos ReportNet workflow
Additional Information
consists of the following phases: Manage
• Installation – use install guides to
• Plan – develop the application scope, including identifying the user install ReportNet, including the
community, and establishing business & technical requirements Content Store (MSSQL, Oracle,
DB2)
• Manage – including installation, configuration, security setup and • Configuration – use Cognos
Configuration to: 1) set the initial
maintenance, and report and server administration configuration of ReportNet
components after you install
• Model – model underlying data source metadata into business views, them, 2) configure ReportNet
and publish those views for use by report and ad hoc query authors components if you want to
change a property value or you
add components to your
• Author – using Report Studio and Query Studio to create and save environment, 3) start and stop
reports for the business community ReportNet services
• Security Setup and Maintenance
• Consume – end-users consume the required business reports – use Cognos Configuration to
specify the Authentication
Provider for the ReportNet
Environment
• Report and Server Administration
- use Cognos Connection to
manage (distribute schedule,
secure, and organize) reports
and monitor and configure
servers
Model
The Framework Manager modeler may/will
be responsible for applying security views
to the business metadata model.

© 2003, Cognos Incorporated 1-9


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Framework Manager Workflow

Data
Sources

Import

Create and
Design/Create Prepare Prepare the Manage
Manage
Project Metadata Business View Project
Packages
Instructional Tips
It is important to mention that although the
diagram gives the appearance of a one-
Set
Publish
Security
way flow, in a real-world scenario,
metadata modeling is an iterative process.
Metadata modelers may need to request
Report Studio database changes or additions (such as
Query Studio Content views, stored procedures and functions) to
Store database administrators to meet the needs
of their reporting application. They would
then re-import objects, remodel and retest,
• Before report authors can create reports, you must follow a workflow repeating this process until the model
process in Framework Manager. This workflow consists of the following meets the reporting requirements.
phases: Emphasize to students again, that this
workflow is also the basis for the flow of the
• Design and Create Project – foundation for the modeling process course modules; and flow of the content,
demos, and workshops within the modules.
• Prepare Metadata – examine and modify properties and relationship,
organize objects The graphic in the slide shows the
Framework Manager workflow process,
with publishing models as the final task.
• Prepare the Business View – add business value specific to reporting For the purposes of course flow we will be
requirements publishing models in the demos and
workshops in each module. This is to view
• Create and Manage Packages – identify subsets of the metadata to be the results of modifications made to the
published models, right away, instead of waiting until
the end of the modeling process (in this
case after a 2 day course) to view them.
• Set Security – based on ReportNet security, can be set at the package Otherwise, students may not remember
level or on individual query subjects and query items what they have modeled on the first day,
and may not recognize those changes
• Publish – to the ReportNet server for use by report authors to create reflected in the reports and queries created
reports in Query Studio and/or Report Studio.

Additional Information
• Manage the Project – to be performed throughout the modeling Project management features include
process, this includes a set of project management features used to enabling multiuser modeling through
manage the project, and other management tasks version control, and sharing and reusing
information through project linking and
segmenting. Another management task
includes verifying the project for errors or
problems.

1-10 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION TO FRAMEWORK MANAGER

Design and Create a Project

Design/Create
Project

ƒ Design
ƒ Know your data and the structure of your data sources.
ƒ Work with report authors to understand business reporting
requirements.
ƒ Identify project structure.
ƒ Create
ƒ Create a project.
ƒ Import the required metadata.
ƒ Organize
ƒ Organize objects to create a physical view of the metadata.

• To design a Framework Manager project, you must: Additional Information


Understanding data and structure of data
sources – for example, data source type,
• understand your data and the structure of your data source(s) locations, and connections.

• analyze and understand your reporting requirements Identifying project structure – for example,
use a two-tier model to determine how
metadata is presented to users (for
• identify a project structure – how will it be organized example folders, namespaces).

• To create a Framework Manager project, you must:


You should import only what you need (for
• name a project and establish the file system location for project example, tables, procedures, etc…). This
will depend on how you design.
files

• import the required metadata


To create a two-tier model, use a
• You should also create a physical view of the metadata by organizing
combination of folders and/or namespaces
foundation objects into a separate physical layer. to organize the objects. Once a physical
layer has been established, you then model
a presentation layer that includes objects
(for example model query subjects) that are
based on objects in the physical layer. The
modeling process for a two-tier model can
occur at either level, although there are
some best practices for modeling in each
level. These best practices will be followed
throughout the modeling process in the
course.

© 2003, Cognos Incorporated 1-11


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Prepare Metadata

Prepare
Metadata

ƒ Administer
ƒ Specify query processing type.
ƒ Define function sets.
ƒ Clean Up
ƒ Examine and modify object properties.
ƒ Examine, modify, and create relationships.
ƒ Edit SQL.

Additional Information
You should modify ambiguous relationships
so that you achieve the query results you
expect. An example of an ambiguous
• To prepare the model for reporting, you must examine and, if relationship is a redundant relationship.
necessary, modify the imported metadata. To do this, you may have This occurs when a query would have more
than one possible path between query
to: subjects. One path may achieve accurate
results, while the other may achieve
• specify whether query processing occurs entirely at the database inaccurate results.
or partially on the local server
You may have to modify a relationship by
changing the cardinality. For example, you
• define functions sets that are available in the project
may want a relationship defined as an
outer join (0…n) rather than an inner join
• examine and modify object properties, such as name, description, (1…n).
usage, and aggregate rule
For reporting purposes, you may have to
• examine and modify relationships such as ambiguous create relationships that do not exist in the
underlying data source. For example, if you
relationships, or create relationships, for example, between two want to run a query that spans two data
data sources sources, but no relationship exists between
them, you must create a relationship
• edit the SQL in a query subject definition between them in the Framework Manager
model.

1-12 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION TO FRAMEWORK MANAGER

Prepare the Business View

Prepare the
Business View

ƒ To enhance the business view of the model, you can:


ƒ create one or more presentation views
ƒ add calculations
ƒ create and apply filters
ƒ add prompts
ƒ create dynamic queries
ƒ use star schema groupings
ƒ specify dimensional information

Additional Information
• Create one or more presentation views based on business or
For example, you could create separate
organizational requirements. presentation views for HR, IT, Sales. These
views would contain query subjects that
• You can add business rules to the query subjects in your model to have been modeled to meet the specific
refine the data retrieved and ensure that the right information is business requirements of each group.
available for report authors. You can:

• add calculations so that report authors can include calculated


data in their reports

• create and apply filters to limit the data a query subject retrieves

• add prompts so that report consumers are prompted to filter


data

• use session parameters and parameter maps to create dynamic


queries

• use star schema groups to isolate fact tables that share Instructional Tips
conformed dimensions Star schema groups and specifying
dimensional information are discussed in
• specify dimensional information Module 8 – Use Advanced Modeling
Techniques.

© 2003, Cognos Incorporated 1-13


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Create and Manage Packages

Create and
Manage
Packages

ƒ To create and manage packages, you can:


ƒ define the package contents
ƒ modify a package
ƒ specify languages
ƒ set governors
ƒ view package inclusion
ƒ enable versioning

• After preparing the metadata and the business view of the metadata, you
can create a package and define the contents. The package includes the
model objects required to meet a reporting need.

• Once published, go back and modify a package by selecting or


unselecting objects, and then re-publish.

• Specify what languages the report authors will be able to see.

• Set governors, for example, set data retrieval limits.

• View package inclusion, which involves identifying an object based on the


package(s) in which it is included.

• Publish packages to the ReportNet server or to a network location, and


enable model versioning.

1-14 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION TO FRAMEWORK MANAGER

Set Security

Set
Security

ƒ ReportNet security is implemented through user authentication and


authorized access to content.
ƒ To set security in Framework Manager, you can:
ƒ define access to packages
ƒ create security filters
ƒ define access to objects
ƒ define package administration access

• To secure access to ReportNet applications, you must implement a


security strategy that involves user authentication and
authorization. The authorization component of this strategy can be
extended to Framework Manager. To set security, you can:

• define access to packages – specify what users, groups, or roles


will have access to the package to author and/or run reports

• create security filters – applied to a specific query subject, this


enables row security because the filter controls the data that is
shown to report authors when they set up their reports

• define access to objects – make objects visible or hidden to


enable column security

• define administration access to a package – specify who can


publish and perform other administration activities on the
package

© 2003, Cognos Incorporated 1-15


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Manage the Project

Manage
Project

ƒ Perform project management activities such as:


ƒ implementing multiuser modeling
ƒ repository control
ƒ sharing and reusing information
ƒ segmenting and linking
ƒ action logging and synchronizing
ƒ checking a project

• You can perform many project management functions within


Framework Manager. You can:

• implement a multiuser modeling environment by setting up a


repository control system

• share and reuse project information by creating project


segments and linking to existing projects

• log actions in a log file so that they can be replayed, such as for
deployment purposes

• synchronize projects with changes in the underlying data


source

• validate a project for errors or problems

1-16 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION TO FRAMEWORK MANAGER

Examine the Framework Manager UI

Project Info
Object Explorer
Object Diagram

Instructional Tips
The instructor can cover this topic using
Demo 1-1- Explore the Framework
Manager User Interface.

Additional Information
The project page is the environment in
• After you create or open a project, the project page appears. This which you design, package, and publish
page contains several panes and views that you can use to view and project metadata.
modify the objects in a project, including the:
In the Project Viewer, you can create query
subjects, data sources, namespaces,
• Project Viewer – shows the objects in a project in a hierarchical parameter maps, folders, segments, links,
view. You can use the Project Viewer to view, modify, and calculations, filters, and packages.
create objects.
In the Object Diagram view, relationships
between query subjects are shown as lines
• Project Info, Object Diagram, and Object Explorer views: with cardinality notation. You can expand
objects that are grouped in folders to show
• Project Info view – shows the highest level objects in the the hierarchy of the query subjects and
project; you can navigate to, view, and modify other child relationships that it contains.
objects
To organize objects In the Object Diagram
view, click Auto Layout from the Diagram
• Object Diagram view – shows the hierarchy and menu. To center a query subject, click a
relationships between objects in a project in a diagram query subject and, from the Diagram menu,
click Set Focal Point.
• Object Explorer view – shows the contents of a project,
In the Object Explorer view, you can
similar to any file system arrange objects by name, class, or
description. If you have a large number of
objects in a project, it may be easier to
locate them in the Object Explorer.

© 2003, Cognos Incorporated 1-17


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

• Properties pane – lets you view and modify the properties of


Additional Information
the objects you last selected in the Object Explorer view, Object properties are set during import, and
Object Diagram view, Project Viewer, or Search pane. some property values can be modified
during modeling. You can use the
• Summary pane – shows the statistics and tasks available for a Properties pane to add, modify, or delete
selected object: the properties of objects.

In the Statistics section, if the selected


• Statistics section - shows the number of objects, by class, object contains a folder, the contents of the
located in the currently selected object folder are included in the number count.
Selected objects include projects,
• Tasks section - shows actions that are applicable to the namespaces, and folders. The object
selected by default is the project.
currently selected object, based on the object class
In the Tasks section, if you select a folder,
• Search pane - lets you quickly find objects by applying different actions for the folder are listed. If you select
criteria that describe the object you want to search for an object in that folder, the list includes
actions for the object as well as for the
folder.

You can either search for the object name


alone, or add additional criteria, such as
the location, class, or a condition.

1-18 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION TO FRAMEWORK MANAGER

Examine Naming Conventions

ƒ Objects in Framework Manager:


ƒ have an identifier
ƒ can have the same name but must be uniquely identified using a
namespace
ƒ The identifier can consist of one, two, or three parts. For example:
ƒ query items have a three-part identifier
ƒ e.g., [GoSales].[Product].[ProductCode]
ƒ namespaces, functions, shortcuts to namespaces, and shortcuts
to folders have a one-part identifier
ƒ e.g., [GoSales]
ƒ all other objects have a two-part identifier
ƒ e.g., query subjects:[GoSales].[Product]

Additional Information
• All objects in a project must be identified by a unique name that is If you want to have objects with the same
used to reference them. The identifying name can consist of one, name in a project, these objects must be
two, or three parts, depending upon the type of object. The parts contained within different namespaces.
include:
Most of the objects in a Framework
Manager project have a two-part identifier.
• an object name The two-part identifier consists of the name
of the containing namespace and the name
• a location in the project hierarchy, as expressed in the default of the object. The object name must be
language of the project unique in the nearest containing
namespace. For example, you have a
GoSales namespace that contains a query
subject named Product. The Product query
subject has the following name, where the
square brackets and periods are the syntax
Framework Manager uses for object
identifiers: [GoSales].[Product].

Some objects in a project have a three-part


identifier. The three-part identifier is based
on the identifier of the containing query
subject. Each name must be unique in the
containing query subject.

The one-part identifier must be unique


across the entire project, even if the
namespace contains other namespaces.

Be careful when using special characters,


such as &, @, %, _, in an object name.
Depending on what data source you are
using, some characters may be reserved
database characters.

© 2003, Cognos Incorporated 1-19


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 1-1

ƒ Explore the Framework Manager User


Interface

1-20 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION TO FRAMEWORK MANAGER

Demo 1-1: Explore the Framework Manager User


Interface
Instructional Tips
Purpose: If necessary, maximize the Framework
Manager Welcome window.
As the Data Modelers for The Great Outdoors Company,
we have been tasked with developing a model that Unless specified in a step, you will always
supports the business requirements of our report and ad log on to Framework Manager and Cognos
hoc query authors working with Cognos ReportNet. Before Connection using the following credentials:
we begin the modeling process, we will explore the User ID = admin_person,
Framework Manger user interface to become familiar with Password = admin1234
it and to facilitate the modeling process. After logon, a message box may appear
indicating that the language you are logged
Task 1. Open a project. on with is not one of the supported
languages of this model. It also states that
1. From the Start menu, point to Programs, Cognos ReportNet, the language English will be used as the
and then click Framework Manager. active language of the model. This
The Welcome window of Framework Manager appears. From message appears because you are logging
into Framework Manager through a Web
here you can create projects, navigate to, and open existing page. This page is opened through the
projects, or open a project that has been recently opened. browser, and the Logon is picking up the
Locale setting of the browser. In this case,
2. Under Projects, click Open a project, and then in the Open your browser Locale setting is set to
Project dialog box, navigate to C:\ProgramFiles\cognos\crn\ English (United States), but this language
webcontent\samples\Models\gosales_goretailers. locale is not one of the language locales
specified or modeled in this project. To
3. Click gosales_goretailers.cpf, and then click Open. avoid getting this message, go to the
The Log on page appears. language settings for your browser and set
English as the default language of your
4. In the User ID box, type admin_person, in the Password box, browser. Alternatively, instruct students to
type admin1234, and then click OK. disregard the message and click OK. This
will not impact any steps to be taken in this
The gosales_goretailers project opens in Framework Manager. demo.

Task 2. Examine objects in the Project Viewer. Additional Information


Use the Properties pane to view and
1. In the Project Viewer pane, expand the gosales_goretailers modify the properties of the objects you last
selected in either the Object Explorer View,
namespace . Object Diagram View, Project Viewer, or
The model consists of a root namespace that cannot be deleted. All Search pane.
other objects appear within this namespace. At the level that is now Although the icon is not shown in the
shown, this namespace contains query subjects and folders. From demo, you may also see query items of
the icons, we can see that some of the query subjects contain query
type Identifier . Query item types will
items of type Fact , while others do not . be discussed in Module 3 – Prepare the
Metadata.
2. Expand the Orders query subject .
At the level that is now shown, this query subject contains query
items, and a folder. Some query items have their usage property set
to Attribute , while others have their usage property set to
Fact .

© 2003, Cognos Incorporated 1-21


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

3. Expand the Filters folder. Additional Information


A filter can be added as a model object or it
This model includes some stand-alone filters that, when published can be embedded within a query subject
as part of a package, can be used by report and ad hoc query definition. The latter can be done through
authors to filter their reports. the user interface or the query subject’s
SQL can be manually edited. Filters will be
discussed and demonstrated in Module 4 –
4. Expand the Data Sources folder. Prepare the Business View.

This folder contains the two data sources currently If there are query subjects that reference a
referenced in this model. Data sources are specified during the data source in a model, then the data
import of metadata. source cannot be deleted from the model.

5. Expand the Parameter Maps folder.


Instructional Tips
This folder contains a single parameter map . You can use a The use of parameter maps, session
parameter map in combination with a session parameter to create parameters, and macros will be discussed
a macro that will allow you to model a single query subject to and demonstrated in Module 3 – Prepare
represent all possible data source languages. the Metadata.

6. Expand the Packages folder.

This folder contains the packages that are available for


publishing to the ReportNet server. The packages contain all or a
subset of the metadata from the model.
Task 3. Examine different views of the user interface.
1. In the Project Info view, click Object Explorer. Additional Information
The Project Info view, by default is found in
This view provides a flat view of the contents of the project, as the middle of the user interface between
opposed to the hierarchical view objects provided by the Project the Project Viewer and the Summary
Viewer. panes.

2. On the toolbar, click Back to return to the Project Info view, and
then click Object Diagram.
This view shows the hierarchy and relationships between objects in
the project in a diagram. From here you can access, modify, and
create objects and relationships.
3. Resize the left, right, and bottom borders of the Object Diagram so
that it fills the screen.

4. From the toolbar, click the Diagram Sizing list , and


then click Fit All.
All the objects and relationships in the model are now visible.
5. Click the Diagram Sizing list, click 75%, and then resize the
diagram to approximately its original view, so that the other panes
are again visible.

1-22 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION TO FRAMEWORK MANAGER

6. In the Project Viewer pane, expand the Database view and GO


Sales folders, right-click the Order details query subject, and then
click Locate in Object Diagram.
The Object Diagram is repositioned to focus and highlight the
Order details query subject.

The following buttons can also be used


to zoom and re-draw your diagram.
7. In the bottom right corner of the diagram, click and hold on
Overview .
A smaller scale diagram of all the objects and relationships appears.
This provides perspective on where the current focus of the larger
diagram is, in relation to other objects and relationships.
8. Right-click on any white portion of the Object Diagram, point to Instructional Tips
Current View, and then click Large Icons. After step 8, tell students to scroll, if
necessary, to find the query subjects in the
The query subjects now appear with the same icons as seen in the Project diagram.
Viewer.
9. In the Project Viewer pane, expand the Retailers namespace.
10. Right-click the Contact query subject, and then click Locate in
Object Diagram.
The Object Diagram is repositioned to focus and highlight the
Contact query subject.
11. In the Object Diagram, click the Contact query subject, and then
from the toolbar, click Set Focal Point .
The diagram is redrawn so that object relationships appear to be
originating from the Contact query subject.
Task 4. Search for objects.
1. From the toolbar, click Search.
The Search pane replaces the Summary pane in the user interface. Additional Information
You can perform a search to quickly find objects and then change The Summary pane shows the statistics
their properties. You can apply different criteria that describe the and tasks available for a selected object.
The Statistics section shows the number of
object you want to search for. You can either search for the object objects, by class, located in the currently
name alone, or add additional criteria, such as the location, class, or selected object. The Tasks section shows
a condition. actions that are applicable to the currently
selected object, based on the object class.
2. In the Search for box, type product, and then click More.
More options for specifying search criteria appear.
3. Leave the default for the Search in box (gosales_goreatilers), in the
Class list, click Query Item, and then in the Condition list, click
begins with.

© 2003, Cognos Incorporated 1-23


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

4. Click Search.
The search is performed and a list of objects matching the search
criteria was found.
5. Click the first match found in the list.
You can now set properties for this query item using the Properties
pane.
6. Close Framework Manager without saving changes.

Results:
To facilitate the data modeling process in Framework
Manager, we familiarized ourselves with the user
interface. We opened an existing project, examined the
objects within it, examined different views of the
interface, and performed a search on objects in the
project.

1-24 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INTRODUCTION TO FRAMEWORK MANAGER

Summary

ƒ In this module, we have:


ƒ defined Framework Manager and its purpose
ƒ described the Framework Manager environment
ƒ examined the Cognos ReportNet and Framework Manager
workflow processes
ƒ examined the Framework Manager user interface

© 2003, Cognos Incorporated 1-25


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

1-26 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
2

1. Introduction to Framework Manager


2. Design and Create a Project
3. Prepare the Metadata
4. Prepare the Business View
5. Manage Packages
6. Set Security in Framework Manager
7. Manage Projects
8. Use Advanced Modeling Techniques

Cognos ReportNet – Metadata Modeling


COGNOS REPORTNET – METADATA MODELING

2-2 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

Objectives

ƒ In this module, we will:


ƒ identify and apply model structure best practices
ƒ create a project
ƒ import metadata
ƒ organize objects
ƒ publish the model

© 2003, Cognos Incorporated 2-3


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Framework Manager Workflow

Data
Sources

Import

Design/Create
Project

Instructional Tips
• The Design and Create Project phase provides the foundation for the
Remind students that the diagram shown
modeling process in Framework Manager. on the Framework Manager Workflow slide
will be built up and shown at the beginning
of each module.

2-4 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

What Are the Best Practices?

ƒ Follow some best practices for structuring Framework Manager


projects.
ƒ Use a two-tier model that organizes:
ƒ foundation objects into a physical
layer
ƒ reporting objects into a
presentation layer
ƒ Share and re-use information.
Presentation
layer
Physical
layer

• Before creating your project, you should consider some best practices Additional Information
for design. You also attempt to structure the metadata
in a way that will assist in model
• You design a project in Framework Manager to structure metadata in maintenance.
a format that will be meaningful, and minimize complexity, for report
The two-tier model works well for both
authors. report authors and data modelers. The
• The recommended structure is a two-tier model with both a physical presentation layer makes it easier for report
authors to find and understand their data,
and presentation layer, where you: while the physical layer acts as the
foundation for the presentation layer.
• organize foundation objects into a physical layer
• organize reporting objects into a presentation layer You can create segments, or extend a
project to other users by linking to other
• When you design a project, you might want to consider where to projects, to share and reuse information.
share and reuse information, and where to organize a project One way of organizing your project is to
create namespaces to allow duplicate
according to business needs. query subjects or query items in a project.
After you have designed your project, you
can then add and modify objects to better
reflect your business and prepare for
reporting.

© 2003, Cognos Incorporated 2-5


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Define the Physical Layer

ƒ The physical layer:


ƒ is a representation of the metadata as it appears in the data
source
ƒ provides a foundation for the presentation layer
ƒ is made up primarily of data source and stored procedure query
subjects
ƒ When creating the physical layer:
ƒ import only the smallest number of objects required
ƒ create calculations and filters that meet a wide range of business
requirements

• The physical layer provides the physical query layer and is made up
primarily of data source and stored procedure query subjects. It acts
as the foundation for the presentation layer.

• When creating the physical layer, import only the smallest number of
objects, such as tables, procedures, and functions, that you need in
your project.

• Where appropriate, create calculations, filters, and other


modifications in the physical layer to maximize reuse in the
presentation layer.

2-6 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

Define the Presentation Layer

ƒ The presentation layer:


ƒ is a modeled business view of the metadata from the data
source
ƒ facilitates report authoring
ƒ is made up primarily of model query subjects and shortcuts
ƒ When creating the presentation layer:
ƒ consider using shortcuts instead of copies of query subjects
ƒ create calculations and filters only if they meet a specific
business requirement

Additional Information
• The presentation layer makes it easier for report authors to find and
Shortcuts make it easier to maintain
understand their data. metadata in the physical layer. This helps
you maintain the objects by ensuring that
• The presentation layer is made up primarily of model query subjects changes to the target object are reflected in
that you create. the shortcut.

When you use shortcuts, consider where


• When creating the presentation layer, consider: you use them and what the impact is on
relationships:
• using shortcuts instead of copies of query subjects • shortcuts in the same folder as
the target query subject use the
• including a calculation or filter in the presentation layer only if it relationships of the target query
is used to satisfy a specific business requirement subject
• shortcuts in a different folder from
the target query subject ignore
the relationships of the target
query subject and use the
relationships specified for that
shortcut

© 2003, Cognos Incorporated 2-7


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Create a Project

ƒ Specify a name and file location for your project.

• You physically create the project during the Create component of the
Design and Create Project phase of the Framework Manager
workflow.

• At this point, you create the project by specifying the name and file
location of the project.

• You also specify whether to add the project to a repository to provide


source system control of the project.

2-8 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

Define Languages

ƒ Specify a design language for the project when you first create it.
ƒ Add languages any time after the project is created.

• When you create a project, you will be prompted to select a language. Additional Information
The design language value is stored in the
This is the design language of the project and it cannot be changed. model and cannot be changed. It serves as
the default language value. You should
• You can add languages to the project after you have created it. When make this selection based on the language
you add a language to a project, Framework Manager generates a new of the metadata you will be working with.
property value for every multilingual property of each object in the The selection you make will also become
the active language of the project. This
project. identifies the language in which model
content is currently displayed. This value is
not stored in the model and you can
change it at any time. For example, any
testing of query subjects that you do will
retrieve data in the appropriate language
that you select, provided you have data to
support that language.

A multilingual property is any text property


that appears in a report, such as Name,
Description, and Screen Tip. The new
values that Framework Manager assigns to
these text properties are a combination of
the original property value preceded by the
language code. For example, if a query
subject is named Country, and you add the
Dutch language, Framework Manager
inserts a Name whose value is
"(nl)Country".

© 2003, Cognos Incorporated 2-9


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Examine Data Sources

ƒ Import metadata into the model from the following sources:


ƒ relational databases
ƒ existing Cognos ReportNet models
ƒ Architect models
ƒ Impromptu catalogs
Additional Information
ƒ third-party metadata sources
Importing Architect models includes models
ƒ XML data file from the 7.0 and 7.1 versions of Architect.
Architect & ObjectStore must be installed;
and the Architect migration utility must be
installed (with ReportNet). Use the
migration utility to export Architect model
(.cem) metadata to an XML file, and then
import the XML file through the Import
Wizard.

Importing Impromptu catalogs includes 7.0,


• The data sources, from which you can import metadata into the 7.1, and 6.1[Japanese and English
Multibyte (EMB) catalogs. Impromptu
model, include: Automation must be installed; the
Impromptu migration utility must be
• relational databases - such as Oracle, DB2, and Microsoft SQL installed. Use the migration utility to export
Server Impromptu catalog (.cat) to the XML file,
then import the XML file through the Import
Wizard.
• existing Cognos ReportNet models
Framework Manager supports the import of
• Architect models a wide range of third-party metadata
sources (Informatica, Erwin, BO, Sybase,
• Impromptu catalogs etc…). See the Import Wizard for a listing
and description of the supported sources.
“MetaIntegration”, a third-party software, is
• third-party metadata sources used as the bridge to these sources.
Upgrades to the Metaintegration bridges
• XML as a data source can be downloaded from Metaintegrations
Web site. Metatintegration 4.0 will ship with
ReportNet 1.1.

An XML data file can be consumed locally


or from a remote site through a valid URL
(via either file or http). The XML file will be
validated and parsed at run-time, when the
query is processed by either Query Studio
or Report Studio. Before you import XML
as a data source, there must be a
connection to the data source. Set up the
connection by selecting Database in the
Import Wizard and then creating the
connection to the XML file.

2-10 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

Import From Multiple Data Sources

ƒ Import metadata from one or more of the supported data sources.


ƒ Consider the following:
ƒ Create a separate namespace for each import.
ƒ Define relationships between query subjects.
ƒ Create model query subjects that contain query items from two or
more data source (or model) query subjects.

Additional Information
• Import from one or more of the supported sources.
The following rules are applied when
setting multiple data source access in your
• To set up multiple data source access in your model, take these steps: model:
• Like named tables from different
• Create a separate namespace to contain the data source query data sources will result in name
subjects from each data source. collision. For example, both GO
Sales and GO Retailers have
COUNTRY tables. By default,
• Define at least one relationship between them using data source Framework Manager creates
query subjects from each data source. data source query subjects with
the same name as the table.
• Create model query subjects using query items from any data Resolve this by adding a second
source query subjects. namespace and import GO
Retailers into it.
• Relationships may be defined
between any two query subjects
from any data source.
• A data source query subject
cannot span multiple data
sources.
• A model query subject can
contain query items from two or
more data source (or model)
query subjects.

© 2003, Cognos Incorporated 2-11


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Import Metadata

ƒ Import metadata from a relational database.

Select Object
for Import

Select Criteria
Select Import Select Data Select Objects
to Generate
Source Source to Import
Relationships

Import
Create Data
Source

Additional Information
• The slide above shows the import process of metadata from a
You can import metadata into a
relational database. Choose the model object, into which you will namespace or a folder.
import, and then:

1. Select Database as the import source.

2. Select the data source to be used, or create a data source. If creating a When creating a connection, the wizard is
interfacing with the New Data Source
data source: Wizard in Cognos Connection.
a. specify name and connection type (MSSQL, Oracle, DB2, XML).

b. specify the connection string (if necessary)

c. specify a signon

d. test the connection


Framework Manager creates relationships
3. Select the objects to import, for example, tables, views, or procedures. during the import of data. You can specify
the criteria that will be used to generate
4. Select the criteria for how Framework Manager will generate those relationships.
relationships.

2-12 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

Specify Relationship Criteria

Select Criteria
to Generate
Relationships

Additional Information
• You need to select at least one of the following options to control The default option is Use primary and
how relationships are created: foreign keys.

You can select multiple options to control


• Use primary and foreign keys – relationships are created based on how Framework Manager detects and
the primary key/foreign key relationships defined in the generate relationships.
underlying database
The second option should be used when
there are not many constraint relationships
• Use matching query item names that represent uniquely indexed defined in the database, but there are
columns – relationships are based on the contents of unique many tables that have unique indexes
indexes of the two tables defined.

• Use matching query item names – creates relationships based on The third option should be used only when
matching query item names and data types there are not many keys or indexes defined
in the database, as it can generate too
many relationships.

© 2003, Cognos Incorporated 2-13


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

• Another selection criteria is the option to select which set of objects


is involved in the generation of relationships, including:

• Between the imported query subjects – the import examines


relationships among the selected tables and ignores all existing
query subjects

• Between each imported query subject and all existing query


subjects in the model – the import examines only relationships
from each imported query subject to each and every existing
query subject

• Both – the import executes both the options above

• When outer joins exist in the database, you can indicate how to
generate relationships between the imported query subjects:

• Convert to inner join (1..n) - the minimum cardinality will be 1 on


both sides

• Create outer join (0..n) - the minimum cardinality will be 0 on


either side

2-14 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

Define Function Sets

ƒ You can restrict the function sets available in the expression editor so
that it lists only the vendors that you want.

Additional Information
• A function set is a collection of vendor specific database functions.
You customize the function set by
identifying the specific vendor for each data
• The expression editor lists the function sets for all available vendors. source defined in the project.
However, you can restrict the function sets so that it lists only the
vendors that you want to use in your project. The Function Definition Service does not
distinguish between multidimensional and
relational function sets.

You can also specify which function sets


will be published and available with a
package. The function set must already be
available in the project.

© 2003, Cognos Incorporated 2-15


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Examine and Organize Objects

ƒ After importing metadata:


ƒ examine objects to validate the metadata
ƒ organize objects to create a structure

Set properties
Verify and test
query subjects
Create folders &
rename objects

• After importing metadata:

• examine objects and validate the metadata, by verifying and


testing query subjects

• organize objects and create a structure, by:

• creating folders, for example, to separate the physical layer


from the presentation layer

• renaming objects, for example, to provide more meaningful,


less cryptic names

• setting properties

2-16 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

Export Metadata

ƒ Export your Framework


Manager model as a Common
Warehouse Metamodel file.

Additional Information
• You can export your Framework Manager model as a Common
CWM is used for exchanging metadata
Warehouse Metamodel (.cwm) file. between different data warehouse tools
and repositories. Each instance of the
• You can export query subjects, query items, folders, namespaces, CWM metamodel is exchanged via XMI
expressions and functions. (XML metadata interchange) documents.

When you export to CWM, we recommend


that you use the default options. These
default options optimize the metadata
export. If you change the options, you may
see unexpected results.

© 2003, Cognos Incorporated 2-17


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 2-1

ƒ Create a Project and Import Metadata

2-18 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

Demo 2-1: Create a Project and Import Metadata

Purpose:
Now that we have an understanding of the Framework
Manager modeling environment, we can begin the process
of developing a model that supports the business
requirements of our report and ad hoc query authors. We
will begin by creating a project, organizing high-level
objects, and importing metadata.

Task 1. Create a project.


1. From the Start menu, point to Programs, Cognos ReportNet, and
then click Framework Manager.
The Welcome window of Framework Manager appears.
2. Under Projects, click Create a new project, and then in the location
box, type C:\Edcognos\CR1052\GO Model.
GO Model appears by default in the Project name box.
3. Click OK.
The Log on page appears.
4. In the User ID box, type admin_person, in the Password box, type
admin1234, and then click OK.
The Select Languages dialog box appears. We will initially set the
default and design language for this project as English.
5. Ensure that English(United States) is selected, and then click OK.
The Import Metadata wizard appears. We will import metadata in a
later task.
6. Click Cancel.
The GO Model project opens in Framework Manager. Notice in the
Project Viewer that the GO Model project appears with a default
namespace called Model.
Task 2. Add languages to the project.
1. From the Project menu, point to Languages, and then click Define
Languages.
The Define Languages dialog box appears. Notice that the project
currently contains only English (United States) and it is the active
language of the project.

2. In the Available Languages box, click French, click Add , and


then click OK.
A warning message appears indicating that the French language will
be added to every text property of every object.

© 2003, Cognos Incorporated 2-19


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

3. Click OK.
We will now create other objects and begin to organize all objects
within the model. We will rename the default namespace and create a
folder to hold our imported data source query subjects. This folder
will serve as a container for the physical layer. Later in the modeling
process, we will create another folder, which will allow us to logically
separate our model into a physical view for modelers, and a
presentation view. This presentation view will be made available to
our report authors.
Task 3. Create and organize objects.

1. In the Project Viewer pane, right-click the Model namespace,


and then click Rename.
2. In the box, type GO Model, and then press Enter.
3. Right-click the GO Model namespace, point to Create, and then
click Folder.
The Create Folder Wizard appears.
4. In the Folder name box, type Database layer, and then click Next.
5. Accept the default selections, and then click Finish.
The Database layer folder appears under the GO Model namespace.
We will now create a namespace within the new folder.
6. Right-click the Database layer folder, point to Create, and then
click Namespace.
7. Right-click New Namespace, and then click Rename.
8. In the box, type gosales, and then press Enter.
We will now begin the import process for importing the metadata
into the gosales namespace. We will start by creating a data source
and testing the connection to it.
Task 4. Create a data source and test the connection.
1. Right-click the gosales namespace, and then click Import
Metadata.
The Import Wizard appears. From here we can select the source
from which we will import the metadata. We will import data from a
relational database.
2. Ensure that Database is selected, and then click Next.
We are now prompted to select a data source from the list of
available data sources. The data source we need to access is currently
not available. We must create a connection to the database from
which we are importing metadata. We are connecting to the GOSales
database, which is an MSSQL Server database.

2-20 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

3. Click New.
The Welcome page of the New Data Source Wizard appears. This is Additional Information
the same wizard that is used to create data sources through the Data sources listed in the Import Wizard
Directory tool in the Cognos Connection administration interface. can only be deleted from the Data Sources
tab in the Cognos Connection Directory
4. Click Next, in the Name box, type GOSL, and then click Next. tool.

5. In the Type list, click Microsoft SQL Server, leave the default
Isolation level, and then click Next.
6. In the Server name box, type localhost, and then in the Database
name box, type GOSL.
The isolation level specifies how
7. Under Signon, select the User ID and Password check boxes, and transactions that modify the database are
then in the User ID, Password, and Confirm password boxes, type handled. By default, the default object
gateway is used. You can select from a list
sa.
of isolation levels. Not all types of
8. Scroll to the top of the page, click Test, and then click OK. databases support each isolation level, and
some database vendors use different
A message appears indicating the test was performed successfully. names for the isolation levels. For more
information on isolation levels, see the
9. Click OK to close the message box. Framework Manager User Guide.
10. Click Close, click Finish, and then click Finish again to close the
Wizard.
A new data source now appears in the list, through which we will
now import metadata.
Task 5. Import metadata.
1. Ensure that the GOSL data source is selected, and then click Next.
2. In the list of objects, select the Tables check box, and then click After selecting which objects to import,
Next. there are two options to choose from to
control how Framework Manager will
We do not require all the metadata objects in the database, only the handle a duplicate name when it is
tables and the columns within them. detected:
3. Leave the defaults for the Generate Relationship criteria, and then • Option (1) Import and create a
unique name: The import does
click Import. not update the existing query
The import process begins, and then a message appears summarizing subject (it is unchanged), but a
the count of objects that were imported. new query subject will be created
whose name is appended with a
4. Click Finish. sequence number. All selected
columns and corresponding keys
5. In the Project Viewer pane, expand the gosales namespace. and indexes will be generated for
this new query subject. There is a
The namespace now contains a list of query subjects, which represent problem with relationships
each of the tables that were imported from the relational database. however, and no primary/foreign
key relationships can be retrieved
when the name of a query
subject has changed.
• Option (2) Do not import this
object: This is the default
behavior. The import ignores an
object that has name conflict.

© 2003, Cognos Incorporated 2-21


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

6. Expand the Data Sources folder.


This folder now contains the GOSL data source, which is the data
source we specified during the import. This data source is now
associated with this model. We will now define a functions set for the
project. This functions set will be based on the data source from
which we have imported metadata.
Task 6. Define function sets.
1. From the Project menu, click Project Function List.
The Project Function List dialog box appears.
2. Click Set function list based on the data source type, and then
click twice in the box under the Function set column in the GOSL
row.
A list of database specific function sets appears.
3. Click SQLServer, and then click OK.
We will now create a package based on the model in its current state
and publish it. We will then open Cognos Connection to view the
published package, and Query Studio to view the run-time version of
the model as it would appear to an ad hoc query author.
Task 7. Create and publish a package. Instructional Tips
Although we have not performed any
1. In the Project Viewer pane, right-click Packages, point to Create, significant modeling, we will take the
and then click Package. opportunity to publish a package and view
it as it would appear to report authors in its
The Create Package Wizard appears. current state. We will repeat this task after
each demo and workshop to provide some
2. In the Name box, type GO Model, and then click Next. perspective as to how the model has
3. Leave the default selections, and then click Finish. changed as a result of our modeling efforts.

A dialog box appears indicating that the package was created


successfully, and prompts us to open the Publish Package wizard. You will receive two warning messages on
the instructor's machine, click OK to both.
4. Click Yes.
5. If necessary, clear the Enable model versioning check box, accept We will be discussing Model Versioning in
the remaining defaults, and then click Publish. Module 5 – Manage Packages.
A message appears within the wizard indicating that the package was
successfully published.
6. Click Finish to close the wizard.
7. From the File menu, click Save.

2-22 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

Task 8. View the package in Cognos Connection and


the run-time model in Query Studio.
1. Open Internet Explorer.
2. In the address box, type http:// <servername>/crn/cgi-
bin/cognos.cgi, and then press Enter.
The Log on page appears.
3. In the User ID box, type report_author, in the Password box, type
ra1234, and then click OK.
The Welcome page of Cognos Connection appears in the browser.
4. Click the Public Folders tab.
Notice that the GO Model package we published from Framework
Manager now appears as an entry within Public Folders.
5. Click the Query Studio link at the top right corner of the page.
The Select a Package page appears, and prompts us to choose a
package to use in creating the report.
6. Click GO Model.
Query Studio appears in the browser. Under Menu on the left side of
the page, we can see that Insert Data is selected, and that the GO
Model and Database layer folder appears. These were the objects we
specified in the Publish Package wizard in Framework Manager.
7. Expand the Database layer folder.
A gosales folder appears. This folder is generated because we created
a namespace called gosales in Framework Manager. This was the
namespace into which we imported the metadata.
8. Expand the gosales folder.
The query subjects appear and are available to an ad hoc query author
for creating a report.

© 2003, Cognos Incorporated 2-23


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 9. Create an ad hoc query.


1. In the gosales folder, expand the PRODUCT_LINE query subject,
and then double-click the PRODUCT_LINE_EN query item.
2. Repeat step 1 to add PRODUCT_TYPE_EN from
PRODUCT_TYPE, PRODUCT_NAME from
PRODUCT_MULTILINGUAL, and QUANTITY from
ORDER_DETAILS.
We have successfully created an ad hoc query using the run-time Instructional Tips
model. However, notice that when we added the Modeling techniques for developing a
PRODUCT_NAME query item, we obtain a row for each language model that supports a multilingual audience
will be covered in Module 3 – Prepare the
that is currently in our multilingual database. This is highly inefficient, Metadata.
and we will resolve this by making changes to our model so that it
efficiently supports report authors who must develop reports for a
multilingual audience.
3. At the top of the page, click Return, and then click No when
prompted to save the report.
4. Leave Cognos Connection and Framework Manager open for the
workshop.

Results:
We started to develop the model that will support the
business requirements of our report and ad hoc query
authors. We created a project, organized high-level objects,
imported metadata, and examined a run-time version of the
model in the reporting environment.

2-24 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

Summary

ƒ In this module, we have:


ƒ identified and applied model structure best practices
ƒ created a project
ƒ imported metadata
ƒ organized objects
ƒ published the model

© 2003, Cognos Incorporated 2-25


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

2-26 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

Workshop 2-1

ƒ Import Metadata From a Second


Data Source

Workshop Format
The following workshops have been designed to allow you to work according to your own pace. The
workshops are structured as follows:
The Business Question Section
The first page of each workshop exercise presents a business-type question followed by a series of steps.
These steps provide additional information to help guide the student through the workshop. Within each
step, there may be numbered questions relating to the step. Solve the tasks by using the skills you learned in
this module and in the previous ones. If you need more assistance, you can refer to the Task Table section
that provides more detailed instruction.
The Task Table Section
The second page of the exercise is a Task Table that presents the question as a series of numbered tasks to
be accomplished. The first column in the table states the task to be accomplished. The second column,
“Where to Work”, indicates the area of the product to work in. Finally, the third column provides some
hints that may help you complete the exercise. If you need more assistance to complete the exercise, please
refer to the Step-by-Step section, in Appendix A.
The Workshop Results Section
This section will contain a screen capture(s) of an interim or final results and/or answers to the questions
asked in the Business Question section.
The Step-by-Step Section
The Step-by-Step instructions for completing all of the workshops are located in Appendix A of the
Student Guide. Each task in the Task Table is expanded into numbered steps, scripted like the demos.

© 2003, Cognos Incorporated 2-27


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 2-1: Import Metadata From a Second Data


Source
One of the reporting requirements of our report and query authors is that
they can create reports based on data from both the GO Sales and GO
Retailers relational databases. To fulfill this requirement, the GO Model must
also contain metadata from the GO Retailers and GO Sales databases. As a
result, your high-level tasks are as follows:

• Create a namespace to contain the GO Retailers metadata.

• Create a data source through which metadata will be imported.

• Import the metadata.

• Publish a package and access the run-time model in the reporting


environment.

• Create a report that includes query items from the model that span
both the GO Sales and GO Retailers data source.

• Additional Challenge: explain the error message that is received.

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-28 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

Workshop 2-1: Task Table


Task Where to Work Hints
1. Create a second Project Viewer • The new namespace is called
namespace. goretailers.
Database layer folder

2. Create a data source and goretailers namespace • To create the data source,
test the connection. use the following
Import Wizard information:

• Import source:
Relational Database

• name: GORT

• type: MSSQL

• server name and signon


are the same as for
Demo 2-1.

• Test the connection as in


Demo 2-1.

3. Import metadata. Import Wizard • Choose the data source.

• Import tables only.

• Leave all default selections in


the Wizard.

4. Publish the package. Publish Wizard • Publish the GO Model


package.

• Accept defaults and


overwrite the existing
package.

• Save the project.

© 2003, Cognos Incorporated 2-29


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task Where to Work Hints


5. Create an ad hoc query in Query Studio • Create a query using the
Query Studio using the RETAILER_NAME query
updated run-time model. Database layer folder item from
ORDER_HEADER, the
gosales and goretailers CITY query item from
folders RETAILER_SITE, and the
ORDER_METHOD_EN
item from
ORDER_METHOD

• Additional Challenge: explain


the error message that occurs
after you try to add the
CITY query item to the
query.

• View details of the error.

• Return to Cognos
Connection without saving
the report.

If you need more information to complete a task, see the Step-by-Step


instructions for this exercise in Appendix A.

2-30 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
DESIGN AND CREATE A PROJECT

Workshop 2-1: Workshop Results


Your browser window should appear as shown in the graphic below.

Answer to the Additional Challenge: the error occurs because you are trying
to access data from two different data sources in this query. Although these
data sources exist in the model, a relationship has not been specified between
the two of them. This relationship will be created as part of the modeling
process performed in the Prepare Metadata phase of the Framework Manager
workflow.

© 2003, Cognos Incorporated 2-31


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

2-32 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
3

1. Introduction to Framework Manager


2. Design and Create a Project
3. Prepare the Metadata
4. Prepare the Business View
5. Manage Packages
6. Set Security in Framework Manager
7. Manage Projects
8. Use Advanced Modeling Techniques

Cognos ReportNet – Metadata Modeling


COGNOS REPORTNET – METADATA MODELING

3-2 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Objectives

ƒ In this module, we will:


ƒ examine Limited Local versus Database Only processing
ƒ verify, modify, and create relationships between query subjects
ƒ verify and modify query item properties
ƒ create and test new query subjects
ƒ create calculations
ƒ create macros using parameter maps and session parameters

© 2003, Cognos Incorporated 3-3


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Framework Manager Workflow

Data
Sources

Import

Design/Create Prepare the


Project Metadata

• Prepare metadata – examine and modify properties and relationships;


organize objects.

3-4 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Specify Query Processing Type

ƒ To control performance, you can select the type of query processing


you want.

Additional Information
• There are two types of query processing to choose from:
The default selection depends on the
database in question. The Limited Local
• Limited Local – means that the database server does as much of setting is not usually required. In some
the SQL processing and execution as possible. However, some cases such as with conversion functions,
reports or report sections use local SQL processing Limited Local may need to be set.

If you receive an error message specifying


• Database Only – means that the database server does all the SQL that Limited Local processing is required,
processing and execution with the exception of tasks not examine the error message and determine
supported by the database. An error appears if any reports or if the requirement meets your needs and is
report sections require local SQL processing. not actually a modeling error.

© 2003, Cognos Incorporated 3-5


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Examine Relationships in Framework Manager

ƒ Relationships are maintained in the object diagram.


ƒ They define the cardinality between query subjects.
Additional Information
ƒ cardinality defines the numeric relationships between occurrences Cardinality defines how many rows exist in
of the query subjects on either end of a relationship one query subject for each row in the other.

• Relationships between query subjects define joins between these


‘views’ and are normally specified at the data source query subject
level (physical layer).

• In the slide example we have two query subjects:


Additional Information
• the numbers 1..1 and 1..n on the relationship line state the
The left most number in the cardinality
cardinality (1.. and 0..) indicates if the relationship is
inner (non optional) or outer (optional)
• 1..1 means there is only one record respectively.

• 1..n means there is one or more than one record (never zero) The second number (..1 and ..n) in the
cardinality tells ReportNet whether to
account for multiple records when
• 0..1 (not shown) means there is zero or one record generating results.

• 0..n (not shown) means there is zero, one or more than one
record

3-6 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Modify and Create Relationships

ƒ Framework Manager creates relationships for your metadata during


import.
ƒ You can modify the existing relationships or create new ones if they
are required and do not exist.
ƒ Relationships can be created between any two query subjects.
ƒ Presentation layer relationships can override physical layer
relationships.
Presentation Layer Physical Layer

1..1 1..1
Product 0..n
Product_Forecast Product 1..n
Product_Forecast

Overrides

• Framework Manager will create relationships during a metadata


import based on the options you choose.

• All relationships should be examined to ensure they follow your


intended business rules and specify the correct cardinality.

• You can create new relationships between query subjects in the


physical layer, the presentation layer, and even across data sources.
Additional Information
• If you create a relationship between two query subjects in the
The best practice is to create and maintain
presentation layer, that relationship will override the existing physical relationships in the physical layer. If you
layer relationship. This allows a further degree of control in your have a need to override the physical layer,
reporting requirements. Perhaps, for a specific report, the physical you must be careful as you can damage
layer relationship does not meet your reporting requirements. You other relationships in your presentation
can create the appropriate relationship in the presentation layer layer.
specific to that reporting need so that relationships in other
presentation layers are not affected.

© 2003, Cognos Incorporated 3-7


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Examine Ambiguous Relationships

ƒ There are four basic relationship scenarios to examine.

Many–to–Many Relationships Ambiguous or Redundant Relationships


1..n 1..1
1..n 1..n

1..1 1..1
Hierarchical Relationships 1..n

1..n

1..1
1..n Parallel Relationships

1..1 1..1

1..1
1..n 1..n 1..n

Additional Information
This slide should be used to discuss some
of the design issues you might face when
dealing with relational data.
• Many–to–many relationships must be resolved at the data source
level, however, all other scenarios should be examined. Ambiguous or Redundant Relationships
are the only types of relationships that
• Ambiguous or redundant relationships are patterns that may make it need to be addressed when modeling
metadata in Framework Manager.
difficult to write queries that retrieve the appropriate data. This is ReportNet handles Hierarchical
because it may not be clear which table columns must be included in Relationships and Parallel Relationships.
the Select statement. Going through either path produces a result, but
you should specify the correct or more efficient path. Appendix B also addresses, in more detail,
how these issues are handled in
• Hierarchical relationships involve multiple query subjects, each of Frameworks Manager.
which represent a level in a hierarchy. If you need to use only the The best practice for modeling
query subjects on either end of a hierarchy, ReportNet is aware of the relationships is to go for maximum clarity.
middle query subject(s) and writes the appropriate SQL to return the
correct results. As you resolve one scenario, you may
create another. This does not mean that
your relationships are incorrect. Just make
• Parallel relationships can result in double–counting. ReportNet
sure that they meet your business rules.
handles this scenario by using a stitch query, which merges two result
sets locally on the ReportNet server to produce the correct results.
Stitch queries will be examined elsewhere in this course.

3-8 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Resolve Ambiguous Relationships

ƒ Use shortcuts and folders to isolate relationships in order to resolve


ambiguity.

Sales Branch Sales Branch


1..1 1..1 1..1 1..1

1..n 1..n

Orders Orders
1..n 1..n

Relationship 1..1 0..n 1..1 0..n

in Sales Staff Shortcut to Sales Staff Sales Staff


Question

Additional Information
• In the slide example, we see ambiguous relationships between the
This concept is similar to creating alias
three query subjects. Which relationship will be used when querying tables.
all three query subjects together?
Instructional Tips
• We can create a shortcut to Sales Staff, delete the original relationship This would be a good time to show Order
between it and Orders and then create the same relationship between header to Sales branch to Sales Staff
relationship wheel in the GO Model to
the shortcut and Orders, as seen in the slide example. better illustrate this concept.

• When you create the presentation layer, you can use folders to This ambiguous relationship path will be
logically isolate query subjects and shortcuts so that report authors resolved in the following demo.
know they are using the appropriate relationships.

© 2003, Cognos Incorporated 3-9


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 3–1

ƒ Modify and Create Relationships

3-10 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Demo 3–1: Modify and Create Relationships

Purpose:
Now that we have imported database metadata into our
model, we want to refine the model by making some
relationships optional. For example, many countries tracked
by the COUNTRY query subject are not part of the European
Union. We must therefore make the relationship between
the COUNTRY and EURO_CONVERSION query subjects
optional.

We will also resolve an ambiguous relationship scenario


found between the ORDER_HEADER, SALES_BRANCH and
SALES_STAFF query subjects. We will use a shortcut to
accomplish this.

In addition, we want to link the metadata in the gosales and


goretailers namespaces by creating a relationship between
the ORDER_HEADER and RETAILER_SITE query subjects.
Lastly, we will test our modifications by re–publishing the
GO Model package and creating a simple report in Query
Studio.

Task 1. Modify relationships.


1. In Framework Manager, click Object Diagram, expand Database
Layer, and then expand gosales.
The query subjects from gosales appear in the object diagram.
2. In the diagram, click the relationship between the COUNTRY and
EURO_CONVERSION query subjects.
We can see that the two query subjects are related through a common
query item called COUNTRY_CODE. The result appears as shown
below:

© 2003, Cognos Incorporated 3-11


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

3. Double–click the relationship.


The Relationship Definition dialog box appears.
4. On the EURO_CONVERSION side, in the Cardinality box, click Instructional Tips
0..n. This is a good time to click on the
Relationship SQL tab to show students the
The result appears as shown below: SQL that is generated based on this
relationship. It is a good tool to use when
trying to understand how ReportNet is
querying the data source.

5. Click OK, and then double–click the relationship between


COUNTRY and CONVERSION_RATE.
The Relationship Definition dialog box appears.

3-12 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

6. Modify the relationship so that the result appears as shown below:

7. Click OK, and then double–click the relationship between


SALES_STAFF and SALES_TARGET.
The Relationship Definition dialog box appears.

© 2003, Cognos Incorporated 3-13


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

8. Modify the relationship so that the result appears as shown below:

9. Click OK.
Task 2. Resolve an ambiguous relationship scenario.
1. In the Project Viewer pane, right–click the SALES_STAFF query
subject, and then click Locate in Object Diagram.
2. In the Object Diagram, right–click the SALES_STAFF query
subject, and then click Create Shortcut.
A shortcut the SALES_STAFF query subject appears in the Object
Additional Information
Diagram as well as in the Project Viewer. After a shortcut has been created, you can
3. Right–click the Shortcut to SALES_STAFF shortcut, and then click always view the target of the shortcut by
Create Relationship. looking at the Target Object Reference
property in the Property pane.
The Relationship window appears.
4. In the Name box, type SALES_SAFF <–––>
ORDER_HEADER.

5. Click the ellipsis for the right–side query subject.


The Select Query Subject dialog box appears.
6. In the Available Items pane, expand the Database Layer folder, and
the gosales namespace and then click ORDER_HEADER.
7. Click OK.

3-14 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

8. From the query item list for the right–side query subject, select
SALES_STAFF_CODE.
Your relationship should appear as shown below:

9. Accept the default cardinality and then click OK.


10. In the diagram, right–click the relationship between the
SALES_STAFF and ORDER_HEADER query subjects and then
click Delete.
Task 3. Create a relationship.
1. In the diagram, right–click the ORDER_HEADER query subject,
and then click Create Relationship.
The Relationship Definition dialog box appears.
2. In the Name box, type ORDER_HEADER <–––>
RETAILER_SITE.
3. Beside the right (blank) query subject, click the ellipsis.
The Select Query Subject dialog box appears.
4. Expand Database Layer and goretailers, click
RETAILER_SITE, and then click OK.

© 2003, Cognos Incorporated 3-15


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

5. Modify the relationship so that it appears as shown below:

6. Click OK, and then save the model.


Task 4. Republish the package and create a report in
Query Studio.
1. In the Project Viewer pane, ensure that Packages is expanded, right–
click the GO Model package, and then click Publish Packages.
The Publish wizard opens.
2. Click Publish.
A message appears, indicating that a package called GO Model
already exists.
3. Click Yes, click OK if prompted, and then click Finish.
4. In Cognos Connection, click Query Studio in the top right corner
and select the GO Model package.
Query Studio opens.
5. In the left pane, expand Database Layer, gosales, and goretailers.
6. In gosales, expand ORDER_HEADER, and then double–click
RETAILER_NAME to add it to the report.

3-16 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

7. In goretailers, expand RETAILER_SITE, and then double–click


CITY to add it to the report.
8. In gosales, expand ORDER_METHOD, and then double–click
ORDER_METHOD_EN to add it to the report.
9. Ctrl+click the RETAILER_NAME and CITY columns, and then
on the toolbar, click Group.
The result appears as shown below:

Notice that there is no error message, indicating that there is a valid


relationship between the GOSL and GORT data sources.
10. In the top right corner, click Return, and then, to avoid saving the
report, click No.
11. Leave Framework Manager and Cognos Connection open for the
next demo.

Results:
We refined the model by making some relationships
optional. We also linked the metadata in the gosales and
goretailers namespaces by creating a relationship between
the ORDER_HEADER and RETAILER_SITE query subjects.
Lastly, we tested our modifications by re–publishing the GO
Model package and creating a simple report in Query
Studio.

© 2003, Cognos Incorporated 3-17


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Examine Query Subjects

ƒ Query subjects are the building blocks in Framework Manager.


ƒ A query subject contains query items which represent a projection list
from the underlying data source.
ƒ There are three types of query subjects:
ƒ data source query subjects
ƒ model query subjects
ƒ stored procedure query subjects

Query Subjects
Query Items

• Each query subject is defined by an SQL statement that describes


how to retrieve data from the data source. Framework Manager
generates query subjects that represent tabular data from the data
source, based on the definition of the query subject.

• Query subjects contain query items, which represent a projection list


from tables in the data source. The SQL in the query subject may
specify to return all columns or only certain ones.
Additional Information
• Data source query subjects contain SQL statements that directly
Each query subject type has its own
reference data in a single data source. advantages, depending on how you want
the query to retrieve information. When you
• Model query subjects create query items that are oriented to reporting create a query subject, Framework
needs (presentation layer) while reusing the underlying data source Manager prompts you to identify the type of
queries. query subject you wish to create: data
source, model, or stored procedure.
• Stored procedure query subjects are generated when you import any
procedure that is not identified as a function in the data source. This
We will discuss stored procedures in more
type of query subject will call a stored procedure in the database, detail elsewhere in this module.
which will return a result set.

3-18 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Modify and Test Query Subjects

ƒ After you import or create a data source subject, or create a model


query subject, you can:
ƒ edit the SQL (data source query subjects only)
ƒ change the query items referenced
ƒ create calculations
ƒ add filters
ƒ insert a macro
ƒ After you import a stored procedure query subject, you can edit the
name, data source, and arguments.
ƒ You can test query subjects as you create or modify them to see the
data they retrieve.

Additional Information
• With data source query subjects you also have the ability to change
Cognos SQL, native, and pass–through will
the SQL type (Cognos SQL, native, or pass–through). be discussed elsewhere in this module.

• When you change the definition of a query subject, Framework


Manager regenerates the associated query items for you.

• If you decide you would like to edit the SQL of a model query
subject, Framework Manager converts it to a data source query
subject. Once it is converted, you can edit the SQL.

• If you modify a stored procedure query subject, it should return the


same result set structure as the original to avoid inconsistencies.

• Framework Manager lets you modify existing test settings so that you
can customize the results that the test displays.

© 2003, Cognos Incorporated 3-19


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Edit the SQL of a Data Source Query Subject

ƒ You can quickly and easily alter the SQL of a data source query
subject to meet your needs.

Additional Information
• You can modify your SQL to include filters (as seen in the slide
If you change column titles, Framework
example), calculations, UNIONS, nested select statements, or any Manager regenerates the query item as a
other SQL requirement you may have. new item. Any previous changes made to
the query item properties will be lost.
• This functionality gives the metadata modeler a greater degree of
control over what data is returned when a query is executed.

3-20 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Set SQL Type and Generated SQL

ƒ You can set the SQL Type and Generated SQL for each query subject.
ƒ SQL Type includes:
ƒ Cognos
ƒ Native
ƒ Pass–Through
ƒ Generate SQL includes:
ƒ Minimized
ƒ As View

SQL Type
Additional Information
Framework Manager generates the most
• By default, Framework Manager uses Cognos SQL to create and edit optimized SQL possible, while preserving
query subjects. Cognos SQL adheres to SQL99 rules and works with its functionality. In this way, Cognos SQL
all tabular data sources. offers the most added value.

• Native SQL is the SQL the data source uses, such as Oracle SQL. You cannot use Native SQL in a model
query subject that references more than
one data source in the project.
• Pass–through SQL lets you use Native SQL without any of the
restrictions the data source imposes on subqueries. Pass-Through SQL query subjects are not
processed as subqueries. Instead, the SQL
Generate SQL for each query subject is sent directly to the
data source where the query results are
generated.
• By default, the SQL Generation type is set to Minimized, which
means that the generated SQL contains only the minimal set of tables
and joins needed to obtain values for the selected query items. This
results in a query that executes significantly faster.
Instructional Tips
• When the generation type is set to As View, Framework Manager
This is a good time to open a query subject
generates queries that contain the full SQL statement of the query definition window, click on the Options
subject, which bypasses certain query optimization. button in the toolbar and show the options
dialog. You can briefly discuss the Test
Settings and show the SQL Settings tab.
Refer to the section “Test a Query Subject”
in the Framework Manager User Guide.

© 2003, Cognos Incorporated 3-21


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Examine Query Items

ƒ Query items represent data columns in a data source, or are


calculations based on data columns in a data source.
ƒ A query item may be:
ƒ a reference to a data source column
ƒ a reference to another query item
ƒ a calculation

Sales Territory Table

Query Subjects Query Item

• If you have a large amount of query items for a query subject, you can
organize them into query item folders for greater manageability.

3-22 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Modify Query Item Properties

ƒ Each query item has properties that can be modified to suite your
reporting needs.

• You may have special requirements in your reporting environment


that can be addressed by setting some properties for your query
items.

• How should your query item be used? Is it an identifier, a fact, or an


attribute?

• How do you want your values to aggregate? By default, number


values will be summed.

• A best practice, at a minimum, should be to ensure the Usage and


Regular Aggregate properties are properly set to meet the report
author’s desired outcome.

• To save report authors time, you can modify other properties such as Additional Information
the Format property. You can also add descriptive information and With the format property you can display
Quantity as a number with a thousands
screen tips for your query items.
separator. Your query item may be a dollar
value in which case you may want to set
the Format property to currency.

See the Framework Manager User Guide


for details on property settings.

© 2003, Cognos Incorporated 3-23


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Set Usage Property

ƒ The Usage property


ƒ identifies the intended use for the data represented by each query
item
ƒ determines the aggregation rules of query items and calculations
ƒ The different Usage property settings are:
ƒ Identifier
ƒ Fact
ƒ Attribute
ƒ Unkown

Additional Information
• An Identifier is usually a key, index, date, or datetime data type. It During import, the Usage property is set
according to the type of data that the query
represents a column that is used to group or summarize the data in a items represent in the data source.
Fact column with which it has a relationship.
If data meets multiple criteria these rules
• A Fact is usually a numeric or timeinterval data type. It represents a are applied in the order in which they are
column that contains numeric data that can be grouped or listed. For example, if you import a numeric
column that participates in a relationship,
summarized, for example, Product Cost. the Usage property is set to "identifier".

• An Attribute is usually a string data type. It represents a column that When you create a model query subject,
is neither an Identifier nor Fact, such as Description or Product each query item inherits the Usage
Name. property of the query item on which it is
based.
• Setting the property to Unknown is used when a modeler is unsure of
the data’s role.

3-24 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Set Regular Aggregate Property

ƒ The Regular Aggregate property identifies the type of aggregation


that is associated with the query item or calculation when you publish
it.
ƒ Model aggregation rules are applied when the report author creates a
report that aggregates a query item or calculation.
ƒ For example, if the Regular Aggregate property value of the query
item Quantity is "sum", and the report author groups it by Product
Name, the Quantity column in the report displays the total quantity of
each product.

Additional Information
• Aggregate settings include sum, count, and average, as well as several
You may also choose to have no
others. aggregation applied at all, which would
return detail rows.
• The report author can either use this default setting to perform
calculations on groups of data, or override it by using the reporting If desired, report authors can override the
application to apply a different type of aggregation. default aggregation setting at design time.

• During import, Framework Manager uses the Usage value to


determine the value of the Regular Aggregate property of each query
item.

© 2003, Cognos Incorporated 3-25


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 3–2

ƒ Set Properties for Query Items

3-26 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Demo 3–2: Set Properties for Query Items

Purpose:
As a data modeler you need to customize some query items
in the model to make them more intuitive and return the
desired results for report authors. For example, we want
some data to be averaged rather than totaled in reports, so
we will adjust the Regular Aggregate property of certain
query items. In addition, we want to specify the default date
prompt control behavior when creating a prompt page in
Report Studio. Lastly, we want to add screen tips and
descriptions for some query items. These screen tips and
descriptions will be visible in Report Studio. Once we have
implemented these changes, we will re–publish the GO
Model package, and view the results in Report Studio.

Task 1. Set aggregate rules and formatting.


1. In Project Viewer, in the gosales namespace, expand the
ORDER_DETAILS query subject, and then Ctrl+click the
UNIT_COST, UNIT_PRICE, and UNIT_SALE_PRICE query
items.
2. In the Properties pane, in the Regular Aggregate column, select
Average for each of the query items.
3. In the Format column, click the first cell, and then click the ellipsis.
The Data Format dialog box appears.
4. In the Format type box, click Currency, in the Currency row of the
Properties section, select $(USD) – United States of America,
dollar, and then click OK.
5. Repeat steps 3 to 4 for the UNIT_PRICE and
UNIT_SALE_PRICE query items to format the data as currency.
Task 2. Specify attribute usage.
1. In the gosales namespace, expand the SALES_BRANCH query
subject, and then click the CITY query item.
2. In the Properties pane, change the value of the Usage property to
Attribute.
3. Click the CITY_MB query item, and then, in the Properties pane,
change the value of the Usage property to Attribute.

© 2003, Cognos Incorporated 3-27


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 3. Define the default behavior of a prompt control.


Additional Information
1. In the gosales namespace, expand the ORDER_HEADER query This will create a prompt with a calendar
subject. only instead of a calendar and time
selection.
2. Click the ORDER_DATE query item, and then in the Properties
pane, double–click the first column of the +Prompt Info row to
expand it.
3. In the Prompt Type box, click Select Date.
Task 4. Add descriptions and screen tip.
1. In the ORDER_HEADER query subject, click the
ORDER_NUMBER query item.
2. In the Properties pane, in the Description row, type The order
number uniquely identifies each order.
3. In the Screen Tip row, type Order No.
4. Beside Properties, click the Languages link.
Notice that for the Name, Description and Screen Tip properties, Additional Information
you now see one entry for both languages (English and French). You may want to mention that you can also
However, both entries are in English. change the active language to quickly edit
items for the appropriate language.
5. In the ORDER_HEADER query subject, click the
RETAILER_NAME query item.
The description and screen tip are blank for both languages. We
cannot add a French value for either the description or screen tip
until we supply a value for the primary language (English).
6. In the Screen Tip section, in the English box, type Retailer Name.
7. Click the French box.
We can now add a French value, because we have supplied a value
for the primary language.
8. Delete the existing text and then type Nom de Détaillant.
9. In the Screen Tip section, in the English box, type Retailer Name,
and then in the French box, type Nom de Détaillant.
10. Save the model.
Task 5. Re–publish the model and create a report.
1. In the Project Viewer pane, right–click the GO Model package, click
Publish Packages, and then click Publish.
A message appears indicating that a package of the same name
already exists.
2. Click Yes, click OK, and then click Finish.
3. Maximize Cognos Connection, in the top right corner, click Report
Studio, and then click GO Model.

3-28 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

4. Click Create a new report, double click List, and then in the
Insertable Objects pane, expand Database layer, gosales, and
goretailers.
5. Expand SALES_BRANCH, right–click CITY, and then click
Properties.
Notice that the usage of this query item is set to attribute, which is
what we specified in Task 2.
6. Click Close, and then repeat step 5 to view the properties of the
CITY_MB attribute.
Notice that the usage of this query item is also set to attribute, which
is what we specified in Task 2.
7. In gosales, expand ORDER_HEADER, and then double–click
RETAILER_NAME to add it to the report.
8. Expand ORDER_DETAILS, and then double–click
UNIT_COST, UNIT_PRICE, UNIT_SALE_PRICE, and
QUANTITY to add them to the report.
9. Click the UNIT_COST column, and then in the Properties pane,
scroll down to the bottom.
Notice that the value of the Aggregate Function property in the Data
Item section is set to Average, rather than Total. This is due to the
aggregate setting that we specified in Task 1 for UNIT_COST,
UNIT_PRICE, and UNIT_SALE_PRICE.

© 2003, Cognos Incorporated 3-29


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

10. On the toolbar, click Run Report .


The result appears as shown below:

The values in the UNIT_COST, UNIT_PRICE, and


UNIT_SALE_PRICE columns are averaged and formatted as
currency, while the QUANTITY column is totaled and remains
unformatted.
11. Close Report Viewer, and then in the Insertable Objects pane, in
ORDER_HEADER, drag and drop ORDER_DATE before the
RETAILER_NAME column.
12. Click the ORDER_DATE column, and then on the toolbar, click
Build Prompt Page .
A prompt page is built automatically that includes controls for
selecting a specific date range rather than a date and time range. This
is due to the prompt control setting that we specified in Task 2.
Task 6. Create a second report.

1. On the toolbar, click New , and then click No to avoid saving


the previous report.
2. Double–click List to create a new list report, and then in
ORDER_HEADER, double–click ORDER_NUMBER to add it
to the report.

3-30 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

3. In the Insertable Objects pane, in ORDER_HEADER, point to


ORDER_NUMBER.
A screen tip appears, containing the text that we specified in Task 4.
4. In the Insertable Objects pane, right–click ORDER_NUMBER,
and then click Properties.
The description that we specified in Task 4 is shown in the
Description row of the Properties dialog box.
5. Click Close, and then, in ORDER_HEADER, point to
RETAILER_NAME.
A screen tip appears, containing the text that we specified in Task 4.
6. From the File menu, click Model Connection.
The Model Connection dialog box appears.
7. In the Model box, click GO Model, in the Language box, click
French, and then click OK.
A message appears, indicating that the report specification is valid.
8. Click OK.
Notice that the contents of the Insertable Objects pane have changed
to reflect the new language.
9. Expand (fr) Database layer, and then expand (fr) New Additional Information
Namespace. The (fr) prefix indicates we are now in the
French version of the model but we have
10. Expand (fr) ORDER_HEADER, and then point to not yet translated all of our metadata titles
RETAILER_NAME. and properties, hence the (fr) prefix. We
will not translate the entire model but rather
A screen tip appears, containing the French text that we specified in show how to do it through specific
Task 4. examples.
11. Right–click RETAILER_NAME, and then click Properties.
The French description that we specified in Task 4 is shown in the
Description row of the Properties dialog box.
12. Close the Properties dialog box. And then close Report Studio
without saving your changes.
13. Leave Cognos Connection and Framework Manager open for the
next demo.

Result:
We customized some query items in GO Model. For
example, we adjusted the Regular Aggregate property of
certain query items. We then re–published the GO Model
package and viewed the results in Report Studio.

© 2003, Cognos Incorporated 3-31


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 3–3

ƒ Localize Metadata Titles and Properties

3-32 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Demo 3–3: Localize Metadata Titles and Properties

Purpose:
We want to ensure that users working in languages other
than English can easily use the GO Model package to create
reports. To this end, we will enhance our model by
exporting a translation file and modifying this file so that it
contains French and English strings. We will then import
this translation file back into Framework Manager and view
the results. Lastly, we will re–publish the GO Model
package and examine the impact of implementing
multilingual support in Report Studio.

Task 1. Modify query items for multilingual support and


export a CSV file.
1. From the Project menu, point to Languages, and then click Export
Translation File.
The Export Translation File dialog box appears.
2. Ctrl+click English (United States) and French, and then click the Additional Information
arrow to move them to the Languages to be exported column. We can edit the metadata in Framework
Manager, or we can translate the metadata
to a more convenient format, such as CSV
3. Click Browse . or Unicode text. We used the first
technique in the previous demo.
The Export Language Translation File dialog box appears.
4. In the Save as type box, click CSV (comma delimited) (*.csv). When you export language strings to a TXT
or CSV file, you can translate them as
5. Navigate to C:\Edcognos\CR1052, in the File name box, type necessary. A customer may even send this
GO_Application_LOC.csv, and then click Save. file to a translation firm for professional
translation.
6. Click OK.
The TXT or CSV file only contains the
A message appears, indicating that the language strings were strings that exist. If a given item has no
successfully exported. description or screen tip, then no entry will
be created and therefore no translation can
7. Click OK, open Windows Explorer, and then navigate to
be imported. For this reason, you should
C:\Edcognos\CR1052. add descriptions and tool tips to the model
before exporting.

When you import the TXT or CSV file,


Framework Manager needs to know which
locale is the source to translate from and
which locale is the target to translate to.
Framework Manager will match strings in
the target locale throughout the model and
apply the translated strings.

© 2003, Cognos Incorporated 3-33


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

8. Open GO_Application_LOC.csv in Excel, and then expand both


columns.
The result appears as shown below:

Notice that each column represents a given language; in this case,


American English and French.
9. In row 9, change the French value of (fr) CITY to VILLE.
10. In row 11, change the French value of (fr) COMPANY_NAME to
NOM_DE_COMPAGNIE.
11. In row 18, change the French value of (fr) COUNTRY to PAYS.
The result appears as shown below:

12. Save and close the file.

3-34 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Task 2. Import a CSV file that contains translated


strings.
1. In Framework Manager, from the Project menu, point to
Languages, and then click Import Translation File.
The Import Translation File dialog box appears.

2. Click the bottom arrow to add French to the Translate into


box.
3. Click Browse.
The Import Language Translation File dialog box appears.
4. In the Files of type box, click CSV (comma delimited) (*.csv), and
then navigate to C:\Edcognos\CR1052.
5. Click GO_Application_LOC.csv, click Open, and then click OK.
A message appears indicating that the import was successful and the
amount of properties that were updated in the model objects.
6. Click OK.
7. In the Project Viewer pane, ensure that the gosales and goretailers
namespaces are expanded.
8. In the gosales namespace, click COUNTRY, and then in the
Properties pane, click the Languages link if it is not already selected.
The result appears as shown below:

Notice that the French value for the Name property of the
COUNTRY query subject reflects the change that we made to the
translation file.
9. In the gosales namespace, ensure that the SALES_BRANCH query
subject is expanded, and then click the CITY query item.
Notice that the French value for the Name property of the CITY
query item reflects the change that we made to the translation file.
10. In the goretailers namespace, expand the RETAILER query subject,
and then click the COMPANY_NAME query item.
Notice that the French value for the Name property of the
COMPANY_NAME query item reflects the change that we made to
the translation file.
11. Save the model.

© 2003, Cognos Incorporated 3-35


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 3. Re–publish the model and view the results in


Report Studio.
1. In the Project Viewer pane, in Packages, right–click the GO Model
package, and then click Publish Packages.
The Publish wizard opens.
2. Click Publish, click Yes, and then click Finish.
3. Maximize Cognos Connection, open Report Studio, and then click
GO Model.
4. Create a new list report, and then in the Insertable Objects pane,
expand Database layer and gosales.
5. Expand COUNTRY, and then double–click COUNTRY_CODE
to add it to the report.
6. From the File menu, click Model Connection.
The Model Connection dialog box appears.
7. In the Language box, click French, and then click OK.
8. Click OK to close the message that says the report specification is
valid.
9. In the Insertable Objects pane, expand (fr) Database layer, and then
expand (fr) New Namespace and (fr) New Namespace1.
Notice that, in (fr) New Namespace, the name of the COUNTRY
query subject has been changed to PAYS, which is the value that we
imported into GO Model from the translation file.
10. In (fr) New Namespace, expand (fr) SALES_BRANCH.
Notice that the value of the CITY query item has been changed to
VILLE, which is the value that we imported into GO Model from
the translation file.
11. In (fr) New Namespace1, expand (fr) RETAILER.
Notice that the value of the COMPANY_NAME query item has
been changed to NOM DE COMPAGNIE, which is the value that
we imported into GO Model from the translation file.
12. Close Report Studio without saving your changes, and then leave
Framework Manager and Cognos Connection open for the next
demo.

Results:
We enhanced our model by creating a translation file that
contains French and English strings. We then imported this
translation file back into Framework Manager and viewed
the results. Lastly, we re–published the GO Model package
and examined the impact of implementing multilingual
support in Report Studio.

3-36 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Merge Metadata to Create a New Query Subject

ƒ You can reuse existing model metadata to quickly create new query
subjects.
ƒ You can merge the following objects:
ƒ model and data source query subjects
ƒ query items, filters, and calculations
ƒ relationships
ƒ shortcuts
Query Subject Query Subject
A B

Query Subject
A_B

• In addition to creating data source, model, and stored procedure


query subjects, you can merge existing query subjects, query items,
relationships, and even shortcuts to create new query subjects.

• This method is useful to quickly streamline data source query subjects


as you will see in the following demo, as well as quickly create
presentation layer query subjects (model query subjects).

• Framework Manager retains any existing relationships between the


original query subjects and query subjects that are not included in the
merge. However, any relationships that exist between the query
subjects that are being merged are ignored, to avoid self–joins.

© 2003, Cognos Incorporated 3-37


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 3–4

ƒ Merge Metadata to Create a Query Subject

3-38 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Demo 3–4: Merge Metadata to Create a Query Subject

Purpose:
The tables underlying the PRODUCT_MULTILINGUAL and
PRODUCT query subjects have a mandatory one–to–many
relationship: one product may have information stored in
one or more languages. To make report authoring easier,
we will merge the two query subjects into a new query
subject. After making the necessary modifications to this
new query subject, we will re–publish the package and
examine the results in Query Studio.

Task 1. Merge query subjects.


1. Maximize Framework Manager.
2. In the Project Viewer pane, Ctrl+click
PRODUCT_MULTILINGUAL and PRODUCT, right–click,
and then click Merge in New Query Subject.
A new data source query subject called
PRODUCT_MULTILINGUAL_PRODUCT appears at the bottom
of the gosales namespace.
3. Expand PRODUCT_MULTILINGUAL_PRODUCT.
This new query subject contains the query items from both the
PRODUCT and PRODUCT_MULTILINGUAL query subjects.
We can now safely delete the original query subjects that we merged
to create this new query subject.
4. In the Project Viewer pane, Ctrl+click the PRODUCT and
PRODUCT_MULTILINGUAL query subjects, and then on the
toolbar, click Delete .
A message appears, indicating that removing these objects will impact
the objects that directly use them or their children. In particular, four
relationships will be deleted.
5. Click OK, right–click
PRODUCT_MULTILINGUAL_PRODUCT, and then click
Rename.
6. Type PRODUCTS, and then press Enter.
7. If necessary, click Object Diagram to open the object diagram.
8. In the Project Viewer pane, right–click PRODUCTS, and then click
Locate in Object Diagram.

© 2003, Cognos Incorporated 3-39


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

9. Arrange the objects in the diagram so that the result appears as


shown below:

Notice that Framework Manager automatically generated the correct


relationships for this new, merged query subject.
10. Right–click PRODUCTS, and then click Edit Definition.
The Query Subject Definition dialog box appears. Notice that the
SQL statement contains references to PRODUCT_NUMBER and
PRODUCT_NUMBER1. PRODUCT_NUMBER1 is not required;
therefore, we can safely delete this part of the SQL statement.
11. Delete PRODUCT.PRODUCT_NUMBER as
PRODUCT_NUMBER1,.
12. Modify LANGUAGE1 to “LANGUAGE”.
Because LANGUAGE is a reserved word, it should be enclosed in
quotation marks.
13. Click Test.
A message appears indicating that modifying the query subject
definition will impact other objects in the model.

3-40 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

14. Click OK.


The result appears as shown below:

15. Click OK, and then save the model.


Task 2. Re–publish the package and view the results in
Query Studio.
1. Right–click the GO Model package, and then click Publish
Packages.
The Publish wizard opens.
2. Click Publish, click Yes, and then click Finish.
3. Maximize Cognos Connection, open Query Studio, and then click
GO Model.
4. In the left pane, expand Database layer and gosales.
Notice that the merged query subject called PRODUCTS is included
in the list of available query subjects.

© 2003, Cognos Incorporated 3-41


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

5. Double–click PRODUCTS to add all of its query items to the


report.
Notice that the query items in the PRODUCTS query subject reflect
the changes that we made in Framework Manager. PRODUCTS
includes a query item called LANGUAGE and a query item called
PRODUCT_NUMBER.
6. Close Query Studio without saving changes, and then leave Cognos
Connection and Framework Manager open for the next demo.

Result:
To make report authoring easier, we merged two query
subjects into a new query subject. After making the
necessary modifications to this new query subject, we re–
published the package and examined the results in Query
Studio.

3-42 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Create a Stored Procedure Query Subject

ƒ Stored procedures return result sets based on simple to complex


queries.
ƒ Framework Manager can leverage the stored procedure by generating
a query subject that reflects the returned result set.
ƒ Stored procedure query subjects must:
ƒ return a single uniform result set
ƒ not have an overloaded signature
ƒ You must test the stored procedure query subject after you create it
in order to generate the projected query items.

• If a stored procedure returns multiple result sets, Framework


Manager only supports the first result set.

• Some data source systems allow for multiple stored procedures with
the same name but each accepts a different number and/or type of
arguments. The number and type of arguments passed will determine
which stored procedure is used. This is known as an overloaded
signature and is not supported by Framework Manager.

• To work around these restrictions, you can create multiple stored


procedures, each with a unique name, and create a separate query
subject for each result set or signature.

© 2003, Cognos Incorporated 3-43


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 3–5

ƒ Create a Stored Procedure Query Subject

3-44 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Demo 3–5: Create a Stored Procedure Query Subject

Purpose:
We currently have a stored procedure in the GOSL database
that returns data regarding orders made in 2001. We want to
use this stored procedure in our model and package, so
that report authors can access it from Query Studio or
Report Studio. To this end, we will create a stored
procedure query subject in the gosales namespace. We will
then re–publish the GO Model package and use this query
subject in Query Studio.

Task 1. Examine the stored procedure in SQL Server.


1. From the Start menu, point to Programs\Microsoft SQL Server,
and then click Enterprise Manager.
Enterprise Manager opens.
2. Expand Microsoft SQL Servers, SQL Server Group, and
<<servername>>.
3. Expand Databases and GOSL, and then click Stored Procedures.
The stored procedures for this database are shown in the right
column.
4. Right–click Orders_for_2001, and then click Properties.
The Stored Procedure Properties dialog box appears as shown below:

5. Click OK, and then close Enterprise Manager.


Task. 2. Create the stored procedure query subject
1. In Framework Manager, right–click the gosales namespace, point to
Create, and then click Query Subject.
The New Query Subject wizard opens.
2. In the Name box, type ORDERS_FOR_2001, select Stored
Procedure, and then click Next.
3. Click GOSL, and then click Next.

© 2003, Cognos Incorporated 3-45


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

4. Expand GOSL, dbo, and Procedures, click Orders_for_2001, and


then click Finish.
The Edit Definition – Stored Procedure dialog box appears.
5. Click Test.
The Test Result section shows all of the orders made during 2001.
The result appears as shown below:

6. Click OK to close the Edit Definition – Stored Procedure dialog box.


7. Check and modify the Usage and Regular Aggregate properties, as Instructional Tips
required, for the newly created query items. Ask the students what they think the
settings should be.
8. Save the model.
They can use the Order Details and Order
Task 3. Re–publish the model and view the results in Header query subjects as a guideline for
Query Studio. these property settings.

1. Publish the GO Model package.


2. Maximize Cognos Connection, open Query Studio, and then click
GO Model.
3. Expand Database Layer and gosales.
The ORDERS_FOR_2001 stored procedure query subject can be
seen.

3-46 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

4. Expand ORDERS_FOR_2001.
This query subject contains four query items.
5. Double–click ORDERS_FOR_2001.
The report runs and returns data regarding orders made in 2001. The
result appears as shown below:

6. Close Query Studio without saving changes, and then leave Cognos
Connection and Framework Manager open for the next demo.

Result:
We created a stored procedure query subject in the gosales
namespace. We then re–published the GO Model package
and used this query subject in Query Studio.

© 2003, Cognos Incorporated 3-47


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Reference User–Defined Functions

ƒ User–defined functions return a single value per request (per row).


ƒ User–defined functions can be referenced in the SQL of the query
subject definition.
select
ORDER_DETAILS.ORDER_DETAIL_CODE,
ORDER_DETAILS.ORDER_NUMBER,
ORDER_DETAILS.PRODUCT_NUMBER,
ORDER_DETAILS.QUANTITY,
ORDER_DETAILS.UNIT_COST,
ORDER_DETAILS.UNIT_PRICE,
ORDER_DETAILS.UNIT_SALE_PRICE,
dbo.Calc_Actual_Revenue(ORDER_DETAILS.QUANTITY,ORDER_DETAILS.UNIT_SALE_PRICE)
as “Actual Revenue”

from
[GOSL].ORDER_DETAILS

User–Defined Function Reference

Additional Information
• The example in the slide shows a SQL statement from the
The reference to the Calc_Actual_Revenue
ORDER_DETAILS query subject. This SQL statement includes a function will be represented as a query item
reference to the Calc_Actual_Revenue function in the data source (as called ACTUAL_REVENUE within the
seen below). query subject and will return a value for
each row of data as calculated by the
CREATE FUNCTION Calc_Actual_Revenue (@Quantity int, function.
@Sale_Price decimal(6,2))
Depending on how you write your SQL to
reference the function you may need to
RETURNS decimal(6,2) AS adjust your SQL Settings in the query
subject’s Options dialog box.
BEGIN

return @Quantity * @Sale_Price

END

• This function is passed two values, the QUANTITY and


UNIT_SALE_PRICE values.

3-48 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Demo 3–6

ƒ Reference a Database User–Defined


Function in a Query Subject

© 2003, Cognos Incorporated 3-49


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 3–6: Reference a Database User–Defined


Function in a Query Subject

Purpose:
We currently have a user–defined function in the GOSL
database that returns the actual revenue generated by each
order. Report authors require this calculation for their
reports. We will add a new query item to the
ORDER_DETAILS query subject that references this user–
defined function instead of recreating this calculation in our
model. We will then re–publish the GO Model package and
use this query subject in Query Studio.

Task 1. Examine the user–defined function in SQL


Server.
1. From the Start menu, point to Programs\Microsoft SQL Server,
and then click Enterprise Manager.
Enterprise Manager opens.
2. Expand Microsoft SQL Servers, SQL Server Group, and
<<servername>>.
3. Expand Databases and GOSL, and then click User Defined
Functions.
4. Right–click Calc_Actual_Revenue, and then click Properties.
The User–defined Function Properties dialog box appears as shown
below:

5. Click OK, and then close Enterprise Manager.

3-50 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Task. 2. Reference the user–defined function within the


ORDER_DETAILS query subject.
1. In the gosales namespace, right–click ORDER_DETAILS, and
then click Edit Definition.
The Query Subject Definition dialog box appears.
2. Delete the text on the SQL tab, and then in the Available database
objects pane, expand GOSL, GOSL, dbo, Tables, and
ORDER_DETAILS.
3. Double–click each of the columns in ORDER_DETAILS to add
them to the SQL statement.
4. After the last column in the SELECT statement, type a comma, and
then just above the FROM clause, type
dbo.Calc_Actual_Revenue(ORDER_DETAILS.QUANTITY,
ORDER_DETAILS.UNIT_SALE_PRICE) as "Actual
Revenue"
5. Click Test, and then in the Test Result section, scroll to the right.
The result appears as shown below:

6. Click OK, and then save the model.

© 2003, Cognos Incorporated 3-51


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 3. Re–publish the package and view the results in


Query Studio.
1. Publish the GO Model package.
2. Maximize Cognos Connection, open Query Studio, and then click
GO Model.
3. Expand Database layer, gosales, and ORDER_DETAILS.
The Actual Revenue query item is visible.
4. Double–click ORDER_DETAILS to add it to the report.
The result appears as shown below:

5. Close Query Studio without saving changes, and then leave


Framework Manager and Cognos Connection open for the next
demo.

Result:
We added a new query item to the ORDER_DETAILS query
subject by referencing a user–defined function in the GOSL
database. We then re–published the GO Model package and
used this query subject in Query Studio.

3-52 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Create Calculations

ƒ Create calculations to provide report authors values that they


regularly use. Planned Revenue Calculation

ƒ Calculations can use:


[gosales].[ORDER_DETAILS].[QUANTITY]

ƒ query items
*

ƒ parameters Operator
[gosales].[ORDER_DETAILS].[UNIT_SALE_PRICE]

ƒ functions
Query Items
ƒ There are two types of calculations:
ƒ embedded
ƒ stand–alone

Additional Information
• If you want to use a calculation with only one query subject, you can In the previous demo, we used a user-
create an embedded calculation while modifying a data source query defined function in the data source to
subject or model query subject. calculate the ACTUAL_REVENUE value
for us. We can also use calculations in
• Create stand–alone calculations when you want to use reuse the Framework Manager to achieve the same
type of result. In this case, we are
expression by doing any of the following: calculating planned revenue.

• apply it to one or more query subjects to provide calculated data If you start with an embedded calculation,
to a report you can later convert it into a stand-alone
expression that you can apply to other
query subjects.
• include it in a package to make it available to your report authors

• move it, or a shortcut to it, into a folder to further organize your


model objects

© 2003, Cognos Incorporated 3-53


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 3–7

ƒ Create Calculations

3-54 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Demo 3–7: Create Calculations

Purpose:
Report authors want to be able to include the gross profit
and margin of each order in their reports. To this end, we
will create two calculations within the ORDER_DETAILS
query subject. This will produce two new query items. We
will then re–publish the GO Model package and view the
new query items in Query Studio.

Task 1. Create the GROSS_PROFIT calculation.


1. In Framework Manager, in the gosales namespace, right–click
ORDER_DETAILS, and then click Edit Definition.
The Query Subject Definition dialog box appears.
2. Click the Model Objects tab, and then click Insert New
Calculation .
The Calculation Definition window opens.
3. In the Name box, delete Calculation and then type
GROSS_PROFIT.
4. In the Available Components pane, expand GO Model, Database
layer, and gosales.
5. Expand ORDER_DETAILS, and then double–click
UNIT_SALE_PRICE.
6. Click the Functions tab, expand Operators, and then double–click
the minus operator .
7. Click the Model tab, and then below ORDER_DETAILS, double–
click UNIT_COST.

© 2003, Cognos Incorporated 3-55


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

8. Click Test Sample .


The result appears as shown below:

9. Click OK.
Task 2. Create the MARGIN calculation.
1. Click Insert New Calculation.
The Calculation Definition window opens.
2. In the Name box, change the name to MARGIN.
3. In the Available Components pane, click the Functions tab, expand
Operators, and then double–click the left bracket .
4. Click the Model tab, and then expand GO Model, Database layer,
gosales, and ORDER_DETAILS.
5. Double–click UNIT_SALE_PRICE, and then click the Functions
tab.
6. Double–click the minus operator, click the Model tab, and then in
ORDER_DETAILS, double–click UNIT_COST.
7. Click the Functions tab, double–click the right bracket , and
then double–click the division operator .
8. Click the Model tab, and then in ORDER_DETAILS, double–click
UNIT_SALE_PRICE.

3-56 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

9. Click Test Sample.


The result appears as shown below:

10. Click OK, and then click OK again


11. Set the Regular Aggregate property to Average for the new Margin
query item and then save the model.
Task 3. Re–publish the package, and then view the
calculations in Query Studio.
1. Publish the GO Model package.
2. In Cognos Connection, open Query Studio, GO Model.
3. Expand Database layer, gosales, and ORDER_DETAILS.
The GROSS_PROFIT and MARGIN calculated query items are
displayed.

© 2003, Cognos Incorporated 3-57


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

4. In ORDER_DETAILS, double–click ORDER_NUMBER,


GROSS_PROFIT, and MARGIN.
The results appear as shown below:

5. Close Query Studio without saving changes, and then leave Cognos
Connection and Framework Manager open for the next demo.

Results:
We created two calculations within the ORDER_DETAILS
query subject to produce two new query items;
GROSS_PROFIT and MARGIN. We then re–published the
GO Model package and viewed the new query items in
Query Studio.

3-58 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Examine Parameter Maps

ƒ Parameter maps are similar to data source look–up tables.


ƒ They substitute a passed parameter with a value understood by your
application.
ƒ Each parameter map consists of two columns:
ƒ key (must be unique) Key Column Value Column

ƒ value (used for substitution)


cs CS
cs–cz CS
da DA
da–dk DA
de DE
de–at DE
de–ch DE

Tab–Delimited Parameter Map File

Additional Information
• You can use parameters to create conditional query subjects that Parameter maps can only be used within a
macro.
allow for substitutions at report run time.
The tab-delimited parameter map file
• A parameter map is a second layer of substitution that ensures your shown in the slide example would be used
application receives a value it can understand. to handle multilingual data.

• The key column represents the parameter that is passed to the model. The Key Column is a session parameter
called runLocale, which indicates the users
All parameter map keys must be unique so that Framework Manager current language setting.
can consistently retrieve the correct value.
The Value Column is the language code,
• The value column represents the value that is to be substituted for which is used in the database in either the
use with your application. column titles or in the data itself.

This will be illustrated in the following


• Keys and values can be manually entered, imported from a file, or demo.
based on existing query items in the model.

© 2003, Cognos Incorporated 3-59


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Examine Session Parameters

ƒ A session parameter is a variable, such as userName or a runLocale,


that Framework Manager associates with a session.
ƒ Use session parameters to filter your data.

Additional Information
• You can use a session parameter to affect your query result set. For
Currently adding new session parameters
example, in a multilingual model, you would use the runLocale is beneficial for testing purposes. For
session parameter to determine the language in which the data should example, you could create a session
be returned. parameter called Database with a value
that represents your test database. Create
• You can define an override value to test the results that value returns. a macro for your Content Manager Data
Source property in place of the hard coded
value generated when creating your data
• The override value is valid only while you have the model open, and source. Now you can change the session
is not saved when you save the model. If no override value exists, parameter value from your test database to
Framework Manager uses the default value when it executes a query your production database to test your
that contains a session parameter. model in either environment.

3-60 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Create a Macro

ƒ Macros are fragments of code that you can insert within definitions
and properties of model objects.
ƒ A macro can contain references to:
ƒ parameter maps and parameter map entries
ƒ session parameters
ƒ Parameter values in a macro are populated when a query is executed.
Macro

Select
PRODUCT_LINE.PRODUCT_LINE_CODE,
PRODUCT_LINE.PRODUCT_LINE_#$[Locale Map]{$runLocale}# as Product_Line
from
[GO Sales.GO Sales.dbo].PRODUCT_LINE

Reference to Parameter Map Reference to Session Parameter

Additional Information
• The macro in the slide example is used to determine the user’s
Macros can be used in query subject
language locale and then substitute it for a language code that is used definitions, calculations, filters and certain
in the data source. model object properties such as the
Catalog property of a Data Source object.
• The reference to the parameter map has the following syntax:
Do not insert macros between existing
$[Locale Map]{}. quotation marks or square brackets
because Framework Manager does not
execute anything within these elements.
This expression will accept another parameter between its
parentheses (in this case $runLocale), which will be used to look up
the appropriate value, to be used by the application, in the parameter
map.

• The resulting expression is illustrated in the slide example and is


enclosed by the # character.

© 2003, Cognos Incorporated 3-61


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 3–8

ƒ Create a Macro Using a Parameter Map


and a Session Parameter

3-62 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Demo 3–8: Create a Macro Using a Parameter Map


and a Session Parameter

Purpose:
We want report authors to be able to view their report data
in the language that they prefer. To this end, we will create a
parameter map that specifies the appropriate mappings
between different language codes. We will then modify the
COUNTRY_MULTILINGUAL query subject to include a
macro that references this parameter map. Lastly, we will
re–publish the GO Model package and view the results in
Query Studio.

Task 1. Create a parameter map.


1. In the Project Viewer of Framework Manager, right–click Parameter
Maps, point to Create, and then click Parameter_Map.
The Create Parameter Map wizard opens.
2. In the Name box, type Locale Map, and then click Next.
3. Click Import File.
The Select File to Import dialog box appears.

4. Click Browse .
The Select File to Import dialog box appears.
5. Navigate to C:\Edcognos\CR1052, click Run Locale Map, and
then click Open.
6. Click OK, and then click Finish.
Task 2. Add a macro to the COUNTRY_MULTILINGUAL
query subject definition, and then modify a
relationship.
Note: In the GOSL database, the COUNTRY_MULTILINGUAL table
contains a different row for each language. The LANGUAGE
column indicates the language in which the modeler is currently
working (for example, EN for English). In this task, we want to build
a filter in the form of LANGUAGE='a', where 'a' represents the
language code (EN for English, FR for French, and so forth) in
which the modeler is currently working.
1. In the gosales namespace, right–click
COUNTRY_MULTILINGUAL, and then click Edit Definition.
The Query Subject Definition dialog box appears.

© 2003, Cognos Incorporated 3-63


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

2. Edit the SQL to read:


Select * from [GOSL].COUNTRY_MULTILINGUAL
Where COUNTRY_MULTILINGUAL."LANGUAGE" =
3. Place the cursor at the end of the last line of SQL, and then on the
toolbar, click Insert Macro .
The Macro Editor dialog box appears.
4. In the Available Components pane, expand Parameter Maps, and
then double–click Locale Map to add it to the macro.
5. Expand Session Parameters, and then drag and drop runLocale
between the {} brackets.
6. Delete the white space after {runLocale}, and then on the toolbar,
click Enclose in single quote .
The result appears as shown below:

3-64 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

7. Click OK, and then click Test.


The result appears as shown below:

8. Click OK, and then, if necessary, open the Object Diagram View.
We can now modify the relationship between the COUNTRY and
COUNTRY_MULTILINGUAL query subjects to reflect the
condition that we have specified. We want to associate each country
to a specific language.
9. Right–click COUNTRY_MULTILINGUAL, and then click
Locate in Object Diagram.
COUNTRY_MULTILINGUAL is highlighted in the Object
Diagram View.
10. Double–click the relationship between the
COUNTRY_MULTILINGUAL and COUNTRY query
subjects.
The Relationship Definition dialog box appears.

© 2003, Cognos Incorporated 3-65


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

11. Modify the relationship so that it appears as shown below:

12. Click OK.


Task 3. Test the runLocale parameter in Framework
Manager.
Note: The runLocale parameter was set when we logged into Framework
Manager. The value of the runLocale parameter is currently set to
English (United States). We can override the value of the session
parameters for testing purposes. Overriding these parameters will not
affect run–time use of any published packages.
1. From the Projects menu, click Session Parameters.
The Session Parameters dialog box appears.
2. Click the runLocale row, and then click Edit.
3. In the Override Value box, type fr, and then click OK.
4. In the gosales namespace, double–click
COUNTRY_MULTILINGUAL, and then click Test.
Because we have overridden the value of the runLocale parameter
(specifying French), the value supplied to the macro has changed. All
of the values returned by the COUNTRY_MULTILINGUAL query
subject are displayed in French, and the values in the LANGUAGE
column are FR, rather than EN.
5. Click Cancel.

3-66 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

6. From the Project menu, click Session Parameters, and then click
the runLocale row.
7. Click Clear Override, click OK, and then save the model.
Task 4. Re–publish the package and view the results in
Report Studio.
1. Publish the GO Model package.
2. In Cognos Connection, click Preferences, in the Content language
section, select Use the following language, and then in the Use the
following language box, click French.
3. Click OK, open Query Studio, and then click (fr) GO Model.
4. Expand (fr) Database layer and (fr) New Namespace, and then
double–click (fr) COUNTRY_MULTILINGUAL.
Because we have changed the content language setting, the data in the
report is translated into French. The result appears as shown below:

5. Save the report as Demo 3–8 in the default location (GO Model
folder), click Return, and then in Cognos Connection, click
Preferences.
6. In the Content language section, select Use the default language,
and then click OK.
7. Leave Cognos Connection and Framework Manager open for the
upcoming workshop.

Result:
We created a parameter map that specifies the appropriate
mappings between different language codes. We then
modified the COUNTRY_MULTILINGUAL query subject to
include a macro that references this parameter map. Lastly,
we re–published the GO Model package and viewed the
results in Query Studio.

© 2003, Cognos Incorporated 3-67


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Summary

ƒ In this module, we have:


ƒ examined Limited Local versus Database Only processing
ƒ verified, modified, and created relationships between query
subjects
ƒ verified and modified query item properties
ƒ created and tested new query subjects
ƒ created calculations
ƒ created macros using parameter maps and session parameters

3-68 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Workshop 3–1

ƒ Create Additional Relationships and


Merge Query Subjects

© 2003, Cognos Incorporated 3-69


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 3–1: Create Additional Relationships and


Merge Query Subjects
Business analysts at The Great Outdoors Company want to create reports on
the various retailers with which they do business, such as ActiForme and
Bellini. In particular, they want to see which retailer sites are currently active.
To make it possible to build this type of report, create a relationship between
the RETAILER_SITE and ACTIVE_INDICATOR_LOOKUP query
subjects in the GO Model.

Business analysts also want to create reports that contain demographic


information, such as the number of male and female employees that work for
each retailer. To make it possible to build this type of report, create a
relationship between the GENDER_LOOKUP and CONTACT query
subjects in the GO Model.

Management wants to create reports that include information about the


various countries in which The Great Outdoors Company does business. To
make this process easier, combine the metadata in the COUNTRY and
COUNTRY_MULTILINGUAL query subjects.

To accomplish this:

• In the goretailers namespace, create a mandatory, one–to–many


relationship between the RETAILER_SITE and
ACTIVE_INDICATOR_LOOKUP query subjects. Each instance
of ACTIVE_INDICATOR_LOOKUP can reference one or more
instances of RETAILER_SITE. Each instance of RETAILER_SITE
can reference one and only one instance of
ACTIVE_INDICATOR_LOOKUP.

• In the goretailers namespace, create a mandatory, one–to–many


relationship between the GENDER_LOOKUP and CONTACT
query subjects. Each instance of GENDER_LOOKUP can
reference one or more instances of CONTACT. Each instance of
CONTACT can reference one and only one instance of
GENDER_LOOKUP.

• In the gosales namespace, merge the metadata from the COUNTRY


and COUNTRY_MULTILINGUAL query subjects. Delete the
original query subjects and rename the new query subject from
COUNTRY_COUNTRY_MULTILINGUAL to COUNTRY.
Modify the SQL as necessary.

3-70 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

• Re–insert the macro that was created in Demo 3–8, “Create a Macro
Using a Parameter Map and a Session Parameter,” into the query
subject definition. The macro formula is #sq($[Locale
Map]{$runLocale})#. Change the active language of the project to
German and view the results. Then change the active language back
to English (United States).

• Republish the GO Model package, and then create a Query Studio


report that contains data from the new COUNTRY query subject.
Save this report as Wkshp 3–1a.

• Create a Query Studio report that includes data on retailer sites. Add
a filter to include active and inactive retailer sites. Save this report as
Wkshp 3–1b. Create a third Query Studio report that includes
customer contact data. Add a filter that retrieves only female
employees. Save this report as Wkshp 3–1c.

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.

© 2003, Cognos Incorporated 3-71


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 3–1: Task Table


Task Where to Work Hints
1. Create a relationship goretailers namespace • Use the
between ACTIVE_INDICATOR
RETAILER_SITE and Object Diagram View query item from both query
ACTIVE_INDICATOR_ subjects.
LOOKUP. Relationship Definition
dialog box • Cardinality on
RETAILER_SITE side is
1..n.

• Cardinality on
ACTIVE_INDICATOR_
LOOKUP is 1..1.

• Change the usage of both


ACTIVE_INDICATOR
query items to Attribute.

2. Create a relationship goretailers namespace • Use the GENDER_CODE


between query item from both query
GENDER_LOOKUP Object Diagram View subjects.
and CONTACT.
Relationship Definition • Cardinality on the
dialog box GENDER_LOOKUP side
is 1..1.

• Cardinality on the
CONTACT side is 1..n.

• Change the usage of both


GENDER_CODE query
items to Attribute.

3-72 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Task Where to Work Hints


3. Merge metadata from two gosales namespace • Select both COUNTRY and
query subjects. COUNTRY_
Object Diagram View MULTILINGUAL, then
select Merge in New Query
Query Subject Definition Subject.
dialog box
• Delete the original
COUNTRY and
COUNTRY_
MULTILINGUAL query
subjects.

• Rename the new query


subject as COUNTRY.

• Edit the SQL for the new


query subject to appear as
shown below:
select

COUNTRY.COUNTRY_CODE as
COUNTRY_CODE,
COUNTRY.ISO_THREE_LETTER_
CODE as ISO_THREE_LETTER_CODE,
COUNTRY.ISO_TWO_LETTER_CODE as
ISO_TWO_LETTER_CODE,

COUNTRY.ISO_THREE_DIGIT_CODE
as ISO_THREE_DIGIT_CODE,
COUNTRY.EURO_IN_USE_SINCE as
EURO_IN_USE_SINCE,

COUNTRY_MULTILINGUAL.COUNTRY
as COUNTRY,
COUNTRY_MULTILINGUAL.
"LANGUAGE" as "LANGUAGE",

COUNTRY_MULTILINGUAL.
CURRENCY_NAME as CURRENCY_NAME

from
[GOSL].COUNTRY COUNTRY,
(select * from
[GOSL].COUNTRY_MULTILINGUAL
where COUNTRY_MULTILINGUAL.
"LANGUAGE" = 'EN')

COUNTRY_MULTILINGUAL
where
(COUNTRY.COUNTRY_CODE =
COUNTRY_MULTILINGUAL.
COUNTRY_CODE)

© 2003, Cognos Incorporated 3-73


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task Where to Work Hints


4. Re–insert the macro from Query Subject Definition • Replace "EN" in the from
Demo 3–8, “Create a dialog box clause with #sq($[Locale
Macro Using a Parameter Map]{$runLocale})#.
Map and a Session Define Languages dialog
Parameter.” box • Project/Language/Define
Languages
• Set the active language to
German, then test the (de)
COUNTRY_(de)
COUNTRY_
MULTILINGUAL query
subject.
• Change the active language
back to English.

5. Re–publish the package Cognos Connection • Create a report with all the
and view the merged query items in the Country
query subject in Query Query Studio query subject, and save it as
Studio. Wkshp 3–1a.

6. Create reports that use the Cognos Connection • Create a report with
new relationships. RETAILER_SITE_CODE,
Query Studio ADDRESS1, CITY,
COUNTRY_CODE,
DESCRIPTION.
• Create a filter to show
“Active” and “Inactive”
retailer sites.
• Save the report as Wkshp 3–
1b.
• Create a report with
FIRST_NAME,
LAST_NAME,
JOB_POSITION_EN, and
GENDER.
• Create a filter that displays
female employees only.
• Save the report as Wkshp 3–
1c.

If you need more information to complete a task, see the Step–by–Step


instructions for this exercise in Appendix A.

3-74 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Workshop 3–1: Workshop Results


When completed, Wkshp 3–1a appears as shown below:

When completed, Wkshp 3–1b appears as shown below:

© 2003, Cognos Incorporated 3-75


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

When completed, Wkshp 3–1c appears as shown below:

3-76 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Workshop 3–2

ƒ Create Calculations and Set Query


Item Properties

© 2003, Cognos Incorporated 3-77


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 3–2: Create Calculations and Set Query


Item Properties
Business analysts at The Great Outdoors Company want to create reports
that show the anticipated revenue generated by each product, as well as the
total cost of each product. Create two calculations in the
ORDER_DETAILS query subject to provide this data.

You also need to change the usage of some query items from Identifier to
Attribute, as well as change the aggregation type of the
PRODUCTION_COST and MARGIN query items from Sum to Average.

To accomplish this:

• Create a calculation called PLANNED_REVENUE in the


ORDER_DETAILS query subject. Add a formula that multiplies
QUANTITY by UNIT_PRICE.

• Create a calculation called PRODUCT_COST in the


ORDER_DETAILS query subject. Add a formula that multiplies
QUANTITY by UNIT_COST.

• Change the usage of the following query items from Identifier to


Attribute:

• gosales namespace:

• ORDER_METHOD. ORDER_METHOD_EN
PRODUCTS.PRODUCT_NAME
PRODUCTS.INTRODUCTION_DATE
RETURNED_ITEM.RETURN_DATE
RETURN_REASON. REASON_DESCRIPTION_EN
PRODUCT_FORECAST.YEAR
PRODUCT_FORECAST.MONTH
SALES_STAFF.FIRST_NAME
SALES_STAFF.LAST_NAME
SALES_STAFF.POSITION_EN

• goretailers namespace:

• RETAILER.COMPANY_NAME
RETAILER_SITE.CITY
RETAILER_TYPE. TYPE_NAME_EN
SALES_TERRITORY. TERRITORY_NAME_EN
COUNTRY.COUNTRY_EN
CONTACT.FIRST_NAME
CONTACT.LAST_NAME
CONTACT. JOB_POSITION_EN

3-78 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

• In the gosales namespace, in the PRODUCTS query subject, change


the value of the Regular Aggregate property of the
PRODUCTION_COST and MARGIN query items from Sum to
Average.

• Republish the GO Model, and then create a Report Studio report


that includes the PRODUCT_NUMBER,
PLANNED_REVENUE, and PRODUCT_COST query items.
Save the report as Wkshp 3–2a. Create a Query Studio report that
includes the PRODUCT_NUMBER, PRODUCTION_COST, and
MARGIN query items (all from the PRODUCTS query subject).
Summarize the PRODUCTION_COST and MARGIN columns.
Save the report as Wkshp 3–2b.

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.

© 2003, Cognos Incorporated 3-79


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 3–2: Task Table


Task Where to Work Hints
1. Create the ORDER_DETAILS query • Create the formula as
PLANNED_REVENUE subject [gosales].[ORDER_DETAILS].[Q
UANTITY] *
calculation. Calculation Definition [gosales].[ORDER_DETAILS].[U
NIT_PRICE]
window
2. Create the ORDER DETAILS query • Create the formula as
PRODUCT_COST subject [gosales].[ORDER_DETAILS].[Q
UANTITY] *
calculation. Calculation Definition [gosales].[ORDER_DETAILS].[U
NIT_COST]
window
3. Set the usage property for Properties pane • Set the usage to Attribute for
query items. the appropriate query items in
the gosales and goretailers
namespaces.

4. Change the aggregation Properties pane • In the gosales namespace,


type for query items. change the value of the Regular
Aggregate property for the
PRODUCTION_COST and
MARGIN query items to
Average.

5. Re–publish the package Cognos Connection • Create a report in Report


and view the results in Report Studio Studio with
Report Studio. PRODUCT_NUMBER,
Query Studio PLANNED_REVENUE, and
PRODUCT_COST.
• Save the report as Wkshp 3–2a.
• Create a report in Query Studio
with PRODUCT_NUMBER,
PRODUCTION_COST, and
MARGIN.
• Summarize
PRODUCTION_COST and
MARGIN.
• Save the report as
Wkshp 3–2b.

If you need more information to complete a task, see the Step–by–Step


instructions for this exercise in Appendix A.

3-80 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Workshop 3–2: Workshop Results


When completed, Wkshp 3–2a appears as shown below:

When completed, Wkshp 3–2b appears as shown below:

© 2003, Cognos Incorporated 3-81


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

3-82 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Workshop 3–3

ƒ Create Macros Using a Parameter


Map and a Session Parameter

© 2003, Cognos Incorporated 3-83


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 3–3: Create Macros Using a Parameter


Map and a Session Parameter
When creating reports, business analysts at The Great Outdoors Company
want to be able to view product line data in multiple languages. To make this
process easier, add a macro to the PRODUCT_LINE query subject that
references the Locale Map parameter map that you created in Demo 3–8.

To accomplish this:

• Modify the SQL of the PRODUCT_LINE query subject to select


the PRODUCT_LINE_CODE and PRODUCT_LINE_EN
columns. Create a macro that includes the Locale Map parameter
map and the runLocale session parameter. In the SQL statement,
replace the EN portion of the PRODUCT_LINE_EN column with
the macro. Test the modified PRODUCT_LINE query subject.

• Override the runLocale parameter by providing a value of fr (for


French). Test the PRODUCT_LINE query subject again to view the
translated values.

• Republish the GO Model package. In the Preferences section of


Cognos Connection, change the content language to French. Create a
Report Studio report that includes (fr) PRODUCT_LINE_CODE
and (fr) PRODUCT_LINE. Save the report as Wkshp 3–3.

For more detailed information outlined as tasks, see the Task Table on the
next page.

For the final query results, see the Workshop Results section that follows the
Task Table.

3-84 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE METADATA

Workshop 3–3: Task Table


Task Where to Work Hints
1. Add a macro to the PRODUCT_LINE query • Change the SQL to read:
Select
PRODUCT_LINE query subject PRODUCT_LINE.PRODUCT_LINE
subject definition. _CODE,
PRODUCT_LINE.PRODUCT
Query Subject Definition _LINE_EN
dialog box AS PRODUCT_LINE
from [GOSL].PRODUCT_LINE

Macro Editor • Specify the macro formula


as:
#$[Locale
Map].{runLocale]#

• Delete EN from the second


column in the SQL
statement, and then insert
the macro.

2. Test the runLocale Session Parameters dialog • Change the value of the
parameter in Framework box runLocale parameter to fr.
Manager.

3. Re–publish the package Cognos Connection • In Preferences, change the


and view the results in content language to French.
Report Studio. Report Studio
• Create a report with (fr)
PRODUCT_LINE_CODE
and (fr) PRODUCT_LINE.

• Save the report as


Wkshp 3–3.

If you need more information to complete a task, see the Step–by–Step


instructions for this exercise in Appendix A.

© 2003, Cognos Incorporated 3-85


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 3–3: Workshop Results


After testing the runLocale parameter in Framework Manager, the result
appears as shown below:

After completing Wkshp 3–3, the result appears as shown below:

3-86 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
4

1. Introduction to Framework Manager


2. Design and Create a Project
3. Prepare the Metadata
4. Prepare the Business View
5. Manage Packages
6. Set Security in Framework Manager
7. Manage Projects
8. Use Advanced Modeling Techniques

Cognos ReportNet – Metadata Modeling


COGNOS REPORTNET – METADATA MODELING

4-2 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

Objectives

ƒ In this module, we will:


ƒ add a presentation layer to our model
ƒ create stand–alone and embedded filters
ƒ use a prompt value to refine a query

Additional Information
Students will use the GO Model Module 3
model supplied on the Student CD from
this point on to ensure everyone is at the
same starting point and is using a model
that has all multilingual issues resolved as
well as consistent naming conventions.

© 2003, Cognos Incorporated 4-3


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Framework Manager Workflow

Data
Sources

Import

Design/Create Prepare the Prepare the


Project Metadata Business View

• Prepare the business view – add business value specific to reporting


requirements.

4-4 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

Create a Presentation Layer

ƒ The recommended model structure involves a physical layer and a


presentation layer.
ƒ The presentation layer provides report authors with a meaningful
view of the metadata.

Presentation Layer

Physical Layer

Additional Information
• You can structure projects in many ways in Framework Manager.
Several packages can be created and
There are some best practices for structuring your Framework published based on the presentation layer,
Manager projects to minimize complexity for report authors and to each one providing a different view of
assist in model maintenance. metadata for different reporting needs.

• The basic structure recommended is a two–layer model consisting of Where appropriate, create calculations,
filters, and other modifications in the
a physical layer (database layer) comprised of data source and stored physical layer to maximize reuse in the
procedure query subjects, and a presentation layer comprised of presentation layer.
shortcuts and model query subjects.

• The two–layer model works well for both report authors and data
modelers. The presentation layer makes it easier for report authors to
find and understand their data, while the physical layer acts as the
foundation for the presentation layer.

• Generally, the physical layer will be hidden from the report author.

© 2003, Cognos Incorporated 4-5


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Create Model Query Subjects

ƒ Model query subjects reuse query items from data source query
subjects and other model query subjects.
ƒ They are useful in creating meaningful views of the metadata to the
report author.
ƒ Model query subjects allow for further customization of the metadata
to meet specific requirements without affecting the underlying query
subject.

Data Source Query Subjects Used to Model Query Subject


Create Model Query Subject

Additional Information
• Model query subjects contain SQL statements that do not directly
Model queries can only read and test the
reference a data source. Rather, they use metadata already in the underlying query subjects that they
model, such as query items that exist in other query subjects. reference. If you edit the SQL of a model
query subject, it becomes a data source
• Because model query subjects are based on the metadata in your query subject whose SQL corresponds to
model, they let you: the data source query upon which it is
based.
• reuse complex SQL statements that exist in the model

• reference objects from different data sources in the same query


subject

• Once a model query subject is created, you can edit its query item
properties, add macros and filters and change its SQL generation
setting. You can do this without affecting the original underlying
query subjects.

4-6 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

Demo 4–1

ƒ Create the Presentation Layer and Add


Model Query Subjects

© 2003, Cognos Incorporated 4-7


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 4–1: Create the Presentation Layer and Add


Model Query Subjects

Additional Information
Purpose: IMPORTANT: Ensure that students are
As a metadata modeler, you have been asked by report now using the GO Model Module 3 model
authors to create more intuitive orders and products query provided on the Student CD. This ensures
subjects. You will create a presentation layer with sub that all students are working from the same
folders to organize the newly requested model query starting point and with a model that has all
multi–lingual issues resolved as well as a
subjects and create intuitive relationship paths. consistent naming convention.

Task 1. Create folders. The first time students publish the GO


Model package, they may receive an
1. Open Framework Manager. access list warning message. Click OK to
2. In Framework Manager, open the GO Model Module 3 model publish the model. This message simply
located in C:\Edcognos\CR1052\GO Model Module 3. indicates that the user that created and
initially published the model is not on the
3. In the Project Viewer pane, right–click the GO Model namespace, student's machine.
point to Create and then click Folder.
The Create Folder Wizard dialog box appears.
4. In the Folder Name text box, type Presentation Layer.
5. Click Next, and then click Finish.
6. For organizational purposes, drag and drop the Presentation Layer
folder above the Database Layer folder.
7. Right–click the Presentation Layer folder, point to Create, and
then click Folder.
The Create Folder Wizard dialog box appears.
8. In the Folder Name text box, type Order Information.
9. Click Next, and then click Finish.
10. Repeat steps 7 to 9 to create two more folders called Orders by
Sales Staff and Product Information.
The model should appear as shown below:

11. Save the model.

4-8 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

Task 2. Create model query subjects.


1. Right–click the Order Information folder, point to Create and then
click Query Subject.
The New Query Subject Wizard dialog box appears.
2. In the Name text box, type Orders, and ensure the Model Query
Subject option is selected.
3. Click Finish.
The Query Subject Definition dialog box appears.
4. In the Available model objects pane, expand GO Model,
Database Layer and then gosales.
5. Expand the Order Header query subject, and then drag and drop
the following query items onto the Query Items and Calculations Additional Information
pane: After a model query subject has been
created, you can always view the query
Order Number from Order Header item’s target reference by opening the
Query Subject Definition dialog box and
Retailer Name from Order Header looking at the Source column in the Query
Order Date from Order Header Items and Calculations pane.

The model query subject should appear as shown below:

© 2003, Cognos Incorporated 4-9


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

6. To complete the model query subject, drag and drop the following
items from the Available model objects pane onto the Query
Items and Calculations pane:
Order Method from Order Method
Product Number from Order Details
Product Name from Products
Quantity from Order Details
Unit Cost from Order Details
Unit Price from Order Details
Unit Sale Price from Order Details
Product Cost from Order Details
Planned Revenue from Order Details
Actual Revenue from Order Details
Gross Profit from Order Details
Margin from Order Details
7. Click OK.

4-10 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

8. Repeat steps 1 to 7 to create the following model query subjects in


the appropriate folders:
Folder Model Query Query Items
Subject
Order Returns Return Date from Returned
Information Item
Reason Description from
Return Reason
Return Quantity from
Returned Item
Product Products Product Number from
Information Products
Product Line from Product
Line
Product Type from Product
Type
Product Name from
Products
Description from Products
Introduction Date from
Products
Product Image from
Products
Production Cost from
Products
Margin from Products
Forecasts Year from Product Forecast
Month from Product
Forecast
Expected Volume from
Product Forecast

© 2003, Cognos Incorporated 4-11


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

The model should appear as shown below:

9. Save your model.


Task 3. Create an intuitive relationship path.
Note: In the previous module, we resolved an ambiguous relationship
scenario. We will now use a folder in the presentation layer, as well as
shortcuts, to create an intuitive relationship path between the Orders
model query subject and the Shortcut to Sales Staff shortcut. This
way report authors will know that the correct relationship will be used
for specific queries.
1. Expand the gosales namespace, right–click on the Shortcut to Sales
Staff shortcut in the gosales, and then click Copy.
2. In the Presentation Layer folder, right–click the Orders by Sales
Staff folder, and then click Paste.
The Shortcut to Sales Staff shortcut is placed in the Orders by Sales
Staff folder.
3. Rename the Shortcut to Sales Staff shortcut to Sales Staff.
4. In the Order Information folder, right–click the Orders model
query subject, and then click Create Shortcut.
5. Drag and drop the Shortcut to Orders shortcut onto the Orders by
Sales Staff folder.
Your presentation layer should appear as shown below:

4-12 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

Task 4. Publish the model and create a report to view


the results.
1. Publish the GO Model package.
2. Open Query Studio, and then click the GO Model package.
3. Create a simple report using the following items from the new
Orders and Products query subjects you created in the presentation
layer.
Product Line from Products
Product Type from Products
Order Method from Orders
Actual Revenue from Orders Instructional Tips
If time permits, you can also create an ad
Notice the intuitive nature of the presentation layer query subjects. hoc report using the Orders by Sales Staff
query subjects. This will illustrate the
4. Group the report on Product Line and Product Type.
resolved ambiguous relationship from Task
5. Save the report as Demo 4–1. 3.

6. Close Query Studio. Create the report using First Name, Last
Name, and Position from Sales Staff and
Results: Quantity and Actual Revenue from Shortcut
You have successfully created a presentation layer with to Orders.
subfolders and created new model query subjects that
combined query items from more than one data source
query subject. Report authors will now be able to use more
intuitive query subjects to write their reports.

© 2003, Cognos Incorporated 4-13


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Examine Filters

ƒ Filters are used to limit the rows retrieved by a query subject.


ƒ There are two types of UI filters in Framework Manager:
ƒ stand–alone (reusable)
ƒ embedded (for a single query subject)

Stand–Alone Filters Embedded Filter

Additional Information
• A filter is an expression that specifies the conditions that rows or
If you start with an embedded filter, you
instances must meet to be retrieved for the query subject, calculation, can later convert it into a stand–alone
or report to which the filter is applied. A filter returns a Boolean expression that you can apply to other
value, equivalent to the predicate in the WHERE clause in an SQL query subjects. To do this, right–click the
statement, so that you can limit the rows returned by a query subject. filter expression in the query subject editor
and click Convert to Stand–alone Filter.
• Framework Manager offers two user interface filters, stand–alone and You can also restrict the data that the
embedded, but you may also include filters in the WHERE clause of queries in the model or a package retrieve
your SQL definition. by setting governors. This will be discussed
in another module.
• Create stand–alone filters when you want to reuse the expression by
doing any of the following:

• add it to one or more query subjects to limit the data that the
query retrieves when the filtered query subject is used in a report

• include it in a package to make it available to your report authors

• move it, or a shortcut to it, into a folder to further organize your


model objects

• If you want to use a filter with only one specific query subject, you
can create an embedded filter while modifying either a data source
query subject or model query subject.

4-14 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

Demo 4–2

ƒ Create Filters

© 2003, Cognos Incorporated 4-15


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 4–2: Create Filters

Purpose:
Ad hoc report authors have requested re–usable filters for
various product lines. This will make filtering easier for
them as they create their reports. Management has also
made a request to limit the data returned by the
presentation layer to the current year, in this case 2002, as
previous years will be made available through other
methods. We will create both model and embedded filters to
handle these requests.

Task 1. Create model filters.


1. In the Presentation Layer folder, create a new folder called Product
Line Filters. Do not specify any objects for this folder.
2. Right–click the Product Line Filters folder, point to Create, and
then click Filter.
The Filter Definition dialog box appears.
3. In the Name box, type Camping Equipment.
4. In the Available Components pane, expand the GO Model
namespace, the Database Layer folder, the gosales namespace and
the Product Line query subject.
5. Drag and drop the Product Line Code query item into the
Expression Definition pane.
6. Type =1 after [gosales].[Product Line].[Product Line Code] so that
the expression definition appears as shown below:
[gosales].[Product Line].[Product Line Code] =1
7. Click OK.
8. Repeat steps 2 to7 to create a model filter called Mountaineering
Equipment. The filter value will be 2 so that the expression
definition appears as shown below:
[gosales].[Product Line].[Product Line Code] =2
9. Save the model.
Task 2. Test your model filters.
1. Publish the GO Model package.
2. In Cognos Connection, click the Public Folders tab, and then click
the GO Model link.

4-16 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

3. Click the Demo 4–1 link to launch the report created in the previous
demo.
The report appears in Query Studio. Additional Information
If model versioning was not disabled when
4. Navigate through the report using the links at the bottom of the publishing the package, you will get a
report to notice that all product lines are included. message stating a newer version of the
model exists and asking if you would like to
5. In the Menu, click the Insert Data link. update your report. If this occurs, click OK.
6. Expand the Presentation Layer folder and the Product Line
Filters folder.
7. Drag and drop the Camping Equipment filter onto the report.
8. Navigate through the report again.
Notice that the report only contains information on Camping
Equipment now.

9. On the toolbar, click Undo .


10. Drag and drop the Mountaineering Equipment filter onto the Additional Information
report. You can only drop one model filter on the
report at a time because ReportNet uses
Notice that the report only contains information on Mountaineering the AND operator to combine the filters
Equipment now. together instead of using the OR operator.

11. Close Query Studio without saving the report.


Task 3. Create an embedded filter.
1. In the Project Viewer pane of Framework Manager, double–click the
Orders query subject in the Order Information folder under the
Presentation Layer folder.
The Query Subject Definition dialog box appears.

2. Click Insert embedded filter .


The Filter Definition – Embedded Filter dialog box appears.
3. In the Name box, type Current Year Only.
4. In the Available Components pane, expand the GO Model
namespace, the Presentation Layer folder, the Orders Information
folder and then the Orders query subject.
5. Drag and drop the Order Date query item into the Expression
Definition pane.
6. Type >=2002–01–01 after [GO Model].[Orders].[Order Date] so that
the expression definition appears as shown below:
[GO Model].[Orders].[Order Date] >=2002–01–01

© 2003, Cognos Incorporated 4-17


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

7. Click OK.
The embedded filter is now a part of the query definition, as shown
below:

8. Click OK.
9. Save the model.
Task 4. Test your embedded filter.
1. Publish the GO Model package.
2. Open Query Studio, and then select the GO Model package.
3. Create a simple report using the following items from the Orders and
Products query subjects we created in the presentation layer:
Product Line from Products
Product Type from Products
Order Date from Orders
Quantity from Orders
4. Group the report on Product Line and Product Type.
Notice that the report only displays dates greater than or equal to
January 1st, 2002.
5. Save the report as Demo 4–2.
6. Close Query Studio.

Results:
Through the use of model filters we have made ad hoc
report authors’ experience more efficient. By using
embedded filters, we have ensured that report authors and
consumers are not running reports that return
unnecessarily large amounts of data as well as limiting
them to the data they require to make decisions.

4-18 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

Use a Prompt Value to Filter Data

ƒ A prompt value can be used when user input is required for variables
beyond the report author’s control.
ƒ The syntax for using a prompt as a value is:
ƒ ?<PromptName>?

Run–time Model

User Input
Stored Procedure

?part_number?

• In general, it is better to define prompts in the reporting application


to make use of the additional prompt features. However, there are
some variables that report authors cannot modify. For these, you can
use Framework Manager to define prompts.
Additional Information
• You can use prompt values in:
If a stored procedure with a part number
parameter returns all rows for a specified
• parameter maps part number, instead of using the part
number as the argument for the stored
• session parameters procedure query subject, you can use a
prompt, such as ?Part_Number?. This will
allow the end–user to specify which part
• stored procedure arguments they want to retrieve information for.

• expressions, including filters, calculations, and relationships


You can change the session value of
• When you test a model object that references a prompt, Framework prompt values through the Options dialog
box. This dialog box is available when you
Manager asks you to enter the prompt value. Framework Manager modify a query subject or define a
uses this value for either the duration of the session, or until you clear calculation, filter, or complex relationship.
the prompt value. This lets you change the prompt value at
the time that you are testing the expression
referencing that value.

© 2003, Cognos Incorporated 4-19


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 4–3

ƒ Use a Prompt Value to Filter Data

4-20 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

Demo 4–3: Use a Prompt Value to Filter Data

Purpose:
Management has requested a quick reference tool for the
ReportNet reporting environment to allow phone
representatives to quickly retrieve the dates for specific
orders. A stored procedure exists in the GOSL database
that can be leveraged to create this tool.

Task 1. Create a stored procedure query subject and


apply a prompt value.
1. In the Project Viewer pane of Framework Manager, right–click the Additional Information:
gosales namespace under the Database Layer folder, then point to This Stored procedure has already been
Create, and then click Query Subject. created in the GOSL database provided on
the Student CD.
The New Query Subject Wizard dialog box appears.
It expects an OrderNumber parameter that
2. In the Name box, type Find Order Date. is used to retrieve the order date for that
particular order.
3. Select Stored Procedure, and then click Next.
4. In the Select a data source pane, select GOSL, and then click Next.
5. In the Stored Procedures pane, expand GOSL, dbo, and then the
Procedures folder.
6. Scroll down and select the FindOrderDate stored procedure.
7. Click Finish.
The Edit Definition window for the stored procedure appears. We
will now add a prompt value to allow for user input as opposed to
hard coding a value.
8. On the Arguments tab, select the @OrderNumber argument, and
then click the Edit button.
The Edit Argument’s Value dialog box appears.
9. In the Value pane, type ?Order Number?, and then click OK. Additional Information
When the stored procedure query subject
10. In the Edit Definition window, click the Test button. is tested, you will be prompted to enter an
order number value.
The Prompt Values dialog box appears.
11. In the Name column, select Order Number, and then click in the When the always prompt for values check
Value field. box is enabled in the Prompt dialog box,
Framework Manager prompts you for a
12. In the Value field, type 1234, and then click OK. value every time you test the object. This
check box only applies to testing, when
One record will be returned in the Test Results pane specifying the updating the object or performing a count.
date for that particular order. If it is not enabled, Framework Manager
uses the existing prompt value, if one
13. Click OK. exists.
14. Save the model.

© 2003, Cognos Incorporated 4-21


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 2. Test your prompt value in Query Studio.


1. Publish the GO Model package.
2. Open Query Studio, and then select the GO Model package.
3. Expand the Database Layer folder, and then the gosales folder.
4. Drag and drop the Find Order Date query subject into the work
area.
A default prompt page appears requesting an Order Number.
5. In the prompt text box, type 1234, and then click OK.
A list appears displaying the date and time for order 1234 as shown
below:

6. Close Query Studio without saving the report.

Results:
We incorporated an existing stored procedure, from the
GOSL database, into the model by creating a stored
procedure query subject. We then used a prompt value to
allow for user input in the reporting environment creating
an efficient means of retrieving the requested information.

4-22 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

Summary

ƒ In this module, we have:


ƒ added a presentation layer to our model
ƒ created stand–alone and embedded filters
ƒ used a prompt value to refine a query

© 2003, Cognos Incorporated 4-23


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

4-24 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

Workshop 4–1

ƒ Finish Creating the Presentation


Layer

© 2003, Cognos Incorporated 4-25


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 4–1: Finish Creating the Presentation


Layer
More requests have come in from report authors for additional presentation
layer views. In particular they would like to see sales staff and retailer
information in order to author reports at those levels of granularity. Authors,
especially ad hoc query users, were also interested in a quick reference tool to
allow them to quickly access information such as viewing archived orders
information and quickly finding the date on which a particular order was
placed.

To accomplish this:

• Create the following folders in the presentation layer:


• Sales Rep Information
• Retailer Information
• Quick Reference
• Add the following query subjects to the appropriate folders:
Folder Model Query Query Items
Sales Rep Sales Rep First Name from Sales Staff
Information
Last Name from Sales Staff

Position from Sales Staff

Work Phone from Sales


Staff
Extension from Sales Staff

Fax from Sales Staff

Email from Sales Staff


Branch Address Address 1 from Sales
Branch
Address 2 from Sales
Branch
City from Sales Branch

Region from Sales Branch

Postal Zone from Sales


Branch
Country from Country

4-26 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

Sales Targets Create a calculation called


Staff Name that
concatenates First Name
from Sales Staff and Last
Name from Sales Staff.
Retailer Name from Sales
Target

Product Name from


Products

Sales Year from Sales


Target

Sales Period from Sales


Target

Sales Target from Sales


Target

Retailer Retailers Type Name from Retailer


Information (Query Subjects Type
are located in the
Territory Name from Sales
goretailers
Territory
namespace)
Company Name from
Retailer
Address 1 from Retailer Site

Address 2 from Retailer Site

City from Retailer Site

Region from Retailer Site

Postal Zone from Retailer


Site
Country from Country

Flag Image from Country

• Move the Find Order Date query subject from the database layer and
place it in the Quick Reference folder in the presentation layer. This
data source query subject was created specifically as a quick reference
tool and will not be re–used elsewhere in the model.

© 2003, Cognos Incorporated 4-27


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

• Create a shortcut for the Orders for 2001 query subject and move it
to the Quick Reference folder.

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.

4-28 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

Workshop 4–1: Task Table


Task Where to Work Hints
1. Create presentation layer Project Viewer pane • Right–click Presentation
folders. Layer folder, point to Create,
and then click Folder.

2. Create model query Project Viewer pane • Right–click appropriate


subjects. folder, point to Create, and
New Query Subject wizard then click Query Subject.
Query Subject Definition • Select the Model query
dialog box subject option.

• Use the following syntax to


create the Staff Name query
item. [gosales].[Sales
Staff].[First Name] || ' '
|| [gosales].[Sales
Staff].[Last Name]

3. Move data source query Project Viewer pane • Cut and paste Find Order
subjects and create Date query subject.
shortcuts. Presentation Layer
• Create shortcut, then cut and
paste it to the appropriate
location. Rename it to
Orders for 2001.

If you need more information to complete a task, see the Step–by–Step


instructions for this exercise in Appendix A.

© 2003, Cognos Incorporated 4-29


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 4–1: Workshop Results


Your presentation layer should appear as shown below:

4-30 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

Workshop 4–2

ƒ Create More Filters

© 2003, Cognos Incorporated 4-31


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 4–2: Create More Filters


In order to complete the presentation layer, you need to finish creating the
Product Line filters so that report authors have a complete set. Also, another
request has come in from management to create a quick reference tool to
allow managers to enter in their manager code in order to see a listing of all
staff that report to them.
To accomplish this:
• Create the following model filters in the Product Line Filters folder
with the following codes.
• Personal Accessories
• [gosales].[Product Line].[Product Line Code] =3
• Outdoor Protection
• [gosales].[Product Line].[Product Line Code] =4
• Golf Equipment
• [gosales].[Product Line].[Product Line Code] =5
• Create a new model query subject called My Sales Staff in the Quick
Reference folder that contains an embedded filter called Manager
Code Filter that prompts the end–user to supply their Manager
Code. The query subject should contain the following query items.
• A calculation called Staff Name that combines the sales staff’s
First Name and Last Name.
• Position from Sales Staff
• City from Sales Branch
• Region from Sales Branch
• Work Phone from Sales Staff
• Extension from Sales Staff
• Fax from Sales Staff
• Email from Sales Staff
• Date Hired from Sales Staff
Test your embedded filter in Framework Manager and the model
filters in the ReportNet reporting environment.
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.

4-32 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

Workshop 4–2: Task Table


Task Where to Work Hints
1. Create model filters. Project Viewer pane • Right–click Product Line
Filters folder, point to select
Create, and then click Filter.

2. Create a query subject Project Viewer pane • Use the following syntax to
with an embedded filter create the Staff Name query
and prompt value. Filter Definition dialog box item. [gosales].[Sales
Staff].[First Name] || ' '
|| [gosales].[Sales
Staff].[Last Name]

• Filter name: Manager Code


Filter

• Use a prompt value for the


Manager Code value in your
embedded filter.

3. Test your filters. Framework Manager • Test the My Sales Staff query
subject and provide a
Cognos Connection Manager Code value of 18.
Query Studio • Publish your package.

• Use the Demo 4–1 report to


test your newly created
filters.

If you need more information to complete a task, see the Step–by–Step


instructions for this exercise in Appendix A.

© 2003, Cognos Incorporated 4-33


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 4–2: Workshop Results


The Product Line Filters folder should appear as shown below:

The embedded filter definition for the My Sales Staff model query subject
should appear similar to as shown below:

4-34 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
PREPARE THE BUSINESS VIEW

The Demo 4–1 report should appear as shown below after applying the
Personal Accessories model filter:

© 2003, Cognos Incorporated 4-35


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

4-36 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
5

1. Introduction to Framework Manager


2. Design and Create a Project
3. Prepare the Metadata
4. Prepare the Business View
5. Manage Packages
6. Set Security in Framework Manager
7. Manage Projects
8. Use Advanced Modeling Techniques

Cognos ReportNet – Metadata Modeling


COGNOS REPORTNET – METADATA MODELING

5-2 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PACKAGES

Objectives

ƒ In this module, we will:


ƒ edit governors for our model and packages
ƒ create and modify packages
ƒ specify package languages and function lists
ƒ analyze the impact of publishing a package
ƒ publish packages and set their model version control

© 2003, Cognos Incorporated 5-3


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Framework Manager Workflow

Data
Sources

Import

Create and
Design/Create Prepare the Prepare the
Manage
Project Metadata Business View Packages

• Create and manage packages – identify subsets of the metadata to be


published.

5-4 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PACKAGES

Examine Packages

ƒ Packages contain a subset of your model to meet your presentation


needs.
ƒ You can create several packages, each used to suit different report
authors' requirements.
ƒ You can apply security to packages to restrict access.
ƒ You can nest packages to save development and maintenance time.

Additional Information
• Each package can contain a different set of folders, filters, query
Each report can contain information from a
subjects, and query items. You can completely customize its contents single package only.
to satisfy different reporting requirements and to set up a logical
presentation of the metadata.

• Packages can be referenced by other packages also known as nesting.


Nesting packages will be discussed later in this module.

© 2003, Cognos Incorporated 5-5


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Edit Governors

ƒ You can set limits to the data retrieved in a query subject test or the
report design mode by setting governors.
ƒ When you set governors, all packages subsequently published will
reflect the new settings.

Additional Information
• SQL is generated automatically on demand when you:
Because governors control SQL
generation, you use them to reduce system
• run a report in Report Studio or Query Studio resource requirements and improve
performance.
• test a query subject or relationship in Framework Manager
A setting of 0 indicates no limit. When a
report is run that violates any of the
• create a new query subject by transforming query subjects or governors set, you receive an error
merging objects message.

• By setting governors, you can restrict the number of tables retrieved An outer join retrieves all rows in one table,
by a query as well as restrict the number of rows returned. You can even if there is no matching row in another
table. This type of join can produce very
also set time limits for query execution, as well as restrict character large queries and reports.
length on binary large objects (BLOBs).
A cross–product join retrieves data from
• You can set run–time activities, such as deny outer joins and cross– tables without joins. This type of join can
product joins, which may produce very large and resource intensive take a long time to retrieve and can
queries. produce meaningless results.

5-6 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PACKAGES

Demo 5–1

ƒ Set Governors

© 2003, Cognos Incorporated 5-7


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 5–1: Set Governors

Purpose:
The Great Outdoors IT department has requested that some
query limits be set on the model to reduce the load on their
servers. We will limit the amount of tables any one query
can return, as well as set a time–out period for queries. This
will be accomplished by setting the appropriate governors.

Task 1. Set the Report table limits governor.


1. In Framework Manager, open the GO Model from the previous
module.
2. From the Project menu, click Edit Governors.
The Governors dialog box appears.
3. Change the value in the Report table limits text box from 0 to 3.
4. Click OK.
Task 2. Test your Report table limits governor setting.
1. Publish the GO Model package.
2. Open Query Studio, and then select the GO Model package.
3. From the Order Information folder in the Presentation Layer folder,
drag and drop the Orders query subject onto the work area.
An error message appears.
4. Click the Details link to read the message.
The governor setting for Report table limits is not appropriate for the
presentation layer query subjects. We will need to adjust it.
5. Repeat Task 1 to change the Report table limits value from 3 to 10.
6. Republish the GO Model package and re–test the Orders query
subject in Query Studio.
A large list report appears.
7. Close Query Studio.
Task 3. Set the Query execution time limits governor.
1. In Framework Manager, from the Project menu, click Edit
Governors.
The Governors dialog box appears.
2. Change the value in the Query execution time limits text box from
0 to 1.
3. Click OK.

5-8 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PACKAGES

Task 4. Test your Query execution time limits setting.


1. Publish the GO Model package.
2. Open Query Studio, and then select the GO Model package.
3. From the Order Information folder in the Presentation Layer folder,
drag and drop the Orders query subject onto the work area.
An error message appears.
4. Click the Details link to read the message.
The governor setting for Query execution time limits is not
appropriate for the presentation layer query subjects. We will need to
adjust it.
5. Repeat Task 3 to change the Query execution time limits value from
1 to 15.
6. Republish the GO Model package and re–test the Orders query
subject in Query Studio.
A large list report appears.
7. Close Query Studio.

Results:
By setting, testing, and refining your governor settings, you
have ensured that the IT department’s servers will not be
unnecessarily overloaded.

© 2003, Cognos Incorporated 5-9


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Create and Modify Packages

ƒ Include the model objects you want to publish in your package.

Package

Model

Examples
• Deselect objects you do not wish to be visible to end-users.
In the slide example, we see a package
called Go Sales and Retailers, which
• At any time, you may go back and edit the definition of your package includes the majority of the presentation
by adding or removing objects. You must exercise caution when layer created in the model. It excludes the
doing this as you may break reports based on a previous version of physical layer called Database view as
the model. report authors do not require this view of
the metadata nor is it modeled for
presentation purposes.

5-10 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PACKAGES

Specify Package Languages

ƒ In the instance of multilingual data you must specify the languages to


be published with a package.
ƒ You must add languages to the project before you can add them to a
package.

Examples
• You can specify which languages are to be published with each
You may have one package designed for
package. You can create several packages based on the same model, the Mexican sales offices. This package
all with different languages. may include Spanish and English, whereas
the Canadian sales offices package would
only include French and English.

Additional Information
You can also specify package languages
for several packages at a time. To do this,
in the model, right–click on Packages and
then click Specify Package Languages.

© 2003, Cognos Incorporated 5-11


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Specify Package Function List

ƒ The package function list is used to specify which data source


functions you would like to make available to report authors.

Additional Information
• Upon publishing a package, the functions you selected will be
In our GO Model application we will only
accessible to report authors in Report Studio. publish the package with the SQL Server
function set, as it is the only database we
• If you have multiple data sources in your model that are are creating our data sources from.
heterogeneous, you will want to publish your package with the
appropriate function sets so that report authors can leverage them
while authoring reports.

5-12 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PACKAGES

Analyze the Impact of Publishing a Package

ƒ If you have updated a package, you can analyze the effects of the
changes you made before deploying the new package to report
authors.

View affected reports

View changed items

View changes made

Additional Information
• You can compare a selected package with a published package of the
Report will be broken indicates that
same name to show changes between the packages that could affect something has been renamed or deleted in
any reports based on the package. You can see details on each the model and will therefore invalidate a
change, and which reports are affected by a specific selected change. report.
You can also select a specific query item and see which reports are
dependent on it. Report may be affected indicates that an
object (for example, query subject, query
item or relationship) has been edited and
• With this information, you could notify report authors that a change may affect the results returned by the
was made to the model that affected their reports. They can quickly report.
fix their reports so that consumers are not affected.

© 2003, Cognos Incorporated 5-13


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Publish Packages

ƒ When you publish a package, you can choose to save either to the
ReportNet server or to a network location.
ƒ Before publishing, you should verify the package.

Cognos Connection

File System

Additional Information
• When you publish a package to the ReportNet server, you make it
You can also verify the entire model by
available to report authors with the appropriate security rights. using the Verify option in the Project menu.

• Publishing to the network lets you back up or share all or a portion of If you wish to change the ReportNet server
your model with other metadata modelers. They can take this to which you publish, you need to change
published version of the model and modify it to meet their needs the Gateway URI setting in Cognos
Configuration.
without having to build the model from scratch.

• To avoid potential problems, use the Verify option in the Publish


Wizard to troubleshoot the package and check for any errors. When
you check a package, Framework Manager suggests how to fix
problems for:

• schema validation errors


• invalid references
• invalid association containership

• When you publish a package for the first time, you create a
corresponding package on the ReportNet server. The ReportNet
package contains a model but no reports.

5-14 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PACKAGES

Set Model Version Control

ƒ When you publish a package, you can select how many versions of
the model you want to retain on the Cognos ReportNet server.

Specify How Many Versions to


Maintain

Additional Information
• When you publish a package with model versioning enabled, the next
To see the number of model versions set
time you publish the same package, you update the version of the for a package, select a package and, in the
model in the existing package on the ReportNet server. Property pane, find the maxVersions
property.
• New or modified reports will use the latest version of the model in
the package. When a report is saved, the version of the model used is You can remove all previous versions of
the model for a fresh start by using the
saved in the report specification. Delete all previous model versions option.

• If the package is republished, report authors are notified that the Reports created against an expired model
report will use the newest version of the model in the package. The will need to be updated against the latest
report author must save the report to complete the update. model.

• If you open a saved report after the package it is based on is


republished, one of two things happens:

• if the original version of the package still exists, the report runs
against the original version

• if the original version of the package no longer exists, the report


is updated to run against the most recent version

© 2003, Cognos Incorporated 5-15


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Nest Packages

ƒ When you create nested packages, you create a master package that
is based on other existing packages.

Master Package – North America

Mexico Canada
United States

Model Packages

Additional Information
• Use nested packages to reuse model information.
You create three separate packages
named Canada, Mexico, and the United
• Nested packages save time, are easier to maintain, and let you publish States. Each package contains the project
only the master package to make all referenced packages available to objects and security appropriate for that
report authors. package. You can create one master North
America package and include the
packages Canada, Mexico, and the United
States. When you need to publish the
package for report authors, you publish
only the North America package.

When users from any of the three groups


login to Cognos Connection and begin to
author a report, they will only see the
package objects that apply to them in the
metadata tree, which was defined in the
security settings.

5-16 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PACKAGES

Demo 5–2

ƒ Create and Nest Packages

© 2003, Cognos Incorporated 5-17


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 5–2: Create and Nest Packages

Purpose:
Management has requested a separate Quick Reference
package so that ad hoc query users can easily access these
special query subjects. As well, management would like to
see a package that consists of both order and product
information and also contains some of the quick reference
query subjects. We will use a nested package to accomplish
this second request.

Task 1. Create a quick reference package.


1. In the Project Viewer pane, right–click Packages, point to Create,
and then click Package.
The Create Package wizard dialog box appears.
2. In the Name box, type Quick Reference, and then click Next.
3. Click the check mark beside GO Model to deselect it.
The package definition appears as shown below:

4. Expand the Presentation Layer, and then expand the Quick


Reference folder.

5-18 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PACKAGES

5. Select the following query subjects by clicking on the X beside them:


Find Order Date
My Sales Staff
Orders for 2001
6. Click Next.
7. Accept the default for Groups associated with the package, and
then click Next.
8. Accept the language defaults, and then click Next.
9. Accept the default function set (it should be SQL Server), and then
click Finish.
A message appears asking if you would like to open the Publish
Package Wizard.
10. Click Yes.
The Publish Wizard dialog box appears.
11. Clear the Enable model versioning check box, and then click
Publish.
12. When the package has been published, click Finish.
Task 2. Test the new package in Query Studio.
1. Open Query Studio, and then select the Quick Reference package.
2. Drag and drop the My Sales Staff query subject onto the work area.
A prompt page appears.
3. In the text box, type 13, and then click OK.
Notice how easily accessible and intuitive the Quick Reference query
subjects are.
4. Close Query Studio.
Task 3. Create an Order and Products package.
1. In the Project Viewer pane, right–click Packages, point to Create,
and then click Package.
The Create Package wizard dialog box appears.
2. In the Name box, type Orders and Products, and then click Next.
3. Click the check mark beside GO Model to deselect it, and then
expand the Presentation Layer folder followed by the Order
Information folder.
4. Click the X beside the Orders and Returns query subjects to select
them.
5. Expand the Product Information folder, and then select the
Products query subject.

© 2003, Cognos Incorporated 5-19


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

6. Select the Product Line Filters folder.


The package definition appears as shown below:

7. Click Next.
8. Accept the default for Groups associated with the package, and
then click Next.
9. Accept the language defaults, and then click Next.
10. Accept the default function set (it should be SQL Server), and then
click Finish.
A message appears asking if you would like to open the Publish
Package Wizard.
11. Click No.
Task 4. Create a nested package.
1. Create a new package called GO Orders, and then click Next.
2. In the Define Objects dialog box, select Using existing packages.
3. Select the Quick Reference and the Orders and Products
packages.
4. Click Next.

5-20 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PACKAGES

5. Select the Quick Reference folder, and then deselect the My Sales
Staff query subject.
The object selection appears as shown below:

6. Click Next.
7. Accept the default for Groups associated with the package, and
then click Next.
8. Accept the language defaults, and click Next.
9. Accept the default function set (it should be SQL Server), and then
click Finish.
A message appears asking if you would like to open the Publish
Package Wizard.
10. Click Yes.
11. In the Number of model versions to retain text box, type 4, and then
click Publish.
12. When the package has been published, click Finish.
Task 5. View your package in Query Studio.
1. Open Query Studio, and then select the GO Orders package.
2. Create a simple report using the following items:
Product Line from Products
Order Method from Orders
Quantity from Orders
Return Quantity from Returns
3. Group the report on Product Line.

© 2003, Cognos Incorporated 5-21


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

4. Drag and drop the Camping Equipment model filter onto the
report.
Notice the intuitive nature of the presentation layer when creating
this report.
5. Close Query Studio.

Results:
By creating and nesting packages, we have created and re–
used intuitive presentation views of the metadata in order to
create a user–friendly experience for report authors.

5-22 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PACKAGES

Summary

ƒ In this module, we have:


ƒ edited governors for our model and packages
ƒ created and modified packages
ƒ specified package languages and function lists
ƒ analyzed the impact of publishing a package
ƒ published packages and set their model version control

© 2003, Cognos Incorporated 5-23


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

5-24 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PACKAGES

Workshop 5–1

ƒ Create, Nest and Publish a Package

© 2003, Cognos Incorporated 5-25


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 5–1: Create, Nest and Publish a Package


There has been a request by sales staff managers to provide a view for sales
staff information, which can be re–used in other packages. This would allow
report authors to create reports on sales staff members across other business
lines such as orders and products. They would like at least four versions of
the model maintained so that if changes are made to the model, older reports
will not be immediately broken. The modeler can notify report -authors of
the changes and give them time to fix their reports.

To accomplish this:

• Create a package called Sales Reps, which includes the following


query subjects.
• Sales Reps
• Branch Address
• Sales Targets
• Create a master package called GO Sales Rep Performance that
references the following packages.
• Sales Reps
• Orders and Products
• Quick Reference
• Edit the package definition to include only the following objects.
• Orders
• Products
• Sales Reps
• Branch Address
• Sales Targets
• Product Line Filters folder and all of its contents
• Quick Reference folder with only the My Sales Staff query
subject selected.
• Publish the GO Sales Rep Performance package enabling model
versioning with a value of at least four models.

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.

5-26 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PACKAGES

Workshop 5–1: Task Table


Task Where to Work Hints
1. Create a Sales Reps Project Viewer pane • Right–click Packages and
package. select Create.

2. Create and publish a Project Viewer pane • In the Create Package


nested package. wizard, select Using existing
packages.

• Modify the package


definition as required.

If you need more information to complete a task, see the Step–by–Step


instructions for this exercise in Appendix A.

© 2003, Cognos Incorporated 5-27


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 5–1: Workshop Results


The Sales Rep package definition appears as shown below:

The GO Sales Rep Performance package definition appears as shown below:

5-28 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
6

1. Introduction to Framework Manager


2. Design and Create a Project
3. Prepare the Metadata
4. Prepare the Business View
5. Manage Packages
6. Set Security in Framework Manager
7. Manage Projects
8. Use Advanced Modeling Techniques

Cognos ReportNet – Metadata Modeling


COGNOS REPORTNET – METADATA MODELING

6-2 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
SET SECURITY IN FRAMEWORK MANAGER

Objectives

ƒ In this module, we will:


ƒ examine the ReportNet security environment
ƒ create and apply security filters
ƒ restrict access to query subjects and query items
ƒ restrict access to packages

© 2003, Cognos Incorporated 6-3


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Framework Manager Workflow

Data
Sources

Import

Create and
Design/Create Prepare Model Enhance
Manage
Project for Reporting Model Packages

Set
Security

• Set Security in Framework Manager based on security defined for the


ReportNet application.

6-4 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
SET SECURITY IN FRAMEWORK MANAGER

ReportNet Security

ƒ The ReportNet security model is based on:


ƒ third-party authentication providers
ƒ authorization (security object + permission + entry)
ƒ Cognos namespace
ƒ administration
ƒ Security in ReportNet is optional, whereby anonymous access is
allowed.

• The security model in ReportNet can be easily integrated with the


existing security infrastructure in your organization.
Additional Information
• It is built on top of one or more third-party authentication providers.
Each authentication provider known to
You use the providers to define and maintain users, groups, and ReportNet is referred to as a namespace.
roles, and to control the authentication process.
Set up and configuration of authentication
• ReportNet authorization involves a security object, which is used to providers is performed in Cognos
apply a permission to an entry. Configuration.

Authorization is the process of granting or


• In addition to the external namespaces that represent the third-party denying users access to entries (for
authentication providers, ReportNet has its own namespace called example, folders, reports, etc…) and
Cognos. The Cognos namespace contains the Cognos security permissions to perform activities on that
objects and enhances your organization’s security policies and content based on their user name and
roles.
deployment ability of applications.
If security is not enabled, it means that no
• Creating and modifying, groups, roles, and setting permissions in third-party authentication providers are
ReportNet is optional. configured, and therefore all user access is
anonymous. Typically, anonymous users
have limited, read-only access.

When ReportNet security is not in place,


you allow anonymous access. The
anonymous authentication process does
not require a user to provide logon
credentials. The anonymous authentication
uses a pre-defined account under which all
anonymous users are logged in. Allowing
anonymous access is set in Cognos
Connection.

© 2003, Cognos Incorporated 6-5


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Configure Authentication Providers

ƒ Cognos ReportNet uses third-party authentication providers to


leverage existing user and group repositories.
ƒ Providers store authentication information such as user names, IDs,
passwords, regional settings, and personal preferences.
ƒ You can define multiple providers concurrently.

Additional Information
• Cognos ReportNet uses authentication providers so that you can
You do not have to replicate your existing
make use of your existing user and group repositories. repositories for use with ReportNet, so long
as they already exist. Once you have
• Third-party authentication providers manage user authentication in configured the providers, you then apply
ReportNet. Authentication providers define users, groups, and roles the users and groups already defined, to
used for authentication. User names, IDs, passwords, regional ReportNet content.
settings, and personal preferences are some examples of information Out of the box, ReportNet supports LDAP,
stored in the providers. Active Directory, NTLM, SAP, Cognos
Series 7, and Netegrity security sources.
• You configure authentication providers using Cognos Configuration. In the event that you do not use a
You can define multiple providers concurrently. If you configure supported repository, you can also create
multiple namespaces for your system, at the start of a session, you custom authentication providers. For
example, you may have a proprietary user
must select one namespace that you want to use. However, this does directory and/or authentication mechanism
not prevent you from logging on to other namespaces later in the used for login. ReportNet provides the
session. necessary API for you to write the
programs to integrate with that system.

Using multiple providers concurrently: for


example, if you set access permissions,
you may want to reference entries from
different namespaces. To log on to a
different namespace, you do not have to
log out of the namespace you are currently
using. You can be logged on to multiple
namespaces simultaneously.

6-6 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
SET SECURITY IN FRAMEWORK MANAGER

Use the Cognos Namespace

ƒ Use the groups and roles defined in the Cognos namespace to control
access to the metadata in the model.
ƒ The Cognos namespace contains security objects, which are:
ƒ pre-defined groups or roles Additional Information
The Cognos namespace also includes data
ƒ user-defined groups or roles sources, distribution lists, and contacts, as
created and modified in Cognos
ƒ You can: Connection.
ƒ create groups and roles specific to a ReportNet application
You can rename the Cognos namespace
ƒ repackage users, groups, and roles from the authentication using Cognos Configuration, but you
providers cannot delete it.

ƒ avoid having to set up application specific authentication It also contains the following built-in, pre-
information in the authentication providers defined security entries:
• Anonymous account – If
ƒ Use is optional. configured, allows public access
without authentication
• The Cognos namespace is the ReportNet built-in namespace. It is not • All Authenticated Users group –
used for authentication. It contains the Cognos security objects, All users except Anonymous
• Everyone group – All
which are pre-defined and user-defined groups and roles. Authenticated Users +
Anonymous
• You use the Cognos namespace to create groups and roles that are • System Administrators role –
specific to ReportNet. These groups and roles repackage the users, Members are super users
groups, and roles existing in the authentication providers to optimize (System prevents accidental
their use in the ReportNet environment. By using the Cognos deletion of this group; can
choose to not use this group by
namespace, you avoid cluttering your organization security systems removing all membership
with security information required only in ReportNet.
In addition to the Anonymous user and
• The Cognos namespace always exists in ReportNet, but the use of built-in groups defined in the Cognos
Cognos groups and roles it contains is optional. You can use users, namespace, several additional groups are
groups, and roles, directly from the authentication providers. present by default. The difference between
the Built-in and Default groups is that the
former cannot be deleted/renamed while
the latter can be deleted/renamed. The
Default groups include:
Authors, Consumers, Directory
Administrators, Query users, Report
Administrators, Server Administrators

Repackaging users, groups, and roles from


an authentication provider - for example, in
the Cognos namespace, you can create a
group called HR Managers and add to it
specific users and groups from your
corporate IT and HR organizations defined
in your authentication provider. Later, you
can set access permissions for the HR
Managers group to entries in ReportNet.

© 2003, Cognos Incorporated 6-7


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Set Security in Framework Manager

ƒ When you apply security in Framework Manager, you control access


for selected users, groups, and roles. To do this, you can:
ƒ specify package access (metadata security)
ƒ give visibility rights to objects (object-based security)
ƒ define security filters (data security)

Additional Information
• In Framework Manager, security is a way of restricting access to
There are business reasons for restricting
metadata and data across ReportNet products. access to data. For example, you may
have data that contains confidential data,
• To implement security in Framework Manager, you can: and only specific users are allowed to see
it. You may have a variety of data, and your
• specify package access – apply metadata security to a package by users only need to retrieve data from
specific tables or columns. Or, you may
identifying who has access to that package have a table that contains many records,
and your users only need to retrieve a
• give visibility rights to an object – apply object-based security subset of records from that table.
directly by either making the object visible or keeping it hidden
Each type of security implementation uses
users, groups, and roles to define access.
• define security filters – apply data security by creating a security
filter and apply it to a specific query subject. The filter controls
the data that is shown to report authors when they set up their
reports

6-8 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
SET SECURITY IN FRAMEWORK MANAGER

Specify Package Access

ƒ Specify which users, groups, and roles have access to the package
and deny access for all other users, groups, and roles.

Create a new group or role


& add users

Additional Information
• When you specify package access, you specify which users, groups,
You can specify package access when you
and roles (entries) have access to the published model. initially create the package using the
Package Wizard, or by right-clicking a
• You can add entries created both in third-party authentication package and selecting Edit Package
providers and in ReportNet as members of a Cognos group. Access after the package has been
created.
• You can also organize your security according to business rules by The interface for creating new groups or
creating new groups or roles or by removing groups or roles. roles or removing groups or roles is
through Cognos Connection.

Access = the ability to use the


package/model in Report Studio and Query
Studio to author reports, or run a report that
uses the package/model, from Cognos
Connection. All others are denied access,
although they can still view saved report
output. Note: they cannot set properties
(including permissions), or edit the entry in
Cognos Connection. These access rights
must be assigned through Cognos
Connection.

© 2003, Cognos Incorporated 6-9


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Set Object Visibility

ƒ Specify which users, groups, and roles have visibility rights to the
object and deny access for all other users, groups, and roles.

Additional Information
• By default, every object in your project is visible to everyone. When
Set object visibility - for example, in your
you set object visibility you add object-based security by specifying project, you may have a Sales reps query
which users, groups, or roles will be able to see the object in a run- subject. You can make the Sales reps
time model. query subject visible to the Sales Managers
group, and keep it hidden from everyone
• Every time you include that object in a package, and publish it for else.
report authors, the same security rules apply for that object. When If object-based security is not used,
you publish a package that contains secured objects, the visible security applied to a package remains
objects for ReportNet users are the intersection of the package unchanged.
definition and the object security settings.
When you secure an object, a special type
of package is automatically created in
Framework Manager. The package name
consists of an underscore (_) and the name
of the secured object. These object-based
security packages are visible in the Object
Explorer. You can use this package to see
which objects in the project are included,
hidden, or excluded from a specific user
group. They cannot be edited or published.
They can be removed. To see a list of the
object-based packages, double-click the
Packages folder. The list appears in the
Object Explorer View. To see which objects
are secured against that specific object-
based package, right-click the package,
and click Explore Packages.

6-10 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
SET SECURITY IN FRAMEWORK MANAGER

Define Security Filters Additional Information


In the slide example, we know that the
countries, in which our company sells its
products, are categorized into two markets;
ƒ Create a security filter to restrict the data returned by a query large and small. We have created two
subject. Cognos namespace groups called Large
Market and Small Market. Each group
consists of users/reps from countries
defined as being either in the large or small
markets. We then apply a security filter to
the Orders query subject, where each
group will only see orders data as defined
by the filter expression. In the first
expression, a user/rep belonging to the
large market group will only be able to see
data where the Country code is “in” 2 =
Germany, 16 = Australia, 6 = Italy. A rep
Major Market Small Market
from the small market group will only be
able to see data where the Country code is
any other code besides (“not in”) 2, 16, 6. If
a user belongs to more than one of the
groups specified by the security filter then
they will have a union of the data
• A security filter controls the data that is shown to report authors restrictions as specified by the individual
when they set up their reports. filter expressions. Using the slide example,
if a user belongs to both the Major Markets
and Small Markets groups, then they would
• When you create a security filter, you apply it to a query subject, and see all of the data for every country, as
then add the groups and roles, to which the security filter will be defined by the two filter expressions.
applied.
It is also important to note that the behavior
of the security filter is such that if a user
• For each group/role, you can create a filter expression that will be
does not belong to any of the groups
used to filter data for that group/role. specified in the security filter, then they will
have unrestricted access to the data,
• You can base the security filter on existing security filters. If you regardless of the restrictions specified by
choose this option, the new security filter inherits the existing filter, the combined filter expressions. In some
and all its properties. cases you may want to avoid this scenario
and completely restrict access to data for
particular group(s). To achieve this, you
can create a filter expression that is of type
boolean and that will always resolve to a
false outcome. Again, using the slide
example, you could create a filter
expression as: CountryCode = -1 (-1 does
not exist as a CountryCode in the data).
This expression will always resolve to
False. You could then specify the groups,
to which this filter expression will be
applied. The result is that a user who is a
member of the defined group(s) for this
filter expression, will be denied access to
the data.

When you create a security filter, you can


also use existing project filters, or create
new filters using the expression editor.

© 2003, Cognos Incorporated 6-11


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Manage Package Administrative Access

ƒ Give administrative access to packages for users who are required to:
ƒ republish packages
ƒ perform impact analysis

• When you apply administrative access to a package, you give access to Additional Information
the user(s) who are required to: Republishing is defined as the ability to
republish a package to the ReportNet
• republish a package to the ReportNet server server after it has been initially published.
After the first publish, the user who
performed the publish, has ownership of
• ensure that no reports are impacted when a Framework Manager the package and is the only user with
package is republished to the ReportNet server administrative rights to it, including the
ability to republish it. For other users to be
• By default, when you publish a package, the user or group with the able to republish this package, the owner
must assign administrative access to the
administrative role for reporting will be added in the Package package.
Administrator Access dialog box.
Users with administrative access to the
package can perform an Impact Analysis. If
you have updated a package, you can
analyze the effects of the changes you
made before deploying the new package to
the report authors. You can compare a
selected package with a published package
of the same name to show changes
between the packages that could affect any
reports based on the package. You can
see details on each change, and which
reports are affected by a specific selected
change. You can also select a specific
query item and see which reports are
dependant on it. With a package selected
in the Project Viewer, from the Actions
menu, click Analyze Publish Impact.
Note: The package you select must be a
published package.

6-12 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
SET SECURITY IN FRAMEWORK MANAGER

Demo 6-1

ƒ Apply Package Security

© 2003, Cognos Incorporated 6-13


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 6-1: Apply Package Security

Purpose:
We want to ensure that report authors only have access to
the presentation layer of GO Model, rather than both the
database and presentation layers. To this end, we will limit
access to the GO Model package (which contains both a
database layer and a presentation layer) to members of the
System Administrators role. We will then limit access to the
Sales Reps package (which only has a presentation layer)
to members of the Authors role. Lastly, we will view the
results in Query Studio by logging in first as a system
administrator and then as a report author.

Task 1. Limit access to the GO Model package to


system administrators.
1. In the Project Viewer pane, expand Packages, right-click GO
Model, and then click Edit Package Access.
The Package Access dialog box appears. At this point, all users have
access to the package. We want to ensure that only members of the
System Administrator role have access to the metadata in this
package. Therefore, we have to remove the Everyone group from the
list.
2. Ensure that the Everyone group is selected, and then click Remove.
The Everyone group is removed from the list.
3. Click Add.
The Select Users and Groups dialog box appears.

6-14 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
SET SECURITY IN FRAMEWORK MANAGER

4. Click Cognos, select the System Administrators check box, and


then click Add.
The result appears as shown below:

5. Click OK, and then click OK again.


Task 2. Limit access to the other packages to report
authors.
1. Right-click the Sales Reps package, and then click Edit Package
Access.
The Package Access dialog box appears. At this point, all users have
access to the package. We want to ensure that only members of the
Authors role (or higher) have access to the metadata in this package.
Therefore, we have to remove the Everyone group from the list.
2. Click Remove.
The Everyone group is removed from the list.
3. Click Add.
The Select Users and Groups dialog box appears.

© 2003, Cognos Incorporated 6-15


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

4. Click Cognos, select the Authors check box, and then click Add.
The result appears as shown below:

5. Click OK, and then click OK again.


6. Right-click the Packages folder, and then click Explore Packages.
The Explore Packages dialog box appears.
7. Click the Roles Explorer tab, and then expand Authors and System
Administrators.
We can see the packages that are accessible to members of both the
Authors and System Administrators roles.
8. Click Close, and then save the project.
Task 3. Test security settings in Query Studio.
1. Publish the GO Model package.
2. Publish the Sales Reps package.
3. In Cognos Connection, click Log Off, and then click Log on again.

6-16 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
SET SECURITY IN FRAMEWORK MANAGER

4. In the User ID box, type admin_person, and then in the Password


box, type admin1234.
The admin_person user is a member of the System Administrator
role. As a result, this user will have access to the GO Model package.
In addition, because the System Administrator role, within the
Cognos namespace, encompasses the Authors role, this user will be
able to see the Sales Reps package.
5. Open Query Studio.
Both the GO Model and the Sales Reps packages are visible.
6. Click Cancel, click Log Off, and then click Log on again.
7. In the User ID box, type report_author, and then in the Password
box, type ra1234.
The report_author user is a member of the Authors role. As a result,
this user will not have access to the GO Model package. However,
they will have access to the Sales Reps package.
8. Open Query Studio.
The Sales Reps package is visible; however, the GO Model package is
not visible.
9. Click Cancel, and then leave Cognos Connection and Framework
Manager open for the next demo.

Results:
We limited access to the GO Model package to members of
the System Administrators role. We then limited access to
the Sales Reps package to members of the Authors role.
Lastly, we viewed the results in Query Studio by logging in
first as a system administrator and then as a report author.

© 2003, Cognos Incorporated 6-17


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 6-2

ƒ Apply Data Security

6-18 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
SET SECURITY IN FRAMEWORK MANAGER

Demo 6-2: Apply Data Security

Purpose:
Sales managers at The Great Outdoors Company want to
ensure that Camping Equipment sales reps only see orders
data for the Camping Equipment product line. We will create
and add members to the Sales Managers and Camping
Equipment Reps groups. We will grant these groups access
to the Orders and Products package. We will then apply a
security filter to the Products query subject to restrict
access to product line data. We will publish the Orders and
Products package and view the results in Query Studio.

Task 1. Create the Sales Managers and Camping


Equipment Reps group and grant access to the
Orders and Products package.
1. In the Project Viewer pane, in the Packages folder, right-click Orders
and Products, and then click Edit Package Access.
2. Click Everyone, click Remove, and then click New.
The New Cognos Group dialog box appears.
3. In the Name box, type Camping Equipment Reps, and then click
Next.
4. Click Add, select the Show users in the list check box, and then
click Local NT.
5. Select Allessandra Torta, click Add, and then click OK.
6. Click Finish.
7. Click New, and then repeat steps 3 to 6 to create the Sales
Managers group and add Alex Rodriguez as a member.
8. Click Add, click Cognos, and then select Camping Equipment
Reps and Sales Managers.
9. Click Add, click OK, and then click OK again.
Task 2. Create a security filter.
1. In the Project Viewer pane, ensure that the Presentation Layer and
Product Information folders are expanded, right-click Products,
and then click Specify Security Filters.
The Security Filters dialog box appears.
2. Click Add Groups.
The Select Users and Groups dialog box appears.
3. Click Cognos, select Camping Equipment Reps, and then click
Add.

© 2003, Cognos Incorporated 6-19


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

4. Click OK, and then in the Filter column, click Insert From Model.
The Select a Filter dialog box appears.
5. Expand the Presentation Layer and Product Line Filters folders,
click the Camping Equipment filter, and then click OK.
The result appears as shown below:

6. Click OK, and then save the project.


Task 3. Publish the Orders and Products package and
view the results in Query Studio.
1. Publish the Orders and Products package, and then, in Cognos
Connection, click Log Off.
2. Click Log on again, in the User ID box, type arodriguez, and then
in the Password box, type password.
3. Click OK, and then open Query Studio.
Orders and Products is included in the list of available packages.
4. Click Orders and Products, expand Orders, and then double-click
Product Name and Quantity.
5. Expand Products, and then drag and drop Product Line to the left
of the Product Name column.

6-20 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
SET SECURITY IN FRAMEWORK MANAGER

6. Click Page Down 4 times.


Notice that Alex Rodriguez can see product quantities for all product
lines, because he is a member of the Sales Managers group.
7. Save the report as Demo 6-2, and then click Return.
8. In Cognos Connection, log off and then log on with a User ID of
atorta and a password of password.
9. Click Public Folders, click Orders and Products, and then click
Demo 6-2.
The report runs and opens in Query Studio.
10. Click Page Down.
Due to the security filter placed on the Camping Equipment Reps
group, of which Allesandra Torta is a member, only product
quantities from the Camping Equipment product line are shown in
the report. The result appears as shown below:

© 2003, Cognos Incorporated 6-21


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

11. Click Cognos Connection.


12. Leave Cognos Connection and Framework Manager open for the
next demo.

Results:
We created and added members to the Sales Managers and
Camping Equipment Reps group. We granted these groups
access to the Orders and Products package. We then
applied a security filter to the Products query subject to
restrict access to product line data. We published the
Orders and Products package and viewed the results in
Query Studio.

6-22 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
SET SECURITY IN FRAMEWORK MANAGER

Demo 6-3

ƒ Apply Object-Based Security

© 2003, Cognos Incorporated 6-23


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 6-3: Apply Object-Based Security

Purpose:
We only want sales managers to be able to view the
projected sales targets for each sales rep. We will grant
access to the Sales Reps package to the Camping
Equipment Reps and Sales Managers groups. Then we will
grant visibility rights for the Sales Targets query subject to
the Sales Managers group only. Lastly, we will re-publish
the Sales Reps package and view the results in Query
Studio.

Task 1. Grant access to the Sales Reps package.


1. In the Project Viewer pane, under Packages, right-click Sales Reps,
and then click Edit Package Access.
2. Click Authors, and then click Remove.
3. Click Add, click Cognos, and then select Sales Managers and
Camping Equipment Reps.
4. Click Add, click OK, and then click OK again.
Task 2. Grant visibility rights, and then republish the
package.
1. Expand the Sales Rep Information folder, right-click the Sales
Targets query subject (not the Sales Target query item), and then
click Give visibility rights.
The Select Users and Groups dialog box appears.
2. Click Cognos, select Sales Managers, and then click Add.
3. Click OK.
A message appears, indicating that the Sales Target query subject will
be hidden to everyone else.

6-24 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
SET SECURITY IN FRAMEWORK MANAGER

4. Click OK.
A message appears, indicating that the Sales Rep package has been
updated.
5. Click OK, and then save the project.
6. Republish the Sales Reps package.
Task 3. View the results in Query Studio.
1. In Cognos Connection, click Log Off, and then click Log on again.
2. In the User ID box, type arodriguez, in the Password box, type
password, and then click OK.
Alex Rodriguez is a branch manager at The Great Outdoors
Company, and is member of the Sales Managers group.
3. Open Query Studio, and then click the Sales Reps package.
The Sales Targets query subject is visible in the left pane, due to the
visibility rights that we specified in Task 2.
4. Click Return, click Log off, and then click Log on again.
5. In the User ID box, type atorta, in the Password box, type
password, and then click OK.
Allessandra Torta is a Level 3 Sales Representative at The Great
Outdoors Company and is a member of the Camping Equipment
Reps group.
6. Open Query Studio, and then click the Sales Reps package.
The Sales Targets query subject is not visible in the left pane, due to
the visibility rights that we specified in Task 2.
7. Click Return, click Log off, and then leave Cognos Connection and
Framework Manager open for the upcoming workshop.

Results:
We granted access to the Sales Reps package to the
Camping Equipment Reps and Sales Managers groups. We
then granted visibility rights for the Sales Targets query
subject to the Sales Managers group only. Lastly, we re-
published the Sales Reps package and viewed the results in
Query Studio.

© 2003, Cognos Incorporated 6-25


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Summary

ƒ In this module, we have:


ƒ examined the ReportNet security environment
ƒ created and applied security filters
ƒ restricted access to query subjects and query items
ƒ restricted access to packages

6-26 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
SET SECURITY IN FRAMEWORK MANAGER

Workshop 6-1

ƒ Create Country-Specific Security Filters

© 2003, Cognos Incorporated 6-27


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 6-1: Create Country-Specific Security


Filters
Sales managers at The Great Outdoors Company want to ensure that sales
reps only see data that applies to retailers in their particular region. For
example, sales reps based in Italy should only see data regarding Italian
retailers. Your task is to create security filters that apply to specific countries.

To accomplish this:

• Create a Cognos group called Italy, and add Allessandra Torta (from
the Local NT namespace) to this group. Create a second Cognos
group called United States, and add Alex Rodriguez (from the Local
NT namespace) to this group.

• Modify visibility rights for the Database Layer folder under GO


Model. Ensure that only members of the System Administrators
group can see this folder in Query Studio and Report Studio. Then
embed a security filter to the Retailers query subject that applies to
the Italy group. This embedded filter will exclude all values from the
[Retailers].[Country] query item other than Italy.

• Embed a security filter to the Retailers query subject that applies to


the United States group. This embedded filter will exclude all values
from the [Retailers].[Country] query item other than United States.

• Open Query Studio, and then log in as Allessandra Torta. Create a


report that includes the Country and Company Name query items
(from the Retailer Information folder). Save the report as Wkshp 6-
1a. Log out, and then log in as Alex Rodriguez. Create a second
report that also includes the Country and Company Name query
items. Save the report as Wkshp 6-1b.

For more detailed information outlined as tasks, see the Task Table on the
next page.

For the final query results, see the Workshop Results section that follows the
Task Table.

6-28 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
SET SECURITY IN FRAMEWORK MANAGER

Workshop 6-1: Task Table


Task Where to Work Hints
1. Create and add a member Package Access dialog box • Add Allessandra Torta
to the Italy group and the (from Local NT namespace)
United States group, and New Cognos Group dialog to the Italy group.
then grant access to the box
• Add Alex Rodriguez (from
GO Model package.
the Local NT namespace) to
the United States group.
2. Limit access to the Select Users and Groups • Give visibility rights for the
database layer and create a dialog box Database Layer folder to
security filter for Italy. system administrators only.
Security Filters dialog box
• Add a security filter for the
Filter Definition dialog box Italy group to the Retailers
query subject (in the Retailer
Information folder). Use the
following formula:
[GO Model].[Retailers].
[Country]='Italy'

3. Create a security filter for Select Users and Groups • Add a security filter for the
the United States. dialog box United States group to the
Retailers query subject (in the
Filter Definition dialog box Retailer Information folder).
Use the following formula:
[GO Model].[Retailers].
[Country]='United States'

• Save the project.


4. View the results in Query Query Studio • Re-publish the GO Model
Studio. package.
• Log in (User ID: atorta,
Password: password).
• Add the Company Name
and Country query items,
and then save as Wkshp 6-
1a.
• Log in as Alex Rodriguez
(User ID: arodriguez,
Password: password).
• Add the Company Name
and Country query items,
and then save the report as
Wkshp 6-1b.
If you need more information to complete a task, see the Step-by-Step
instructions for this exercise in Appendix A.

© 2003, Cognos Incorporated 6-29


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 6-1: Results


When complete, the Wkshp 6-1a report appears as shown below:

When complete, the Wkshp 6-1b report appears as shown below:

6-30 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
7

1. Introduction to Framework Manager


2. Design and Create a Project
3. Prepare the Metadata
4. Prepare the Business View
5. Manage Packages
6. Set Security in Framework Manager
7. Manage Projects
8. Use Advanced Modeling Techniques

Cognos ReportNet – Metadata Modeling


COGNOS REPORTNET – METADATA MODELING

7-2 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

Objectives

ƒ In this module, we will:


ƒ implement repository control
ƒ segment and link a model
ƒ examine action logging and project synchronization
ƒ check a project

© 2003, Cognos Incorporated 7-3


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Framework Manager Workflow

Data
Sources

Import

Create and
Design/Create Prepare Model Enhance Manage
Manage
Project for Reporting Model Packages Project

Set
Publish
Security

Report Studio
Query Studio Content
Store

• You can perform many project management activities at any point in


the modeling process. By performing these activities, you can:

• enable multiuser modeling

• share and reuse project information

• verify the project for errors or problems

7-4 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

Use Repository Control

ƒ Use repository control to implement multiuser modeling and help


manage your projects.
ƒ Use Framework Manager to:
ƒ connect to VSS or CVS
ƒ check in and check out a project
ƒ get the latest version of a project
ƒ view project history

• Use repository control to help manage your projects in Framework


Manager.
Additional Information
• You control versions of a project to ensure that each version of a file
Repository control also ensures that users
is recoverable. You can use Framework Manager to: in a large organization have access to the
most recent changes or versions of a
• connect to a Visual SourceSafe (VSS) or Concurrent Version project or segment.
System (CVS) repository

• check in and check out a project

• get the latest version of a project

• view project history

© 2003, Cognos Incorporated 7-5


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Set Up Repository Control

ƒ To set up repository control, perform the following tasks:


ƒ create the repository
ƒ set up the path to the repository
ƒ configure a connection to the repository
ƒ add the project to the repository
ƒ Once the repository connection has been established, you can
modify or delete it through the connection manager.

• The following task must be performed to set up repository control in


Framework Manager:

• create the repository – install and configure VSS or CVS

• set up the path to the repository – use Cognos Configuration to


specify the repository type and configure the path
Additional Information
• configure a connection and add projects to the repository from
You can add a project to the repository on
Framework Manager its initial creation or later.

You can manage repository connections


from the Repository Connection Manager
dialog box in Framework Manager.

7-6 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

Demo 7-1

ƒ Create a Project and Implement


Repository Control

© 2003, Cognos Incorporated 7-7


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 7-1: Create a Project and Implement


Repository Control

Purpose:
As part of the task of enabling multiuser modeling in
Framework Manager, we will implement repository control
for a project. We will create a project, create a connection to
the repository, and then add the project to the repository.
We will then complete the Design and Create phase of the
workflow for this project by importing metadata.

Task 1. Create a project.


1. From the File menu, click New Project. Instructional Tips
Inform students that this project is being
The New Project dialog box appears. created so that it can be used as the
master project in Demo 7-2 – Link to a
2. In the name box, type GO Sales and Retailers Master, and then
Project.
click OK.
The Select Languages dialog box appears. We will set the default and
design language for this project as English.
3. Ensure that English(United States) is selected, and then click OK.
4. Click Cancel to close the Import Wizard.
The GO Sales and Retailers project opens in Framework Manager.
Task 2. Create a connection to the repository.
1. From the Repository menu, click Connection Manager.
The Repository connection manager dialog box appears.
2. Click New.
The Repository connection properties dialog box appears.
3. In the Name box, type LocalCVS, and then in the Type list, click
SCCS://.
A description of the path to repository appears in the first row under
the description column.
4. Click in the first row under the Value column, and then type
C:\CVS.
5. Click Test.
A message appears indicating that the test was successful.
6. Click OK to close the message box, click OK again to close the
Repository connection properties dialog box, and then click Close to
close the Repository connection manager dialog box.

7-8 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

7. Save the project.


Now that we have created and tested the connection to the
repository, we will add the project to it.
Task 3. Add the project to the repository. Instructional Tips
At this point, you could have students
1. From the Repository menu, click Add Project to Repository. navigate to the CVSROOT folder in
Windows Explorer at C:\CVS\CVSROOT to
The Add to Repository dialog box appears. view the project files.
2. Ensure that LocalCVS appears in the Connection box, and that
CVSROOT appears in the Location in repository box, and then click
OK.
The Project Viewer appears as shown below.

Notice the repository icon beside the GO Sales and Retailers


Master project icon . This icon indicates that the project is now
under repository control.
We will now complete the Design and Create Project phase of the
workflow by importing metadata.
Task 4. Import metadata and organize objects.
1. In the Project Viewer pane, right-click the Model namespace, and Additional Information
then click Import Metadata. We are importing metadata at this point
because we will be using this project/model
A message box appears indicating that the project is under repository in the next demo. The next demo involves
control and has read-only attributes. It also prompts us to check out creating another project/model and then
the file. linking the two.

2. Click OK.
3. In the Import Wizard, ensure Database is selected, and then click
Next.
4. Click GOSL, click Next, and then select the Tables check box.

© 2003, Cognos Incorporated 7-9


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

5. Click Next, click Import, and then click Finish.


The Project Viewer appears as shown below:

Notice the icon beside the GO Sales and Retailers Master


project icon . This icon now indicates that the project is checked
out of the repository. Also notice that the root namespace is now
called GOSL. We will rename this namespace and organize the
imported objects
6. In the Project Viewer pane, rename the GOSL root namespace to
GO Sales and Retailers.
7. Right-click the GO Sales and Retailers namespace, point to Create,
and then click Folder.
8. Name the folder Database View, and follow the wizard to create the
folder without adding objects to it.
9. Right-click the Database View folder, point to Create, and then
click Namespace.
10. Rename the New Namespace to GOSL.

7-10 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

11. Select all of the query subjects within the root GO Sales and
Retailers namespace, and then drag them into the GOSL
namespace.
The Project Viewer appears as shown below:

12. Save the project.


13. Leave the GO Sales and Retailers Master project open for the next
demo.

Results:
We enabled multiuser modeling in Framework Manager by
implementing repository control for a project. Specifically,
we created a project, created a connection to the repository,
and then added the project to the repository. We also
completed the Design and Create phase of the workflow for
this project by importing metadata.

© 2003, Cognos Incorporated 7-11


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Create a Segment

ƒ Create a segment so that you can:


ƒ organize a project according to business rules and organizational
requirements
ƒ distribute responsibility
ƒ share and reuse project information
ƒ Points to remember:
ƒ a segment is a new project complete with its own associated
project files
ƒ segment at the folder or namespace level
ƒ you can link segments to other projects

Additional Information
Organize the project according to
organizational requirements or business
rules. For example, you have a project
• You can create a segment so that you can: named GoSales. You can create two
folders, one named Products and the other
named Orders. You can divide the GoSales
• organize a project according to organizational requirements, for project at the Products folder and at the
example, human resources, sales, and finance, or according to Orders folder.
business rules
Distribute responsibility. For example, the
project Inventory contains the folder
• distribute responsibility for the modeling process amongst
Products. You can segment the Products
multiple groups according to areas of expertise folder to allow other modelers to work on
that segment. If any changes or additions
• share and reuse project information to avoid duplication of work are made to the Product folder segment,
they will be reflected in the Inventory
• When you create a segment, you create a new project in a new folder, project.
complete with its own associated project files. When you work with a main project and
segments in the main project, there are
• You segment a project either at the folder or namespace level. things you may want to consider. If you:
• create a master project that
• You can also link the segments to other projects that contain the contains segments, and the
same information to maintain consistency and reuse information. master project is connected to a
repository, any new segments
created are automatically added
to the repository.
• have a project or segment
checked in to a repository and
you make a change, you will be
notified that you must check out
the project or segment before
you can make the change.

Avoid making changes in both the


segment and the main project.

7-12 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

Create a Link

ƒ Create links so that you can:


ƒ organize work across large projects
ƒ maintain consistency
ƒ reuse information
ƒ You can only create links to:
ƒ folders
ƒ namespaces
ƒ projects, or segments

Additional Information
• A link is a shortcut to an existing project, folder, or namespace.
For example, the project Inventory contains
the folder Products. You can create a link
• You must create the project, folder, or namespace, before you can from the GoSales Products to Inventory
link to it. You can create links only to: Products. If any changes or additions are
made to the Inventory Products folder, they
• folders will be reflected in the GoSales Products
folder.
• namespaces
• projects or segments Links are defined in the .cpf file of the
project that owns them. For example, you
have a project and you have a link from the
main project to the segment. The main
project owns the link between the main
project and the segment. You can find that
link in the main project’s .cpf file.

© 2003, Cognos Incorporated 7-13


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Segmenting and Linking Best Practices

Additional Information
ƒ Follow these best practices when creating segments and links:
You can use synchronizing and action
ƒ link to relatively static segments logging to revert to earlier versions of the
main project or a segment.
ƒ the namespace in the main project and any links in the project to
folders must have the same identifier Note to Instructor: consider using a white
ƒ all objects in a project must have unique identifiers board or flip chart to explain the examples
below.
ƒ update references in both the segment and the main project
For example, you have a main project and
ƒ the main project and any segments in the project must have the
a link in the project to a folder that exists in
same languages
another project. The folder you link to must
exist in a namespace that has the same
name as the main project. If the identifier in
the main project and that of the linked
folder are not the same, any relationships,
shortcuts, or expressions that reference
objects in the link, from the main project,
may not work.

• There are some best practices for using segmenting and linking to For example, you have a main project that
minimize complexity and ensure stability in a multiuser modeling contains a query subject named NewQS,
and a segment in the project. You open the
environment. segment, add a new query subject named
NewQS, and save the segment. When you
open the main project, an error occurs
because a query subject named NewQS
already exists in the main project.

For example, you have a main project and


a segment in the project. In the main
project, you have a relationship named
qs1_qs2 that exists between query
subject1 and query subject2. The query
subject named query subject 2 is in the
segment. You open the segment, rename
query subject2 to query subject3, and save
the segment. When you open the main
project, an error occurs because the
relationship qs1_qs2 is broken. In
Framework Manager, any object that relies
on a reference, for example, shortcuts,
model query subjects, and expressions,
also would be affected.

For example, you have a main project and


a segment in the project. In the segment,
you have defined the languages English
and French. You open the main model, add
the language Chinese, and save the
segment. When you open the segment, an
error occurs because the language
Chinese is not defined in the segment.

7-14 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

Demo 7-2

ƒ Link to a Project

© 2003, Cognos Incorporated 7-15


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 7-2: Link to a Project

Purpose:
We will create a project and then link the GO Sales and
Retailers Master project to it. Other modelers will be able to
work on the new project. Changes made to this project will
be updated in the master project.

Task 1. Create a project and import metadata.


1. Create a project called GO Retailers.
2. Ensure that the location is C:\Edcognos\CR1052\GO Retailers,
and then click Repository.
The New Project dialog box expands.
3. Under Repository settings, select the Add to repository check box.
4. Ensure that LocalCVS appears in the Connection box, and that
CVSROOT appears in the Location in repository box, and then click
OK.
5. Ensure that the language is English(United States), and then click
OK.
6. Import metadata, (tables only) from the GORT relational database
through the GORT data source.
The GO Retailers project opens in Framework Manager. The Project
Viewer appears as shown below:

7. In the Project Viewer pane, expand the GORT root namespace to


view the imported query subjects, and then save the project.
We will now create a link between the GO Sales and Retailers Master
project and the GO Retailers project.

7-16 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

Task 2. Create a link.


1. From the File menu, click the GO Sales and Retailers Master
project.
A message box appears informing us that the project is already open
and asks if we would like to switch to the open project.
2. Click OK.
3. In the Project Viewer pane, click the Database View folder, and
then from the Actions menu, click Link Segment.
The Link Segment dialog box appears.
4. Navigate to the file location where you saved the GO Retailers
project, click GO Retailers.cpf, and then click Open.
The Link Segment dialog box appears as shown below:

Notice that the GO Retailers project appears as a folder with its


directory path shown. The Root namespace, called GORT, also
appears.
5. Click the GORT namespace, and then click Add.
6. Click OK.

The GORT namespace now appears in the Database View


folder. From the icons that appear, we can see that it is linked to
another project and it is checked out.
7. Expand the GORT namespace.
We can see that the namespace contains all of the query subjects that
were imported into the GORT namespace in the GO Retailers
project.

© 2003, Cognos Incorporated 7-17


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

8. In the Project Info view, click Object diagram, in the Project


Viewer pane, in the GORT namespace, right-click the
ACTIVE_INDICATOR_LOOKUP query subject, and then click
Locate in Object Diagram.
Notice that there are currently no relationships from the
ACTIVE_INDICATOR_LOOKUP and GENDER_LOOKUP
query subjects to other query subjects. We will go to the GO Retailers
project to create relationships for these query subjects, and then
return to the GO Sales and Retailers Master project to view the
update.
9. Save and close the GO Sales and Retailers Master project.
Task 3. Make changes to the linked project and view
the update in the master project.
1. In the Project Info view of the GO Retailers project, click Object
Diagram, in the Project Viewer pane, right-click
RETAILER_SITE, and then click Locate in Object Diagram.
2. In the diagram, right-click RETAILER_SITE, and then click
Create Relationship.
The Relationship Definition – New Relationship dialog box appears.
3. In the Name box, type RETAILER_SITE <--->
ACTIVE_INDICATOR_LOOKUP, and then on the right side of
the dialog box, click the ellipsis next to the Query subject box.
The Select Query Subject dialog box appears.
4. Expand GORT if necessary, click
ACTIVE_INDICATOR_LOOKUP, and then click OK.

7-18 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

5. Modify the relationship so that it appears as shown below:

6. Click OK.
A relationship now exists in the diagram between the
RETAILER_SITE and ACTIVE_INDICATOR_LOOKUP
query subjects.
7. In the Object Diagram, right-click GENDER_LOOKUP, and then
click Create Relationship.
The Relationship Definition – New Relationship dialog box appears.
8. In the Name box, type GENDER_LOOKUP <---> CONTACT,
and then on the right side, click the ellipsis.
The Select Query Subject dialog box appears.
9. In the GORT namespace, click CONTACT, and then click OK.

© 2003, Cognos Incorporated 7-19


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

10. Modify the relationship so that it appears as shown below:

11. Click OK.


A relationship now exists in the diagram between the
GENDER_LOOKUP and CONTACT query subjects.
12. Save the GO Retailers project.
13. Click the project name in the Project Viewer pane, and then from the
Repository menu, click Check In.
The Check In – GO Retailers dialog box appears.
14. In the Description box, type Created relationships, and then click
OK.
15. Close the GO Retailers project.
Task 4. View the updates in the master project.
1. Open the GOSales and Retailers Master project, and then in the
Project Info view, click Object Diagram.
2. In the Project Viewer pane, expand the GO Sales and Retailers
namespace, the Database View folder, and the GORT namespace.

7-20 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

3. Right-click the ACTIVE_INDICATOR_LOOKUP query subject,


and then click Locate in Object Diagram.
The Relationships between ACTIVE_INDICATOR_LOOKUP
and RETAILER_SITE, and GENDER_LOOKUP and
CONTACT now appear in the GO Sales and Retailers Master
project.
4. Leave the GO Sales and Retailers Master project open for the next
demo.

Results:
We created a project and then linked from the GO Sales and
Retailers Master project to the new project. We made
changes to the new project and viewed the updates in the
GO Sales and Retailers Master project. Other modelers can
now work on this project, and changes made will be
updated in the master project.

© 2003, Cognos Incorporated 7-21


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 7-3

ƒ Create a Segment

7-22 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

Demo 7-3: Create a Segment

Purpose:
We will create a segment of the GO Sales and Retailers
Master project. This will allow other modelers to work on
the segment, and changes made to it will be reflected in the
master project.

Task. 1. Segment a portion of the GO Sales and


Retailers Master project.
1. In the Project Viewer pane, right-click the GOSL namespace, and
then click Create Segment.
The Create Segment dialog box appears. Notice that this dialog box is
identical to the New Project dialog box. By creating a segment of the
master project we are creating another project on the file system.
2. In the Project name box, type GO Sales.
3. Ensure that the location is C:\Edcognos\CR1052\GO Sales.
The segment will be created as a new project within its own directory.
As well, notice that the Add to repository check box is selected by
default.
4. Ensure that CVSROOT appears as the root folder in the Location in
repository box.
5. Click OK.

The GOSL namespace now appears with icons indicating


that it is segmented and that it is checked out.
We will now make a change in the segmented project, now called GO
Sales, and then view it in the GO Sales and Retailers Master project.
Before we do that, we will make note of the current state of the GO
Sales and Retailers Master project.
6. Expand the GOSL namespace.
Notice that the GOSL namespace contains a query subject called
PRODUCT_MULTILINGUAL and one called PRODUCT. In the
segmented project, we will merge these query subjects into one, and
then return to the master project to view the update.
7. Save and close the GO Sales and Retailers Master project.

© 2003, Cognos Incorporated 7-23


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 2. Make changes to the segmented project and


view updates in the master.
1. Open the GO Sales project from the directory specified in Task 1,
step 3.
The Project Viewer appears as shown below:

We have opened the segment as a new project. Notice in the Project


Viewer that the name of the project has been taken from the master
project called GO Sales and Retailers Master.
2. In the Project Viewer pane, rename the GO Sales and Retailers
Master project object to GO Sales.
3. In the Project Viewer pane, expand the GOSL namespace, and then
Ctrl+click the PRODUCT_MULTILINGUAL and PRODUCT
query subjects.
4. Right-click the PRODUCT query subject, and then click Merge in
New Query Subject.
A new query subject called
PRODUCT_PRODUCT_MULTILINGUAL appears in the Project
Viewer under the GOSL namespace.
5. Delete the PRODUCT_MULTILINGUAL and PRODUCT
query subjects.
6. When the warning dialog box appears, click OK, and then rename
the PRODUCT_PRODUCT_MULTILINGUAL query subject
to PRODUCT.
7. Save the GO Sales project.
8. Click the project name in the Project Viewer pane, and then from the
Repository menu, click Check In.
The Check In – GO Sales dialog box appears.
9. In the Description box, type Merged query subjects, and then click
OK.
10. Close the GO Sales project.
11. From the File menu, open the GOSales and Retailers Master
project.

7-24 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

12. Expand the GO Sales and Retailers root namespace, the Database
View folder, and the GOSL namespace.
Notice that there is only a single PRODUCT query subject.
13. Save the GO Sales and Retailers Master project, and leave it open
for the next demo.

Results:
We created a segment of the GO Sales and Retailers Master
project. We made changes in the segment and viewed the
updates in the master project. The segment is now available
for other users to work on it. Changes made to the segment
will be reflected in the master project.

© 2003, Cognos Incorporated 7-25


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Examine Action Logging

ƒ Capture, view, and playback actions performed on the project.

Additional Information
• In Framework Manager, you can capture, view, and play back actions
The action log file is an XML file that is
performed on the project. designated by the project or segment
name, date, and time. The log file is stored
• Each sequence of actions that you perform in Framework Manager is in the project or segment logs folder. You
considered a transaction. Each transaction is recorded in the project can simply view a log file or play it back
or segment action log file. entirely to ensure project integrity.

An example of when you might save


• You can choose to play back individual transactions or a combination individual transactions to a script, is if you
of transactions in a log file. You can also save individual transactions are making changes to a project in a test
to a separate log file (script). environment. When it is time to move the
project to production, you can use the
script file to play back every action, or
series of actions, that you performed in the
project in the test environment to create an
identical project in the production
environment.

7-26 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

Synchronize Projects

ƒ Use log files to synchronize a project with changes in the metadata


source.
ƒ All actions performed in the model are replayed. The result is:
ƒ a new project is created
ƒ metadata is re-imported to capture any changes
ƒ the entire modeling process is repeated using updated metadata

Additional Information
• You can use Framework Manager log files to synchronize changes
You cannot synchronize the projects again
made in the metadata source to a project. until additional changes are made and
logged.
• You synchronize your project to create a new project by replaying,
from the log files, all the actions you made in the original project After you save and close a project file,
starting from its initial creation. these changes are added to the log file.
Because every action that you made in
your project is rerun, synchronization may
• You can choose to accept the new changes, and create a new project, take a long time.
or return to the original project. If you accept the new changes, the
original project is deleted. Synchronization can be run only on the
master project or a stand-alone segment.

You cannot synchronize linked projects or


segments in the master project. If the
segments are updated by the linked
project, the synchronization can produce
unpredictable results in the master project.

Before synchronizing a project, ensure that


data source connections have not changed
and that data sources are online. You can
check your connections by testing a few
key query subjects

© 2003, Cognos Incorporated 7-27


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Check a Project

ƒ At any point you can verify for problems in the project, such as:
ƒ invalid relationships
ƒ invalid references
ƒ invalid object definition

Additional Information
• When you verify a project, Framework Manager lists invalid objects
Framework Manager also provides an
and their status, including: option to verify the package objects before
you publish a package to ensure that there
• invalid relationships: are no invalid objects that can break
queries in the published package.
• many-to-many relationships
When you verify the project, model query
subjects will often appear as orphans
• orphaned query subjects (query subjects with no because they may not have relationships.
relationships) In this case they use the relationships of
the referenced data source query subjects.
• multiple relationships (or relationship shortcuts) between
query subjects (or query subject shortcuts)
Invalid references occur when an object
• invalid references – exist when an object references another references another object that no longer
object to which it does not have access. exists in the project.

• invalid object definition – Framework Manager warns you when When you verify a project, Framework
Manager identifies any query subjects,
you change an object so that it cannot be executed. If you
shortcuts, filters, calculations, and
proceed, these are marked as invalid. relationships that were previously marked
as invalid so that you can repair them.

7-28 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

Demo 7-4

ƒ Run a Script to Replay Actions

© 2003, Cognos Incorporated 7-29


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 7-4: Run a Script to Replay Actions

Purpose:
We are currently making some changes to our
project/model in a test environment. Specifically, we will be
adding a Presentation View folder and adding a query
subject to it. We have a corresponding model in a
production environment, but it currently does not contain
the changes we are making. To save us development time,
we will create a script based on the actions performed on
the project/model in the test environment, and then run that
script on the project/model in the production environment
to apply those changes.

Task 1. Model a presentation layer for report authors in


the test environment.
1. In the Project Viewer pane, at the level of the GO Sales and Retailers
root namespace, create an empty folder called Presentation View.
2. Right-click the Presentation View folder, point to Create, and then
click Query Subject.
The New Query Subject Wizard appears.
3. In the Name box, type Products, leave the default selection to define
the data to be used to create the query subject, and then click Finish.
The Query Subject Definition – Products dialog box appears.
4. In the Available model objects pane, expand the GO Sales and
Retailers namespace, the Database View folder, and the GOSL
namespace.
5. Ctrl+click the PRODUCT_FORECAST and PRODUCT query
subjects, and then drag them to the Query Items and Calculations
pane.
All the query items from the PRODUCT_FORECAST and
PRODUCT query subjects appear in the pane.
6. In the Available model objects pane, expand the
PRODUCT_LINE query subject, and then drag and drop the
PRODUCT_LINE_EN query item to the Query Items and
Calculations pane.
7. Repeat step 6 to add the PRODUCT_TYPE_EN query item from
the PRODUCT_TYPE query subject, to the Query Items and
Calculations pane, and then click OK.
The Products query subject now appears within the Presentation
View Folder.

7-30 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

8. Save and close the project.


When we save and close the project, we generate a log file for this
session. We will examine the timestamp for this log file in Windows
Explorer.
9. In Windows Explorer, navigate to C:\Edcognos\CR1052\GO
Sales and Retailers Master\logs, and note the timestamp of the
last log file.
We will now create a script that will be based on the actions recorded
in this log file.
Task 2. Create a script for the creation and population
of the Presentation View folder.
1. Open the GO Sales and Retailers Master project.
2. From the Project menu, click View Transaction History.
The View Transaction History dialog box appears.
3. In the Transactions pane, locate the log file with the timestamp noted
in Windows Explorer, and then expand it to view the transaction
details.
The log includes all the actions we took in the project for the session
defined by the timestamp. This includes the creation and population
of the Presentation View folder. We will now create a script of these
actions.
4. Select the check box next to the last transaction log (as denoted by
the timestamp) to select all the transaction details, and then click Save
as Script.
5. In the Save As dialog box, navigate to C:\Edcognos\CR1052\GO
Sales and Retailers Master\logs, in the File name box, type Create
Presentation View, and then click Save.
6. Click Close.
7. In the Project Viewer pane, expand the GO Sales and Retailers
namespace, and then delete the Presentation View folder.

© 2003, Cognos Incorporated 7-31


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 3. Run the script in the production environment to


recreate the Presentation View folder.
We will now assume that we are in the production environment and
that this is how our model/project currently appears. We will recreate
the Presentation View folder using the script we created in the test
environment so that it appears in the production environment.
1. From the Project menu, click Run Script.
The Run Script dialog box appears.

2. Next to the Script file box, click Browse , and then navigate to
C:\Edcognos\CR1052\GO Sales and Retailers Master\logs.
3. Click Create Presentation View.xml, and then click Open.
All the actions as defined in the script appear under the Actions
column.
4. Ensure that all the check boxes are selected in the Transaction No
column, and then click Run.
A status message quickly appears and then a transaction count
appears in the Transaction details pane.
5. Click Accept.
In the Project Viewer, we can see that the Presentation View folder
has been recreated.
6. Save the GO Sales and Retailers Master project.
7. Click the project name in the Project Viewer pane, and then from the
Repository menu, click Check In.
The Check In – GO Sales and Retailers Master dialog box appears.
8. In the Description box, type Created presentation view in
production, and then click OK.
9. Close the GO Sales and Retailers project, and leave Framework
Manager open for the next demo.

Results:
We made changes to our project/model in a test
environment. We created a script to record those actions,
and we ran that script on our project/model in the
production environment. The result is that all actions taken
on our project/model in the test environment were applied,
and are now reflected in the project/model in the test
environment.

7-32 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
MANAGE PROJECTS

Summary

ƒ In this module, we have:


ƒ implemented repository control
ƒ segmented and linked a model
ƒ examined action logging and project synchronization
ƒ checked a project

© 2003, Cognos Incorporated 7-33


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

7-34 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
8

1. Introduction to Framework Manager


2. Design and Create a Project
3. Prepare the Metadata
4. Prepare the Business View
5. Manage Packages
6. Set Security in Framework Manager
7. Manage Projects
8. Use Advanced Modeling Techniques

Cognos ReportNet – Metadata Modeling


COGNOS REPORTNET – METADATA MODELING

8-2 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
USE ADVANCED MODELING TECHNIQUES

Objectives

ƒ In this module, we will:


ƒ resolve a recursive relationship
ƒ specify dimensional information
ƒ create star schema groupings

© 2003, Cognos Incorporated 8-3


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Examine Recursive Relationships in Framework


Manager

ƒ When you import metadata, Framework Manager displays self–joins


in the diagram, but does not execute them as queries.

Employee Query Subject


Recursive Relationship Employee ID
Between Employee ID Manager ID
and
Manager ID
Phone Number
Ext.

Additional Information
• The self–join must be declared at the data source level for the
The ReportNet samples databases do not
recursive relationship to be displayed in Framework Manager. declare any recursive relationships and
therefore we will not see a recursive
• While you can view the metadata that defines the relationship, you relationship line in the Object Diagram.
cannot edit a recursive relationship in Framework Manager. However, a recursive relationship does
exist in the SALES_STAFF table in the
GOSL database.

8-4 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
USE ADVANCED MODELING TECHNIQUES

Resolve Recursive Relationships

ƒ Use shortcuts to create and modify recursive relationships.

Employee Query Subject


Shortcut to Employee Query
Employee ID
Subject
Manager ID 1..1
Employee ID
Phone Number
1..n
Manager ID
Ext.
Phone Number

Ext.

Recursive Relationship
Can now be edited

Additional Information
• To modify a relationship that exists as a self–join in the data source,
We will resolve the SALES_STAFF table
you can create a shortcut of the query subject and define a recursive relationship in the following
relationship between the original query subject and the shortcut. demo.

• Using the two query subjects in the slide example you can create a
master–detail query based on the same table in the data source.

© 2003, Cognos Incorporated 8-5


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 8–1

ƒ Resolve a Recursive Relationship

8-6 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
USE ADVANCED MODELING TECHNIQUES

Demo 8–1: Resolve a Recursive Relationship

Additional Information
Purpose: In order for the recursive relationship to be
Management would like to create reports of management illustrated in the Object Diagram, the
staff and the sales staff that report to them. We must recursive relationship information would
resolve a recursive relationship that exists within the Sales need to have been created at the database
Staff query subject to achieve this type of report. Although level. It is not in this case.
no recursive relationship is illustrated in the Object
Diagram view, we know that Manager Code relates to Sales
Staff Code.

Task 1. Create a shortcut.


1. In Framework Manager, open the GO Model Module 5 model
located in C:\Edcognos\CR1052.
2. In the Project Info pane, click the Object Diagram link.
3. In the Project Viewer pane, expand the GO Model namespace, the
Database Layer folder, and then the gosales namespace.
4. Right–click the Sales Staff query subject, and then click Locate in
Object Diagram.
5. In the Object Diagram, right–click the Sales Staff query subject, and
then click Create Shortcut.
6. Right–click on the Shortcut to Sales Staff query subject, and then
click Rename.
7. Type Reporting Staff and, then press Enter.
Task 2. Create a relationship to resolve recursive
relationship in Sales Staff query subject.
1. In the Object Diagram, click the Sales Staff query subject, and then
click Ctrl–click the Reporting Staff shortcut.
2. Right–click the Sales Staff query subject, and then click Create
Relationship.
The Relationship dialog box appears.

© 2003, Cognos Incorporated 8-7


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

3. Select Manager Code from the query item list for the Reporting
Staff query subject.
The relationship appears as shown below:

4. Accept the default cardinality and click OK.


Task 3. Create a model query subject based on the
Reporting Staff shortcut.
1. In the Project Viewer pane, in the Presentation Layer folder, create a
new folder below the Sales Rep Information folder called
Managers & Reporting Staff.
2. Right–click the Managers & Reporting Staff folder, point to
Create, and then click Query Subject.
The New Query Subject dialog box appears.
3. In the Name box, type Reporting Staff, and then click Finish.
The Query Subject Definition dialog box appears.
4. In the Available Model Objects pane, expand the GO Model
namespace, the Database Layer folder, and then the gosales
namespace.
5. From Reporting Staff, drag and drop the following query items into
the Query Items and Calculations pane:
First Name
Last Name
Position
Work Phone
Extension
Fax
Email

8-8 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
USE ADVANCED MODELING TECHNIQUES

6. Test the query subject, and then click OK.


7. In the Sales Rep Information folder, create a shortcut of the Sales
Reps query subject.
8. Rename the shortcut to Managers and move it into the Managers
& Reporting Staff folder.
The model appears as shown below:

Task 4. Test recursive relationship in Query Studio.


1. Publish the GO Model package.
2. Open Query Studio, and then select the GO Model package.
3. Expand the Presentation Layer folder, the Sales Rep Information
folder, and then the Managers & Reporting Staff folder.
4. From the Managers query subject, add First name, Last Name
and Position to the work area.
5. Group on First Name, Last Name and Position.

© 2003, Cognos Incorporated 8-9


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

6. From the Reporting Staff query subject, add First Name, Last
Name, Position and Work Phone to the work area.
The result appears as shown below:

We now have a report that displays all managers and the sales staff
that report to them.
7. Save the report as Demo 8–1, click Return, and then leave Cognos
Connection and Framework Manager open for the next demo.

Results:
By resolving the recursive relationship in the Sales Staff
query subject, management can now create reports
displaying managers and the sales staff that report to them.

8-10 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
USE ADVANCED MODELING TECHNIQUES

Specify Dimensional Information

ƒ Dimensional information is used to associate attributes with levels to


ensure proper aggregation and avoid double counting or repeating
values.
ƒ Framework Manager lets
you specify levels, keys,
attributes and hierarchies
for a query subject.

Instructional Tips
Inform the students that from this point on,
in the module, they will be working with the
GOSLDW database, which is the data
warehouse sample database shipped with
ReportNet.
• Dimensions are optionally defined on each query subject and use
only the query items defined therein. The remaining topics are best illustrated in
a data warehouse environment.
• You define keys for each level for query efficiency.
Additional Information
• The measures associated with the levels in your dimensional
Associated measures outside of the query
information may or may not be in the query subject. These measures subject are related through keys.
may be in other related query subjects such as query subjects that
represent fact tables. We will look at this in further detail in this
module.
Instructional Tips
Use PRODUCT_KEY in the slide example
• You can specify the key as a Unique Key only if the key values are as an example of a Unique Key.
unique regardless of their context.
Additional Information
• You may also need to specify composite keys, which are used when For example, the combination of country
two or more query items are required to uniquely identify the level. and city are required to uniquely identify a
city.
• Query Subject dimensional structures are not represented in the
Report Studio and Query Studio user interfaces, as they are intended
for query efficiency and accuracy and not for end–user exposure.

© 2003, Cognos Incorporated 8-11


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Resolve Dimensional Level Ambiguity

Sales Fact Inventory


Levels Fact
Time Key
1..n Product Key
Unit Cost
1..n
Month Key
Unit Price
Closing Balance
Sale Total
Time Dimension
… Time Key
Month Key
1..1 Current Year 1..1
Current Month

Time Dimension
Requires Dimensional Information

• When we query across all three query subjects (Sales Fact, Time Additional Information
Dimension and Inventory Levels Fact), ReportNet will not know In the slide example, we see a conformed
how to roll up the measures from the different fact tables. This will dimension called Time Dimension whose
result in repeating values for the CLOSING_BALANCE measure in relationships are at different levels in the
fact query subjects. The facts from the
the Inventory Levels Fact query subject because it rolls up to the Sales Fact query subject roll up to the Time
MONTH_KEY and not the TIME_KEY. Key where as the fact from the Inventory
Levels Fact query subject rolls up to the
• Because the Sales Fact query items are at a more granular level than Month Key.
the Inventory Levels Fact query items, we need to specify that the
MONTH_KEY be at a higher level than the TIME_KEY. This will
ensure that Closing Balance will roll up correctly.

8-12 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
USE ADVANCED MODELING TECHNIQUES

Demo 8–2

ƒ Specify Dimension Information

© 2003, Cognos Incorporated 8-13


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 8–2: Specify Dimension Information

Purpose:
Report authors have a requirement to report across the
SALES_FACT and INVENTORY_LEVELS_FACT query
subjects through the TIME_DIMENSION query subject. In
order for the appropriate values to be returned, dimension
information must be specified on the TIME_DEMENSION
query subject since it relates to both fact tables at different
levels of granularity.

Task 1. Test data.


1. In Framework Manager, open the GOSLDW Module 8 model
located in C:\Edcognos\CR1052.

2. Publish the GOSLDW Model package.

3. Launch Report Studio, and then select the GOSLDW Model


package.

4. Create a new list report and add the following items:

CURRENT_YEAR from TIME_DIMENSION

CURRENT_MONTH from TIME_DIMENSION

QUANTITY from SALES_FACT

CLOSING_BALANCE from INVENTORY_LEVELS_FACT

5. Group the report on CURRENT_YEAR and


CURRENT_MONTH, and then total on QUANTITY and
CLOSING_BALANCE.

8-14 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
USE ADVANCED MODELING TECHNIQUES

6. Run this report and view the data.

Notice that the CLOSING_BALANCE values repeat as shown


below:
Additional Information
Since ReportNet does not know how to
aggregate the values appropriately from
both fact tables, it sums the
CLOSING_BALANCE values for all records
and displays them for every row. Hence the
repeating rows.

The value 53,476,272 represents the grand total of


CLOSING_BALANCE, and not the values for the individual
months.

7. Save this report as Demo 8–2, and then close Report Studio.

Task 2. Specify dimension information.


1. In the Project Viewer pane, expand the Database Layer folder.
2. Right–click the TIME_DIMENSION query subject, and then click
Specify Dimension Information.
The Dimension Information dialog box appears.
3. From the Available items pane, drag and drop the MONTH_KEY
and the TIME_KEY into the Levels pane.
4. From the Levels pane, drag and drop the MONTH_KEY query
item into the Hierarchies pane.
5. From the Levels pane, drag and drop the TIME_KEY query item
into the Hierarchies pane, below the MONTH_KEY query item.

© 2003, Cognos Incorporated 8-15


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

6. In the Levels pane, select MONTH_KEY, and then select the Additional Information
Unique Key check box. Do the same for TIME_KEY. If asked why the CURRENT_MONTH and
CURRENT_YEAR are attributes of
7. In the Levels pane, select MONTH_KEY. MONTH_KEY, the MONTH_KEY in this
example is unique and represents a year
8. From the Available items pane, drag and drop the and month combination. That is why both
CURRENT_YEAR and CURRENT_MONTH items into the the CURRENT_YEAR and
Attributes pane. CURRENT_MONTH query items are
associated with it.
The result appears as shown below:

9. Click OK.
The TIME_DIMENSION query subject now has a cube displayed
on it as shown below.

10. Publish the GOSLDW Model package.

8-16 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
USE ADVANCED MODELING TECHNIQUES

Task 3. Test dimension information.


1. Open Cognos Connection, and then click the Public Folders tab.
2. Click the GOSLDW Model link to open the package.
3. Click the Demo 8–2 link to run the report you created in Task 1.
Notice that the CLOSING_BALANCE values now appear correctly
as shown below:

If we navigate to the bottom of the report, we will see 53,476,272 as


the grand total value for CLOSING_BALANCE.
4. Click Return, and then leave Cognos Connection and Framework
Manager open for the next demo.

Results:
We have successfully specified dimension information
telling ReportNet how to aggregate values at different levels
of granularity.

© 2003, Cognos Incorporated 8-17


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Specify Dimensional Information – Best


Practices

ƒ Ensure that keys and other identifiers have their usage specified as
identifier. This makes the model more intuitive.
ƒ When a surrogate key is available for a level, use it as the level key
and treat the business key as an attribute (which still should be set as
an identifier).
ƒ Use the item you would use in reporting as the level, and the id
(forms one end of a relationship) as the key for the level (remember
to reflect this in the prompt info for the sake of query efficiency) for
modeler clarity.
ƒ For each level, associate any query items that are specific to that
level.

• It is also recommended to specify dimensional information for all


conformed dimensions.

8-18 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
USE ADVANCED MODELING TECHNIQUES

Examine Star Schemas

Dimension Dimension
1 2
1..1 1..1

1..n 1..n

Fact Table
1..n 1..n

1..1
1..1

Dimension Dimension
4 3

• A star schema is created at the data source level and usually in a data
warehouse scenario.

• Fact tables have keys related to each of the dimension rows of data
for each dimension combination.

• Fact tables contain numbers you are trying to measure, such as


revenue or quantity.

• Dimensions describe the way you would report the measures, such as
by time or product.

© 2003, Cognos Incorporated 8-19


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Examine Conformed Dimensions

ƒ A conformed dimension has relationships to more than one fact table.

Product
Dimension
1..1 1..1
1..n 1..n

Sales Inventory
Fact 1..n 1..n
Levels Fact
1..1 1..1

Time
Dimension

• In the slide example, both the Sales Fact and Inventory Levels Fact Additional Information
query subjects contain time–based and product–based facts. This can For example, which relationships would be
create ambiguous relationships and incorrect results when querying used when querying both Product
across multiple query subjects. Dimension and Time Dimension?

8-20 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
USE ADVANCED MODELING TECHNIQUES

Manage Star Schemas in Framework Manager

Sales Fact Namespace Inventory Levels Fact Namespace

Product Product
Dimension Dimension
1..1 1..1

Sales 1..n 1..n


Inventory
Fact 1..n
1..n Levels Fact
1..1 1..1

Time Time
Dimension Dimension

• You can use star schema groupings in Framework Manager to ensure


the desired relationships are used in multi–query subject queries.
Additional Information
• When you create star schema groupings in Framework Manager, you
In the slide example, if you queried across
can create views in a new namespace where there is only one fact Product Dimension and Time Dimension in
query subject and its related dimensions. the Sales Fact Namespace, you would
ensure that the Sales Fact query subject is
• You may move the actual objects to this namespace or use shortcuts. used to link the two dimensions.
Shortcuts are the recommended choice and best practice.

© 2003, Cognos Incorporated 8-21


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Examine Multi–Fact Queries

Product
Dimension
1..1 1..1
1..n 1..n

Sales Inventory
Fact 1..n 1..n
Levels Fact
1..1 1..1

Time
Dimension

• What occurs when you query across fact tables through a conformed
dimension as in the case of Sales Fact, Time Dimension and
Inventory Levels Fact?

• Cognos ReportNet handles this by executing a stitch query.

8-22 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
USE ADVANCED MODELING TECHNIQUES

Examine Stitch Queries

ƒ Stitch queries send two separate queries to the data source and then
merge them locally.
ƒ The SQL generated contains syntax such as:
ƒ coalesce
ƒ full outer join

Report Output
Database ReportNet
D1 D2 F1 F2

Query 1 A Y1 300 $18


Stitch Queries
Together B Y2 $22
Query 2
C Y3 456 $45

• In the event of cross fact table queries, ReportNet will send two
separate queries to the data source, one for each fact table. It will
retrieve two record sets, which will be merged locally by stitching
together the common dimensional records returned in each record
set.
Additional Information
• If you view the SQL generated for such a query, you will see a
We will look at stitch query SQL in the
function called coalesce, which is used to merge the queries together, following demo.
and also see a full outer join. Full outer joins are usually a cause for
concern since they are resource intensive. This full outer join is As seen in the slide example, D1 and D2
actually executed locally by the ReportNet server in a very efficient represent data from a conformed
method and not at the data source level. dimension. F1 represents data from one
fact table and F2 represents data from the
other fact table. As you can see, F1 had no
• If one fact table has a value for a returned dimension row and the value for row B and is therefore left blank,
other does not, you will simply see a blank field in the report. but the value in F2 for row B is not lost.

© 2003, Cognos Incorporated 8-23


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Demo 8–3

ƒ Create Star Schema Groupings and


Examine Stitch Queries

8-24 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
USE ADVANCED MODELING TECHNIQUES

Demo 8–3: Create Star Schema Groupings and


Examine Stitch Queries

Purpose:
Report authors would like to see SALES_FACT and
INVENTORY_LEVELS_FACT data displayed with their
related dimensions in an intuitive manner. There is a
specific requirement to be able to create a report that lets
business analysts compare the closing balance against the
quantity sold for each product for each month.

The star schema grouping we are about to create and


dimension information specified in the previous demo will
allow report authors to easily create this type of report and
return the correct results.

We will also view the SQL syntax of the report created in the
previous demo, which used a stitch query to achieve its
results.

Task 1. Create star schema groupings.


1. In Framework Manager, ensure that the GOSLDW Module 8 Additional Information
model is open. We will not be specifying the complete
dimensional information, but rather just
2. Expand the Database Layer folder. enough to test the MONTH_KEY and
TIME_KEY levels.
3. Right–click INVENTORY_LEVELS_FACT, and then click
Create Star Schema Grouping.
The Create Star Schema Grouping dialog box appears. Additional Information
Leaving the defaults is good for creating a
4. Accept the default selections, and click OK. presentation layer view.
A new namespace appears in the Database Layer folder called
The Create shortcuts only for objects that
INVENTORY_LEVELS_FACT Namespace. are used outside the star schema option
5. Drag and drop INVENTORY_LEVELS_FACT Namespace will create shortcuts only for conformed
dimensions. Since they are still used by
into the Presentation Layer folder. another fact table the original objects are
6. Right–click SALES_FACT, and then click Create Star Schema left in their original place.
Grouping.
The Move the objects in a new namespace
7. Deselect SITE_DIMENSION and STAFF_DIMENSION, and option lets you to keep the same names for
then click OK. the objects, organize them neatly and use
them in the presentation layer if desired.
A new namespace called SALES_FACT Namespace appears.
Instructional Tips
8. Drag and drop SALES_FACT Namespace into the Presentation This would be a good time to show the star
Layer folder. schema groupings in the Object Diagram in
the Presentation Layer folder. This will give
9. Publish the GOSLDW Model package. students a visual of what they have just
created.

© 2003, Cognos Incorporated 8-25


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 2. View and test your star schema groupings in


Report Studio.
1. Maximize Cognos Connection, and then launch Report Studio.
2. Select the GOSLDW Model package.
3. Create a new list report.
4. In the Insertable Object pane, expand the Presentation Layer folder
followed by the SALES_FACT Namespace.
5. Add the following items to the list report:
PRODUCT_NAME from PRODUCT_DIMENSION
CURRENT_YEAR from TIME_DIMENSION
CURRENT_MONTH from TIME_DIMENSION
QUANTITY from SALES_FACT
6. Expand INVENTORY_LEVELS_FACT Namespace, and then
add CLOSING_BALANCE from
INVENTORY_LEVELS_FACT to the list report.
7. Group the report on PRODUCT_NAME, CURRENT_YEAR
and CURRENT_MONTH, and then total QUANTITY and
CLOSING_BALANCE.
8. Select the CLOSING_BALANCE column in the work area, and
then, in the Properties pane, change the Aggregate Function
property for the Fact Item to None.
9. Delete the PRODUCT_NAME summary and the grand total
summary from the report.
The report appears as shown below:

10. Run the report to view the results.


You can now compare month–end inventory balances against
quantity sold for each product.
8-26 © 2003, Cognos Incorporated
Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
USE ADVANCED MODELING TECHNIQUES

11. Close Report Viewer to return to Report Studio.


12. Save the report as Demo 8–3.
Task 3. Examine stitch query SQL syntax.
1. Open Demo 8–2.

2. On the vertical Explorer bar, point to Query Explorer , and


then click Query 1.
3. In the Properties pane, click the ellipsis for the Generated SQL
property.
The Generated SQL window appears as show below:

Notice the coalesce function and the full outer join. Remember that
these are efficient actions performed locally and are not resource
intensive actions executed at the database level.
4. Click Close, and then close Report Studio, Cognos Connection and
Framework Manager, saving the changes if prompted.

Results:
We have successfully created the requested report using
star schema groupings and also viewed the SQL syntax
behind a stitch query.

© 2003, Cognos Incorporated 8-27


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Summary

ƒ In this module, we have:


ƒ resolved a recursive relationship
ƒ specified dimensional information
ƒ created star schema groupings

8-28 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
A F

Appendix A
Step-by-Step Solutions to the Workshops

Cognos ReportNet – Metadata Modeling


COGNOS REPORTNET – METADATA MODELING

A-2 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

Workshop 2–1: Import Metadata From a Second Data


Source
Task 1. Create a second namespace.
1. In the Project Viewer, right-click the Database layer folder, point to
Create, and then click Namespace.
2. Under the Database layer folder, right-click New Namespace, and
then click Rename.
3. In the box, type goretailers, and then press Enter.
Task 2. Create a data source and test the connection.
1. Right-click the goretailers namespace, and then click Import
metadata.
2. In the Import Wizard under Select Import Source, ensure Database
is selected, click Next, and then click New.
3. In the New Data Source Wizard, click Next, in the Name box type
GORT, and then click Next.
4. In the Type list, click Microsoft SQL Server, leave the default
Isolation level, and then click Next.
5. In the Server name box, type localhost, and then in the Database
name box, type GORT.
6. Under Signon, select the User ID and Password check boxes, and
then in the User ID, Password, and Confirm password boxes, type sa
7. Scroll to the top of the page, click Test, and then click OK.
8. Click OK to close the message box.
9. Click Close, click Finish, and then click Finish again to close the
New Data Source Wizard.
Task 3. Import metadata.
1. Ensure that the GORT data source is selected, and then click Next.
2. In the list of objects, select the Tables check box, and then click
Next.
3. Leave the defaults for the Generate Relationship criteria, and then
click Import.
4. Click Finish.
5. In the Project Viewer, expand the goretailers namespace to see the
objects that were imported.

© 2003, Cognos Incorporated A-3


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 4. Publish the package.


1. Right-click the GO Model package, and then click Publish
Packages.
2. Accept the defaults, and then click Publish.
3. In the message box, click Yes.
4. Click Finish to close the wizard.
5. Save the project.
Task 5. Create an ad hoc query in Query Studio using
the updated run-time model.
1. In Cognos Connection, click the Query Studio link at the top right
corner of the page, and then click the GO Model link.
2. In the Insert Data menu, expand the Database layer folder.
3. Expand the gosales and goretailers folders.
4. Expand the ORDER_HEADER query subject, and then double-
click the RETAILER_NAME query item.
5. Repeat step 4 to add CITY from RETAILER_SITE, and
ORDER_METHOD_EN from ORDER_METHOD.
6. In the error message, click Details.
Explain why the error message occurs in step 5. It is because we are
trying to access data from two different data sources in the same
model. However, we have yet to specify a relationship between the
two in the model.
7. Click Return, and then click No when prompted to save the report.
8. Leave Cognos Connection and Framework Manager open for the
next demo.

A-4 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

Workshop 3–1: Create Additional Relationships and


Merge Query Subjects
Task 1. Create a relationship between RETAILER_SITE
and ACTIVE_INDICATOR_LOOKUP.
1. Ensure that you have the Object Diagram View open, below
goretailers, right–click RETAILER_SITE, and then click Locate in
Object Diagram.
RETAILER_SITE is highlighted in the diagram.
2. In the Object Diagram, right–click RETAILER_SITE, and then
click Create Relationship.
The Relationship Definition – New Relationship dialog box appears.
3. In the Name box, type RETAILER_SITE <–––>
ACTIVE_INDICATOR_LOOKUP, and then on the right side,
click the ellipsis.
The Select Query Subject dialog box appears.
4. Expand Database layer and goretailers, click
ACTIVE_INDICATOR_LOOKUP, and then click OK.
5. Modify the relationship so that it appears as shown below:

6. Click OK, and then under ACTIVE_INDICATOR_LOOKUP,


click ACTIVE_INDICATOR.

© 2003, Cognos Incorporated A-5


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

7. In the Properties pane, click the Properties link, and then in the
Usage row, click Attribute.
8. Repeat steps 6 and 7 for the ACTIVE_INDICATOR query item
below the RETAILER_SITE query subject.
Task 2. Create a relationship between
GENDER_LOOKUP and CONTACT.
1. Ensure that you have the Object Diagram View open, below
goretailers, right–click GENDER_LOOKUP, and then click
Locate in Object Diagram.
GENDER_LOOKUP is highlighted in the diagram.
2. In the Object Diagram, right–click GENDER_LOOKUP, and then
click Create Relationship.
The Relationship Definition – New Relationship dialog box appears.
3. In the Name box, type GENDER_LOOKUP <–––>
CONTACT, and then on the right side, click the ellipsis.
The Select Query Subject dialog box appears.
4. Expand Database layer and goretailers, click CONTACT, and
then click OK.
5. Modify the relationship so that it appears as shown below:

6. Click OK.
7. Under GENDER_LOOKUP, click GENDER_CODE.

A-6 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

8. In the Properties pane, in the Usage row, click Attribute.


9. Repeat steps 7 and 8 for the GENDER_CODE query item below
the CONTACT query subject.
Task 3. Merge metadata from two query subjects.
1. In the gosales namespace, Ctrl+click COUNTRY and
COUNTRY_MULTILINGUAL, right–click, and then click
Merge in New Query Subject.
A new data source query subject called
COUNTRY_COUNTRY_MULTILINGUAL is created.
2. Expand COUNTRY_COUNTRY_MULTILINGUAL.
This new query subject contains the query items from both the
COUNTRY and COUNTRY_MULTILINGUAL query subjects.
We can now safely delete the original query subjects that we merged
to create this new query subject.
3. In Project Viewer, Ctrl+click the COUNTRY and
COUNTRY_MULTILINGUAL query subjects, and then on the
toolbar, click Delete.
A message appears, indicating that removing these objects will impact
the objects that directly use them or their children. In particular, four
relationships will be deleted.
4. Click OK, right–click
COUNTRY_COUNTRY_MULTILINGUAL, and then click
Rename.
5. Type COUNTRY, and then press Enter.
6. Right–click COUNTRY, and then click Locate in Object
Diagram.
Notice that Framework Manager automatically generated the correct
relationships for this new, merged query subject.
7. Right–click COUNTRY, and then click Edit Definition.
The Query Subject Definition dialog box appears. Notice that the
SQL statement contains references to COUNTRY_CODE and
COUNTRY_CODE1. COUNTRY_CODE1 is not required;
therefore, we can safely delete this part of the SQL statement.
8. Delete COUNTRY_MULTILINGUAL.COUNTRY_CODE
as COUNTRY_CODE1, (ensure you delete the comma at the end,
and remove the empty row below it).
9. Modify LANGUAGE1 to “LANGUAGE”.
Because LANGUAGE is a reserved word in the database, it should
be enclosed in quotation marks.

© 2003, Cognos Incorporated A-7


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

10. Click Test.


The result appears as shown below:

Notice that, in the from clause, the value of "LANGUAGE" was set
to "EN". The macro that was created in Demo 3–8, “Create a Macro
Using a Parameter Map and a Session Parameter,” was replaced with
this literal value when you merged the COUNTRY and
COUNTRY_MULTILINGUAL query subjects.
The macro was replaced with "EN" because, when you merged the
COUNTRY and COUNTRY_MULTILINGUAL query subjects,
English was the active language of the project. To get the correct
results, you must add the macro back to the query subject definition.

A-8 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

Task 4. Re–insert the macro from Demo 3–8, “Create a


Macro Using a Parameter Map and a Session
Parameter.”
1. In the from clause, delete the "EN" value, and then type
#sq($[Locale Map]{$runLocale})#.
The result appears as shown below:

2. Click OK, from the Project menu, point to Languages, and then
click Define Languages.
The Define Languages dialog box appears.
3. Add German to the Project languages list.
4. In the Project Languages pane, click German, click Set As Active,
and then click OK.
A message appears, confirming the change.
5. Click OK, double–click (de) COUNTRY, and then click Test.

© 2003, Cognos Incorporated A-9


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

6. Scroll to the right to view the (de) LANGUAGE column.


The result appears as shown below:

7. Click OK, from the Project menu, point to Languages, and then
click Define Languages.
8. In the Project languages box, click English (United States), click
Set As Active, and then click OK.
A message appears, confirming the change.
9. Click OK, and then save the model.
Task 5. Re–publish the package and view the merged
query subject in Query Studio.
1. Right–click the GO Model package, and then click Publish
Packages.
The Publish wizard opens.
2. Click Publish, click Yes, and then click Finish.
3. Maximize Cognos Connection, open Query Studio, and then click
GO Model.
4. In the left pane, expand Database layer and gosales.
Notice that the merged query subject called COUNTRY is included
in the list of available query subjects.

A-10 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

5. Double–click COUNTRY to add all of its query items to the report.


Notice that the query items in the COUNTRY query subject reflect
the changes that we made in Framework Manager. The result appears
as shown below:

6. Save the report as Wkshp 3–1a.


Task 6. Create reports that use the new relationships.

1. Click New Report , and then expand the


ACTIVE_INDICATOR_LOOKUP and RETAILER_SITE
query subjects.
2. Below RETAILER_SITE, double–click
RETAILER_SITE_CODE, ADDRESS1, CITY, and
COUNTRY_CODE.
3. Below ACTIVE_INDICATOR_LOOKUP, double–click
DESCRIPTION.
4. Click the DESCRIPTION column, and then on the toolbar, click
Filter.

© 2003, Cognos Incorporated A-11


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

5. In the Show only the following section, select Active and


INACTIVE, and then click OK.
The results appear as shown below:

6. Save the report as Wkshp 3–1b, and then click New Report.
7. Expand GENDER_LOOKUP and CONTACT.
8. Below CONTACT, double–click FIRST_NAME, LAST_NAME,
and JOB_POSITION_EN.
9. Under GENDER_LOOKUP, double–click GENDER, click the
GENDER column, and then on the toolbar, click Filter.

A-12 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

10. In the Show only the following section, select Female, and then click
OK.
The result appears as shown below:

11. Save the report as Wkshp 3–1c, click Return, and then leave Cognos
Connection and Framework Manager open for the next demo.

© 2003, Cognos Incorporated A-13


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 3–2: Create Calculations and Set Query


Item Properties
Task 1. Create the PLANNED_REVENUE calculation.
1. In Framework Manager, under the gosales namespace, right–click
ORDER_DETAILS, and then click Edit Definition.
The Query Subject Definition dialog box appears.
2. Click the Model Objects tab, and then click Insert New
Calculation.
The Calculation Definition window opens.
3. In the Name box, type PLANNED_REVENUE, and then in the
Available Components pane, expand GO Model, Database layer,
and gosales.
4. Expand ORDER_DETAILS, and then double–click
QUANTITY.
5. Click the Functions tab, expand Operators, and then double–click
the multiplication operator.
6. Click the Model tab, and then below ORDER_DETAILS, double–
click UNIT_PRICE.
7. Click Test Sample.
The result appears as shown below:

8. Click OK.

A-14 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

Task 2. Create the PRODUCT_COST calculation.


1. Click Insert New Calculation.
The Calculation Definition window opens.
2. In the Name box, type PRODUCT_COST, and then in the
Available Components pane, expand GO Model, Database layer,
and gosales.
3. Expand ORDER_DETAILS, and then double–click
QUANTITY.
4. Click the Functions tab, and then expand Operators.
5. Double–click the multiplication operator , click the Model tab,
and then below ORDER_DETAILS, double–click UNIT_COST.
6. Click Test Sample.
The result appears as shown below:

7. Click OK, and then click OK again.

© 2003, Cognos Incorporated A-15


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 3. Set the usage property for query items.


1. Under the gosales namespace, expand the ORDER_HEADER
query subject, and then Ctrl+click RETAILER_NAME and
ORDER_DATE.
2. In the Properties pane, change the value in the Usage column for
both query items to Attribute.
The result appears as shown below:

3. Repeat step 2 for the following query items, under the following Instructional Tips
query subjects: Indicate to students this would be a good
case for setting multiple properties by
ORDER_METHOD query subject: setting the property for the first item and
then clicking and dragging the arrow beside
• ORDER_METHOD_EN it down to apply the same setting to the
other selected items.
PRODUCTS query subject:

• PRODUCT_NAME

• INTRODUCTION_DATE
RETURNED_ITEM query subject:

• RETURN_DATE
RETURN_REASON query subject:

• REASON_DESCRIPTION_EN
PRODUCT_FORECAST query subject:

• YEAR

• MONTH
SALES_STAFF query subject:

• FIRST_NAME

• LAST_NAME

• POSITION_EN

A-16 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

4. Expand the goretailers namespace, and then repeat step 2 for the
following query items, under the following query subjects:
RETAILER query subject:

• COMPANY_NAME
RETAILER_SITE query subject:

• CITY
RETAILER_TYPE query subject:

• TYPE_NAME_EN
SALES_TERRITORY query subject:

• TERRITORY_NAME_EN
COUNTRY query subject:

• COUNTRY_EN
CONTACT query subject:

• FIRST_NAME

• LAST_NAME

• JOB_POSITION_EN

Task 4. Change the aggregation type for query items.


1. Under the gosales namespace and the PRODUCTS query subject,
Ctrl+click the PRODUCTION_COST and MARGIN query
items.
2. In the Properties pane, change the value in the Regular Aggregate
column for both query items to Average.
The result appears as shown below:

3. Save the project.

© 2003, Cognos Incorporated A-17


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 5. Re–publish the package and view the results in


Report Studio.
1. In Project Viewer, right–click the GO Model package, click Publish
Packages, and then click Publish.
A message appears, indicating that a package of the same name
already exists.
2. Click Yes, and then click Finish.
3. In Cognos Connection, open Report Studio, and then click GO
Model.
4. Create a new list report, and then in the Insertable Objects pane,
expand Database layer, gosales, and ORDER_METHOD.
5. Right–click ORDER_METHOD_EN, and then click Properties.
The Properties dialog box appears. The Usage property of this
attribute is set to Attribute, due to the changes made in Task 3.
6. Click Close, and then expand the ORDER_DETAILS query
subject.
The query subject includes the two calculated query items
(PRODUCT_COST and PLANNED_REVENUE) that were
created in Task 1 and Task 2.
7. Double–click PRODUCT_NUMBER,
PLANNED_REVENUE, and PRODUCT_COST to add them
to the report, and then run the report.
The result appears as shown below:

8. Close Report Viewer, and then save the report as Wkshp 3–2a.
9. Close Report Studio, open Query Studio, and then click GO
Model.
10. Expand the PRODUCTS query subject, and then double–click
PRODUCT_NUMBER, PRODUCTION_COST, and
MARGIN to add them to the report.
11. Ctrl+click the PRODUCTION_COST and MARGIN columns,
and then on the toolbar, click Summarize.

A-18 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

12. Run the report, click Bottom, and then scroll to the bottom of the
report.
Notice that the summary values are averaged, rather than totaled. The
result appears as shown below:

13. Close Report Viewer, and then save the report as Wkshp 3–2b.
14. Close Report Studio and Query Studio, and then leave Cognos
Connection and Framework Manager open for the next Workshop.

© 2003, Cognos Incorporated A-19


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 3–3: Create Macros Using a Parameter


Map and a Session Parameter
Task 1. Add a macro to the PRODUCT_LINE query
subject definition.
1. Under the gosales namespace, right–click PRODUCT_LINE, and
then click Edit Definition.
The Query Subject Definition dialog box appears.
2. In the Available database objects pane, expand GOSL, GOSL, dbo,
Tables, and PRODUCT_LINE.
3. On the SQL tab, delete the *, and then drag and drop the
PRODUCT_LINE_CODE and PRODUCT_LINE_EN
columns to the SQL tab, to the immediate right of the SELECT
clause.
4. Click Test.
The result appears as shown below:

5. Delete the EN from the


PRODUCT_LINE.PRODUCT_LINE_EN column name.
6. Ensure that your cursor as at the end of PRODUCT_LINE_, and
then on the toolbar, click Insert Macro .
The Macro Editor dialog box appears.

A-20 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

7. In the Available Components pane, expand Parameter Maps, and


then double–click Locale Map.
8. Expand Session Parameters, and then drag and drop runLocale
between the {} brackets.
9. Delete the white space to the left of {runLocale}.
The result appears as shown below:

10. Click OK, and then type AS PRODUCT_LINE to the left of the
macro.
11. Click Test.
The result appears as shown below:

12. Click OK.

© 2003, Cognos Incorporated A-21


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 2. Test the runLocale parameter in Framework


Manager.
1. From the Projects menu, click Session Parameters.
The Session Parameters dialog box appears.
2. Click the runLocale row, and then click Edit.
3. In the Override Value box, type fr, and then click OK.
4. Below gosales, double–click PRODUCT_LINE, and then click
Test.
The result appears as shown below:

Because we have overridden the value of the runLocale parameter


(specifying French), the value supplied to the macro has changed. As
a result, the values returned by the PRODUCT_LINE query subject
are in French instead of English.

A-22 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

Task 3. Re–publish the package and view the results in


Query Studio.
1. Click OK to close the Query Subject Definition box, and then
publish the GO Model package.
2. In Cognos Connection, click Preferences, in the Content language
section, click Use the following language, and then in the Use the
following language box, click French.
3. Click OK, open Query Studio, and then click (fr) GO Model.
4. Expand (fr) Database layer and (fr) New Namespace, and then
double–click (fr) PRODUCT_LINE.
Because we have changed the content language setting, the data in the
report is translated into French. The result appears as shown below:

5. Save the report as Wkshp 3–3, click Return, and then in Cognos
Connection, click Preferences.
6. In the Content language section, select Use the default language,
and then click OK.
7. Leave Cognos Connection and Framework Manager open for the
upcoming Demo.

© 2003, Cognos Incorporated A-23


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 4–1: Finish Creating the Presentation


Layer

Task 1. Create presentation layer folders.


1. In Framework Manager, in the Project Viewer pane, create the
following folders under the Presentation Layer folder:
Sales Rep Information
Retailer Information
Quick Reference
The result appears as shown below:

Task 2. Create model query subjects.


1. Right–click the Sales Rep Information folder, point to Create and
then click Query Subject.
The New Query Subject Wizard dialog box appears.
2. In the Name box, type Sales Reps and ensure the Model Query
Subject option is selected.
3. Click Finish.
The Query Subject Definition dialog box appears.
4. In the Available model objects pane, expand GO Model,
Database Layer , gosales, and Sales Staff.

A-24 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

5. From Sales Staff drag and drop the following query items to the
Query Items and Calculations pane:
First Name
Last Name
Position
Work Phone
Extension
Fax
Email
6. Click OK.

© 2003, Cognos Incorporated A-25


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

7. Using the same procedure as in steps 1–6, create the following model
query subjects in the appropriate folders.
Folder Model Query Query Items
Subject
Sales Rep Branch Address Address 1 from Sales Branch
Information
Address 2 from Sales Branch
City from Sales Branch
Region from Sales Branch
Postal Zone from Sales
Branch
Country from Country
Sales Targets Create a calculation called Staff
Name using First Name
from Sales Staff and Last
Name from Sales Staff. The
syntax should appear as shown
below:
[gosales].[Sales Staff].[First
Name] || ' ' ||
[gosales].[Sales Staff].[Last
Name]
Retailer Name from Sales
Target
Product Name from
Products
Sales Year from Sales Target
Sales Period from Sales
Target
Sales Target from Sales
Target

A-26 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

Folder Model Query Query Items


Subject
Retailer Retailers Type Name from Retailer
Information (Query Subjects Type
are located in the
Territory Name from Sales
goretailers
Territory
namespace)
Company Name from
Retailer
Address 1 from Retailer Site
Address 2 from Retailer Site
City from Retailer Site
Region from Retailer Site
Postal Zone from Retailer
Site
Country from Country
Flag Image from Country
Your model should appear as shown below:

8. Save the project.

© 2003, Cognos Incorporated A-27


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Task 3. Move data source query subjects and create


shortcuts.
1. In the Project Viewer pane, in the gosales namespace under the
Database Layer folder, right–click the Find Order Date query
subject, and then click Cut.
2. Under the Presentation Layer folder, right–click the Quick
Reference folder, and then click Paste.
The data source query subject has moved from the database layer to
the presentation layer.
3. In the gosales namespace under the Database Layer folder, right–
click the Orders for 2001 query subject, and then click Create
Shortcut.
A shortcut to the Orders for 2001 query subject appears at the
bottom of the gosales namespace.
4. Drag and drop the shortcut to the Quick Reference folder under
the Presentation Layer folder.
5. Rename the shortcut to Orders for 2001.
6. Save the project.

A-28 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

Workshop 4–2: Create More Filters

Task 1. Create model filters.


1. Right–click the Product Line Filters folder, point to Create, and
then click Filter.
The Filter Definition dialog box appears.
2. In the Name box, type Personal Accessories.
3. In the Available Components pane, expand the GO Model
namespace, the Database Layer folder, the gosales namespace, and
the Product Line query subject.
4. Drag and drop the Product Line Code query item into the
Expression Definition pane.
5. After [gosales].[Product Line].[Product Line Code], type =3 so that
the expression definition appears as shown below:
[gosales].[Product Line].[Product Line Code] =3
6. Click OK.
7. Repeat steps 1–6 to create two more model filters called Outdoor
Protection and Golf Equipment. The filter values will be 4 and 5
respectively so that the expression definitions appear as shown below:
[gosales].[Product Line].[Product Line Code] =4
[gosales].[Product Line].[Product Line Code] =5
8. Save the project.
Task 2. Create a query subject with an embedded filter
and prompt value.
1. Right–click the Quick Reference folder, point to Create, and then
click Query Subject.
The New Query Subject Wizard dialog box appears.
2. In the Name box, type My Sales Staff, and ensure the Model Query
Subject option is selected.
3. Click Finish.
The Query Subject Definition dialog box appears.
4. Create a calculation called Staff Name using First Name from
Sales Staff and Last Name from Sales Staff. The syntax should
appear as shown below:
[gosales].[Sales Staff].[First Name] || ' ' || [gosales].[Sales
Staff].[Last Name]

© 2003, Cognos Incorporated A-29


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

5. In the Available model objects pane, expand GO Model, Database


Layer, and gosales.
6. Expand the Sales Staff and Sales Branch query subjects, and then
drag and drop the following query items into the Query Items and
Calculations pane:
Position from Sales Staff
City from Sales Branch
Region from Sales Branch
Work Phone from Sales Staff
Extension from Sales Staff
Fax from Sales Staff
Email from Sales Staff
Date Hired from Sales Staff

7. Click Insert Embedded Filter .


The Filter Definition dialog box appears.
8. In the Name box, type Manager Code Filter.
9. In the Available Components pane, expand GO Model,
Database Layer, and Sales Staff.
10. Drag and drop the Manager Code query item into the Expression
Definition pane.
11. Type =?p_manager_code? after [gosales].[Sales Staff].[Manager
Code] so that the definition appears as shown below:
[gosales].[Sales Staff].[Manager Code] =?p_manager_code?
This expression is now using the prompt value ?p_manager_code?.
12. Click OK.
13. Click Test.
The Prompt Values dialog box appears.
14. Type 18 in the Value field for p_manager_code, and then click OK.
A list of sales staff that report to the manager with a code of 18
appears in the Test Results pane.
15. Click OK.
16. Save the project.

A-30 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

Task 3. Test your filters.


1. Publish the GO Model package.
2. In Cognos Connection, click the Public Folders tab, and then click
the GO Model link.
3. Click the Demo 4–1 link to launch the report.
The report appears in Query Studio.
4. From the Menu, click the Insert Data link.
5. Expand the Presentation Layer, and Product Line Filters folders.
6. Drag and drop the Personal Accessories filter onto the report.
7. Click Page down, to navigate through the report.
Notice that the report only contains information on Personal
Accessories.

8. On the toolbar click Undo .


9. Repeat steps 6–8 to test the Outdoor Protection and Golf
Equipment filters.
10. Click Return, without saving the report.

© 2003, Cognos Incorporated A-31


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 5–1: Create, Nest, and Publish a Package


Task 1. Create a Sales Reps package.
1. In the Project Viewer pane, right–click Packages, point to Create
and then click Package.
The Create Package wizard dialog box appears.
2. Type Sales Reps in the Name box, and then click Next.
3. Click GO Model check box to deselect it, and then expand the
Presentation Layer and Sales Rep Information folders.
4. Select the Sales Reps, Branch Address and Sales Targets check
boxes.
The package definition appears as shown below:

5. Click Next, accept the defaults, and then click Next.


6. Accept the language defaults, and then click Next.
7. Accept the default function set (it should be SQL Server), and then
click Finish.
A message appears asking if you would like to open the Publish
Package Wizard.
8. Click No.
Task 2. Create and publish a nested package.
1. Create a new package called GO Sales Rep Performance, and then
click Next.
2. Click Using existing packages, and then select the Sales Reps,
Orders and Products, and Quick Reference check boxes.
3. Click Next.
4. Under the Order Information folder, deselect the Returns query
subject.

A-32 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

5. Select the Quick Reference folder, and then deselect the Find
Order Date and Orders for 2001 query subjects.
The package definition appears as shown below:

6. Click Next, accept the defaults, and then click Next.


7. Accept the language defaults, and then click Next.
8. Accept the default function set (it should be SQL Server), and then
click Finish.
A message appears asking if you would like to open the Publish
Package Wizard.
9. Click Yes.
10. In the Number of model number to retain text box, type 4, and then
click Publish.
11. When the package has been published, click Finish.

© 2003, Cognos Incorporated A-33


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workshop 6–1: Create Country Specific Security


Filters
Task 1. Create and add a member to the Italy group and
the United States group, and then grant access
to the GO Model package.
1. Right-click the GO Model package, and then click Edit Package
Access.
2. Click New.
3. In the Name box, type Italy, and then click Next.
4. Click Add, select the Show users in the list check box, and then
click Local NT.
5. Select Allessandra Torta., click Add, and then click OK.
6. Click Finish.
7. Click Add.
8. Click Cognos, select Italy, and then click Add.
9. Click OK.
10. Repeat steps 2 to 9 to create and give access to a second group called
United States. Add Alex Rodriguez (from the Local NT namespace)
to this group.
11. Click OK to close the Package Access dialog box.
Task 2. Limit access to the database layer and create a
security filter for Italy.
1. Right-click the Database Layer folder, and then click Give visibility
rights.
2. Click Cognos, select System Administrators, and then click Add.
3. Click OK, and then click OK again.
4. Click OK, and then expand the Retailer Information folder.

A-34 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

5. Right-click Retailers, and then click Specify Security Filters.


6. Click Add Groups.
7. Click Cognos, select Italy, and then click Add.
8. Click OK, and then in the Filter box, click Create/Edit Embedded
Filter.
9. In the Available Components pane, expand GO Model,
Presentation Layer, Retailer Information, and Retailers.
10. Double-click Country, click the Functions tab, and then expand
Operators.
11. Double-click the equals sign, and then type 'Italy'.
The result appears as shown below:

12. Click OK.


Task 3. Create a security filter for the United States.
1. Click Add Groups.
2. Click Cognos, select United States, and then click Add.
3. Click OK, and then in the Filter box, click Create/Edit Embedded
Filter.
4. In the Available Components pane, expand GO Model,
Presentation Layer, and Retailer Information, and then expand
Retailers.
5. Double-click Country, click the Functions tab, and then expand
Operators.

© 2003, Cognos Incorporated A-35


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

6. Double-click the equals sign, and then type 'United States'.


The result appears as shown below:

7. Click OK, click OK again, and then save the project.


Task 4. View the results in Query Studio.
1. Re-publish the GO Model package.
2. In Cognos Connection, click Log on again, in the User ID box, type
atorta, and then in the Password box, type password.
3. Click OK, open Query Studio, and then click GO Model, and
notice that only the Presentation Layer folder is visible.
4. Expand Presentation Layer, Retailer Information, and Retailers.
5. Double-click Company Name and Country, and notice in the
report that this user has access only to the four retailers from Italy, as
shown below:

6. Save the report as Wkshp 6–1a, click Return, and then click Log
Off.
7. Click Log on again, in the User ID box, type arodriguez, and then
in the Password box, type password.
8. Click OK, open Query Studio, and then click GO Model, and
notice again that only the Presentation Layer folder is visible.
9. Expand Presentation Layer, Retailer Information, and Retailers.

A-36 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
STEP–BY–STEP SOLUTIONS TO THE WORKSHOPS

10. Double-click Company Name and Country, and notice in the


report that this user has access only to the twenty-five retailers from
the United States, as shown below:

11. Save the report as Wkshp 6–1b, click Return, and then click Log
Off.
12. Leave Cognos Connection and Framework Manager open for the
next demo.

© 2003, Cognos Incorporated A-37


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

A-38 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
B F

Appendix B
Additional Tips and Techniques for Modeling in
Framework Manager

Cognos ReportNet – Metadata Modeling


COGNOS REPORTNET – METADATA MODELING

B-2 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
ADDITIONAL TIPS AND TECHNIQUES FOR MODELING IN FRAMEWORK MANAGER

Tips for Modeling in Framework Manager


The best practice for modeling your data depends on how it is currently
modeled in the database as well as on how you wish to present it to your
report authors.

Workflow for a Normalized Database Presented in a


Business Context
Create a Physical Layer Namespace
1. In this layer include all data-source query subjects required to
access the data. You can create one or more of these namespaces
for each data source to make it easier to maintain the model.
2. Ensure that all required relationships are present. If they are not,
add them. Verify all relationships and cardinality are correct. See
the Tips for Modeling Relationships in Framework Manager
section on how to use shortcuts to deal with ambiguous
relationships.
3. Handle multilingual data.
4. Specify dimensional information if you have objects with internal
cardinality. It is important to specify dimensional information on
Query Subjects that represent collapsed hierarchical relationships
or aggregate data. See the section on Specifying Dimensional
Information.
5. Add value to the data by incorporating embedded filters and
calculations.

Create a Presentation Layer Namespace


(It is possible to achieve steps 1-4 by selecting a fact table and using the
Create Star Schema Group menu option with the ‘Move objects into a
new namespace’ option checked.)

1. Create a namespace to contain all the shortcuts and model query


subjects that will belong to the Presentation Layer. This will be a
presentation layer namespace.
2. Create model query subjects as needed based on reporting
requirements. Include shortcuts to data source query subjects in
the Physical Layer where appropriate.
3. Apply the tips and techniques in this document to prevent double
counting and join ambiguity where appropriate.
4. Add reusable calculations and filters as needed.
5. Verify the usage and aggregation rule of each query item.

© 2003, Cognos Incorporated B-3


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Workflow for a Star Schema Database Presented as a


Star Schema
Create a Physical Layer Namespace
1. In this layer include all data source query subjects required to
access the data. You can create one or more of these namespaces
for all tables in your data mart or data warehouse.
2. Ensure that all required relationships are present. If they are not,
add them. Verify that all relationships and cardinality are correct.
You must create multiple relationships between existing query
subjects where you have role-playing dimensions. See the section
on Tips for Modeling Relationships
3. Handle multilingual data
4. Specify dimensional information if multiple levels of a dimension
are stored in a single physical table. It is important to specify
dimensional information on query subjects that have measures at
different levels of granularity. See the section on Specifying
Dimensional Information
5. Add value to the data by incorporating embedded filters and
calculations.
Note that this layer consists only of data source query subjects (or, if the
version of ReportNet supports it, multidimensional queries for SAP BW
data sources).

Create a Star Presentation Layer Namespace


(It is possible to achieve steps 1-4 by selecting a fact table and using the
Create Star Schema Group menu option with the ‘Move objects into a
new namespace’ option checked.)

1. Create a namespace to contain all the stars you will be modeling.


This will be a presentation layer namespace.
2. Each set of one fact table and the dimensions it relates to
constitute a star.
Note 1: A fact need not contain measures, it can be any query
subject that is at the ‘many’ end of one to many relationships with
a particular set of dimensions.
Note 2: Each star should be contained in a namespace to remove
join ambiguity. See the section on Multiple Conformed Star
Schemas
3. Within a star namespace, the fact table and each dimension
should be represented using shortcuts to the original data source
query subjects in the physical layer. It is necessary to use
shortcuts for conformed dimensions and it is considered best
practice to do so for all dimensions.

B-4 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
ADDITIONAL TIPS AND TECHNIQUES FOR MODELING IN FRAMEWORK MANAGER

4. For role-playing dimensions follow these steps:


i. Within the star namespace, copy the shortcut to the
existing dimension shortcut for each role. Note that the
existing relationships will be copied as well.
ii. Rename each new dimension shortcut to reflect its role
iii. One by one highlight delete all unnecessary relationships
for each role-playing shortcut, including the original. The
end result is one relationship per dimension shortcut.
5. Add reusable calculations and filters as needed.
6. Verify the usage and aggregation rule of each query item.

Note that this layer consists only of shortcuts to query subjects and
relationships.

© 2003, Cognos Incorporated B-5


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Tips for Modeling Relationships in Framework


Manager
When modeling data, there are cardinality scenarios that cause problems
in reporting. These are conventionally defined as traps. The majority of
these cases are handled correctly by ReportNet without special action, or
can be resolved with some specific modeling techniques in Framework
Manager.

Issues of cardinality are most important in how they affect both the
results of a query and how it is written. In this document we will discuss
key areas of concern with respect to result sets and query design. Some
of the topics discussed pertain specifically to data that is dimensionally
modeled.

Many-to-Many Relationship Between Tables


(This scenario is sometimes referred to as a chasm trap). A query written
against a many-to-many relationship results in a cross product being
performed on the database. Unless specifically enabled, most RDBMS
and relational tools will not permit execution of such a query.
Framework Manager is no different. A many-to-many relationship
should never be left in the model unless there is a very good reason (and
very small dataset). Ideally this should be resolved in the database by the
DBA.
A(N)—(N)B

The common resolution results in a cardinality scenario that looks like


this: A(1)-(N)C(N)-(1)B.

B-6 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
ADDITIONAL TIPS AND TECHNIQUES FOR MODELING IN FRAMEWORK MANAGER

Double Counting
Double counting occurs when data at multiple levels of granularity exist
in the same table, and manifests when repeated data is aggregated to the
internal cardinality of the data in the table.

Hierarchical Relationships
A hierarchical relationship occurs when a series of tables are connected
by one-to-many relationships. This has traditionally created a problem
when users write reports that do not select items from each table in the
hierarchy. Users do not necessarily understand that their query may
result in repeated values that should not be aggregated in the same way as
non-repeating values. This results in double counting. In ReportNet,
even a query that does not have elements of every table in its projection
list will not result in double counting. This is because ReportNet is aware
of the relationships and cardinality that links the tables and will include
joins to any intermediary tables necessary to accurately reflect the
cardinality in the query and will correctly apply grouping and aggregation
to ensure that double counting does not occur.

Dimension and Aggregate Tables (Dimensionally Modeled Data)


A dimension table is essentially a table that collapses a hierarchical
relationship between primarily descriptive tables. Such a table has
internal cardinality, distinct levels of data that have a hierarchical
relationship to each other. Similarly aggregate tables are tables that
contain primarily quantitative data aggregated to a single level or multiple
levels.
Both dimension tables and aggregate tables can introduce double
counting issues when queried individually or in combination with other
tables and different levels of granularity.

© 2003, Cognos Incorporated B-7


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

ReportNet is aware of indexes and keys specified in the database even


though this information does not appear in the UI. However such
information does not always exist to describe the internal cardinality of a
table. In addition to using indexes and keys, Framework Manager
provides a feature called Specify Dimensional Information to allow the
modeler to dictate how queries involving dimension and tables will be
written. As a best practice, to avoid unnecessary aggregation to
determine uniqueness of attributes, the modeler must specify what levels
exist in the data, what the key(s) are for those levels, what attributes are
associated to the levels, and very importantly how the levels relate to each
other. For more information see the section on Specifying Dimensional
Information in Framework Manager.

Note 1: If you do not associate an item to a level, Framework Manager


will assume that it is associated to the lowest level(i.e., that it can be safely
aggregated using all rows).

Note 2: If levels B and C have a compound key, consisting of the keys


for the levels above plus a qualifying column for that level, ReportNet
can determine that A and B are not the lowest levels, and aggregate them
correctly. However, for clarity and best practice, the dimension
information should still be specified.

Dimension and aggregate tables are a concern for double counting in the
context of the multi-fact/multi-grain query.

Multi-Fact/Multi-Grain Query
(This scenario is sometimes referred to as fan trap or parallel relationship)
This situation is typically the result of multiple star schemas sharing
conformed dimensions. The potential for double counting arises when
multiple fact tables exist at different levels of granularity and have
relationships to a conformed dimension table on different keys. In this
case, you need to specify dimensional information on the conformed
dimension being used at multiple levels in order to prevent double
counting.
F1(N)—(1)D(1)—(N)F2

B-8 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
ADDITIONAL TIPS AND TECHNIQUES FOR MODELING IN FRAMEWORK MANAGER

Ambiguous Relationships Scenarios


An ambiguous relationship is where there are multiple relationship paths
between one or more query subjects leaving multiple options for how to
write a query. This is a situation that can be responded to by the modeler
or in the database by the DBA. If appropriate, the DBA can choose to
remove extra relationships (although this can potentially result in another
situation that will need to be addressed). Dealing with this situation in
Framework Manager is a matter of determining which query path you
want used.
Join ambiguity in Framework Manager is resolved by using shortcuts.
Create shortcuts to all the query subjects that participate in the
relationship in a separate folder or namespace and resolve the ambiguity
there. In this case you would not publish the original query subjects, but
you would maintain them in place (or in a folder or namespace) with their
original relationships intact. It is considered best practice to leave all
database objects in a single layer with their relationships and to create
shortcuts to them that may then be organized into folders and
namespaces.

Role-Playing Dimensions
A role-playing dimension is any table that has multiple valid relationships
between itself and another table. This is most commonly seen in
dimensionally modeled data for dimensions such as Date and Customer.
A good example is an Orders fact table, it may have multiple relationships
to the Customer dimension on keys such as sold_to, ship_to and bill_to.
It is not an option to write a query between the Customer and Orders
tables because three relationships from Orders to the same field in
Customer will result in no rows being returned, and it is unclear which
relationship of the three should be chosen for the query. How do you
specify the context for Customer?

The answer to this in Framework Manager is part of the best practice for
star schemas.
1. Leave all the relationships in place.
2. After creating a star schema grouping, which results in a new
namespace with shortcuts to the fact table and all relevant
dimension tables, determine how many valid relationship
shortcuts now exist between the fact table shortcut and the
dimension shortcut in question.
3. Copy and past the shortcut to this dimension in the same
namespace until you have as many copies as you have
relationships.
At this point, there will still be multiple relationships between
each copy of the shortcut and the fact table.
4. The next step is to name each shortcut appropriately for the role
it plays.
In this example we would have three shortcuts that would be
named, Sold_To_Cust, Ship_To_Cust and Bill_To_Cust.

© 2003, Cognos Incorporated B-9


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

5. Once you have clarified which shortcut will be used for each
dimension, you should delete all but the appropriate relationship
shortcut to each of the role-playing shortcuts.

B-10 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
ADDITIONAL TIPS AND TECHNIQUES FOR MODELING IN FRAMEWORK MANAGER

Optional Relationships
An optional relationship is characterized by a (0..1) or (0..n) relationship
that allows for a potential break in the linkage of data from one table to
another. The resolution to an optional relationship is to add an alternate,
mandatory relationship if possible. This often results in the creation of
an ambiguous relationship that must then be resolved as a Loop Join.

Analyze the situation that has been created, the problem stems from
having two ways to relate data from query subjects A and C. Unless one
path is highly preferable to the other, it is best to present end users with
both. This is accomplished by creating shortcuts, one each for A and B
and two for C (these should be renamed to distinguish one from the
other). The two shortcuts for C act as aliases and allow us to create
unambiguous relationships to A and B respectively. Move all the newly
created shortcuts to a folder and in the folder proceed to create
relationships between the query subjects that reflect a disambiguated
version of what existed originally. When you create a relationship
between two shortcuts that have an existing relationship between the
objects they reference, Framework Manager will notify you that a
relationship already exists between these objects and will give you the
option to create a shortcut to that relationship, use this option because
you are not creating new relationships, simply disambiguating existing
ones.

Recursive Relationships
Framework Manager imports recursive relationships. They appear in the
object diagram but they are not used when querying. To create a
functioning recursive relationship you must create a shortcut to the query
subject (an alias) and then create a relationship between the query subject
and the shortcut.

© 2003, Cognos Incorporated B-11


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Multiple Conformed Star Schemas


In dimensionally modeled data, it is likely that you will see fact query
subjects that share dimension query subjects, resulting in what looks like a
web in your diagram. Join ambiguity is an issue in this situation, when you
use multiple dimensions without any items from the fact table.

For example, you would like to write a report on products sold in 2002.
This involves only the time and product dimensions but these dimensions
are related via multiple fact tables, resulting in ambiguity. Given the
option to relate these dimensions on the SALES_FACT table or the
INVENTORY_LEVELS_FACT table, how do you let the user choose
which context they are interested in?

B-12 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
ADDITIONAL TIPS AND TECHNIQUES FOR MODELING IN FRAMEWORK MANAGER

The way to resolve this join ambiguity lies in the Create Star Schema
Grouping functionality. This feature allows you to select a fact table,
choose Create Star Schema Grouping from the menu, choose the
dimensions you want from a list in the wizard, and choose the options to
create shortcuts for all query subjects and move to a new namespace. By
doing this for all star schemas, you resolve join ambiguity by placing
shortcuts to the fact and all dimensions in a single namespace along with
shortcuts to the relationships between them.

The shortcuts for conformed dimensions in each namespace will be


identical and will be referenced to the original object, thus will be truly
conformed. Now when a user wants to write a report on products sold
in 2002 they will go to the SALES_FACT_STAR namespace and select
from there. Since a relationship between PRODUCT_DIMENSION
and TIME_DIMENSION exists through the SALES_FACT query
subject and is the appropriate relationship to connect products and dates
for your report, it will be used to return the data.

Cross-Join
It is possible to write a query that attempts to retrieve data from two
tables that have no apparent relationship. By default this action is not
allowed by Framework Manager because of the unpredictability of the
result. An operation of this type may be handled differently by different
RDBMS systems, while one may choose to do a complete Cartesian
product (all possible combinations of the data) another may infer a
relationship and join based on that.

© 2003, Cognos Incorporated B-13


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Specifying Dimensional Information in Framework


Manager
1. For each hierarchy you wish to represent create a distinct copy of
the dimension query subject.
2. Ensure that keys and other identifiers have their usage specified
as identifier.
3. When a surrogate key is available for a level use it as the level key
and treat the business key as an attribute. Set the ‘Is Hidden’
property of the surrogate key query item to ‘true’.
4. To specify a level select a query item that you consider to be the
descriptor of the level. Include this query item in the attributes.
5. Use the item you would consider as the level id (forms one end of
a relationship) as the key for the level.
6. For each level associate any query items whose granularity is
specific to that level. You should associate each query item to
one level. Any unassociated items will be assumed to belong to
the lowest level you have specified and aggregate functions will
appear in the SQL to ensure the values are unique when queried
at higher levels.

B-14 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INDEX

Index

A M
Action logs, 7-26 Macros, 3-61
Ambiguous relationships Metadata
conformed dimensions, 8-20 export, 2-17
examine, 3-8 import, 2-12
resolve, 3-9 prepare, 1-12
Models
C definition, 1-5
prepare business view, 1-13
Calculations, 3-53 types, 1-7
version control, 5-15
D
Data sources N
import from multiple, 2-11
Namespaces
types, 2-10
Cognos. See Security
Dimensional information definition, 1-5
best practices, 8-18
conformed dimensions, 8-20
O
resolve level ambiguity, 8-12
specify, 8-11 Objects
examine & organize, 2-16
F visibility. See Security
Filters
P
examine, 4-14
security. See Security Packages
use Prompt values, 4-19 access. See Security
Folders administrative access. See Security
definition, 1-5 create & manage, 1-14
Framework Manager create & modify, 5-10
definition, 1-4 definition, 1-5
environment, 1-5, 1-17, 1-18 examine, 5-5
naming conventions, 1-19 impact of publishing, 5-13
workflow, 1-10 nest, 5-16
Function sets publish, 5-14
definition, 2-15 specify functions, 5-12
Functions specify languages, 5-11
package function list, 5-12 Parameter maps, 3-59
user defined, 3-48 Physical layer
definition, 2-6
G Presentation layer
create, 4-5
Governors definition, 2-7
edit, 5-6 Projects
best practices, 2-5
L check, 7-28
Languages create, 2-8
select, 2-9 definition, 1-5
specify package languages, 5-11 design & create, 1-11
Links files, 1-6
create, 7-13 manage, 1-16
synchronize, 7-27
Prompt values. See Filters

© 2003, Cognos Incorporated 1


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
COGNOS REPORTNET – METADATA MODELING

Q R
Query items Recursive relationships
definition, 1-5 examine, 8-4
examine, 3-22 resolve, 8-5
modify properties, 3-23 Relationships
set Regular Aggregate property, 3-25 ambiguous. See Ambiguous relationships
Query processing create & modify, 3-7
types, 3-5 criteria, 2-13, 2-14
Query subjects definition, 1-5
create model, 4-6 examine, 3-6
create new, 3-37 recursive. See Recursive relationships
create stored procedure, 3-43 ReportNet
definition, 1-5 security, 6-5
edit SQL, 3-20 workflow, 1-9
examine, 3-18 Repository control
modify & test, 3-19 set up, 7-6
set SQL type & generated SQL, 3-21 use, 7-5
types, 1-8
S
Security
Cognos namespace, 6-7
configure authentication providers, 6-6
filters, 6-11
object visibility, 6-10
package access, 6-9
package administrative access, 6-12
ReportNet model, 6-5
set, 6-8
Segments
create, 7-12
Session parameters, 3-60
Star schemas
examine, 8-19
manage, 8-21
Stitch queries, 8-22, 8-23
Stored procedure. See Query subjects

2 © 2003, Cognos Incorporated


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
INDEX

© 2003, Cognos Incorporated 3


Cognos Confidential. For internal use only.
This guide contains proprietary information which is protected by copyright.
W W W. C O G N O S . C O M

Vous aimerez peut-être aussi