TRAINING SERVICES
Cognos ReportNet Metadata Modeling
COGNOS
REPORTNET
–
METADATA
MODELING
Cognos ReportNet – Metadata Modeling CR1052 Published November 2003 While every attempt has been made to ensure that the information in this document is accurate and complete, some typographical or technical errors may exist. Cognos cannot accept responsibility for any kind of loss resulting from the use of this document. This page shows the original publication date. The information contained in this book is subject to change without notice. Any improvements or changes to either the product or the course will be documented in subsequent editions. This guide contains proprietary information that is protected by copyright. All rights are reserved. No part of this document may be photocopied, reproduced, or translated into another language without the prior written consent of Cognos Incorporated. Restricted Rights Legend. The Software and all accompanying materials are provided with Restricted Rights. Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in subdivision (b) (3) (ii) of the Rights in Technical Data and Computer Software clause at 252.227–7013. The Contractor is Cognos Corporation, 67 South Bedford St., Burlington, MA 01803–5164. The following acknowledgments represent all packages of ReportNet. Some may not apply to each component. Portions Copyright (C) Sun Microsystems, Inc. Sun, Sun Microsystems, the Sun Logo, iForce, Solaris, and the Java logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Portions Copyright (C) Adobe Systems Incorporated. Portions Copyright (C) 2000 The Legion Of The Bouncy Castle (http://www.bouncycastle.org). Portions Copyright (C) 2000–2002 Glenn Randers–Pehrson. Contributing authors Simon–Pierre Cadieux, Eric S. Raymond, Gilles Vollant. Portions Copyright (C) Meta Integration Technology, Inc. 1997– 2003 . All Rights Reserved. Meta Integration(R) Model Bridge (MIMB), Works (MIW), Repository (MIR), Repository SDK (MIRSDK), and Database SDK (MIDBSDK) are trademarks of Meta Integration Technology, Inc. Portions Copyright (C) JSQLConnect (TM) software components are provided by Net Direct LLC. Copyright (C) 1998–2003 Net Direct LLC. All rights reserved. JSQLConnect is a trademark of Net Direct LLC. Portions Copyright (C) Three D Graphics, Inc. Sample product images with the pound symbol (#) in the lower right hand corner are copyright (C) 1998 PhotoDisc, Inc. This product uses the Andalé WT typeface under license from Agfa Monotype Limited. Copyright (C) Agfa Monotype Limited. All rights reserved. Andalé is a trademark of The Monotype Corporation registered in the U.S. Patent and Trademark Office and certain other jurisdictions. Portions Copyright (C) 1986–2002 AccuSoft Corporation. AccuSoft and ImageGear are registered trademarks or service marks, and the patent–pending ReviewNow, DocsNow, NetVue, Image Guarantee, ScanDex, and the patented Network Document Streaming technology are trademarks of AccuSoft Corporation. Other company and product names mentioned herein may be trademarks or registered trademarks of their respective holders.
ii
Portions Copyright (C) 1998–2002 The OpenSSL Project. All rights reserved. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org/). This product contains Webfx Copyright (C) Erik Arvidsson and Emil A Eklund. Portions Copyright (C) Netegrity Inc. ALL RIGHTS RESERVED. Portions Copyright (C) 2002–2003, Systinet Corporation. All Rights Reserved. Portions Copyright (C) 2001 MetaStuff, Ltd. All rights reserved. Portions Copyright (C) 1995–1998 Jean–loup Gailly and Mark Adler. Portions Copyright (C) 1999, 2000 Boris Fomitchev. This software product includes STLPort libraries, which are provided "as is", with absolutely no warranty express or implied. Any use is at your own risk. Permission to use or copy these libraries for any purpose is hereby granted without fee provided this notice is retained on all copies. Permission to modify the code and to distribute modified code for the libraries is granted, provided this notice is retained, and a notice that the code was modified is included with the copyright notice. Portions of this software are Copyright (C) 1996–2002 The FreeType Project (www.freetype.org). All rights reserved. This product includes software developed by IBM. Portions Copyright (C) 1995–2002 International Business Machines Corporation and Others. All rights reserved. This software is provided "as is" and any expressed or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall IBM or its contributors be liable for any direct, indirect, incidental, special, exemplary or consequential damages (including but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. This product includes software developed by the Apache Software Foundation (http://apache.org/). Portions Copyright (C) 1999 The Apache Software Foundation. All rights reserved. This software is provided "as is" and any expressed or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the Apache Software Foundation or its contributors be liable for any direct, indirect, incidental, special, exemplary or consequential damages (including but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. This software/documentation contains proprietary information of Cognos Incorporated. All rights are reserved. Reverse engineering of this software is prohibited. No part of this software/documentation may be copied, photocopied, reproduced, stored in a retrieval system, transmitted in any form or by any means, or translated into another language without the prior written consent of Cognos Incorporated. Cognos, the Cognos logo and Cognos ReportNet are trademarks or registered trademarks of Cognos Incorporated in the United States and/or other countries. All other names are trademarks or registered trademarks of their respective companies.
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
iii
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
•
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
Slides
Demos
Workshops
Est. Time
19
1
0
1hr. 10 mins
Slides
Demos
Workshops
Est. Time
19
2
1
1hr. 20 mins.
Slides
Demos
Workshops
Est. Time
38
8
3
3 hrs. 30 mins.
Module 2: Design and Create a Project Topics
•
identify and apply model structure best practices
•
create a project
•
import Metadata
•
define function sets
•
organize objects
•
publish the model
Module 3: Prepare the Metadata Topics
•
examine Limited Local versus Database Only processing
•
create relationships between query subjects
•
modify query item properties
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
v
COGNOS
REPORTNET
–
METADATA
MODELING
Module 3: Prepare the Metadata (cont’d) Topics
Slides
•
create and test new query subjects
•
create calculations
•
create macros using parameter maps and session parameters
Demos
Workshops
Est. Time
3 hrs. 30 mins.
Module 4: Prepare the Business View •
add a presentation layer to our model
•
create stand–alone and embedded filters
•
use a prompt value to refine a query
17
3
2
1 hr. 30 mins.
20
2
1
1 hr. 20 mins.
3
1
1.0 hr. 10 mins.
Module 5: Manage Packages •
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
Module 6: Set Security in Framework Manager
vi
•
examine the ReportNet security environment
•
create and apply security filters
•
restrict access to query subjects and query items
•
restrict access to packages
17
© 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
•
implement repository control
•
segment and link a model
•
examine action logging and project synchronization
•
check a project
Slides
Demos
Workshops
Est. Time
19
3
0
1.0 hr.
Slides
Demos
Workshops
Est. Time
18
3
0
1 hr. 20 mins.
Module 8: Use Advanced Modeling Techniques Topics
•
resolve recursive relationships
•
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
vii
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
ix
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
Setup
PREFACE
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
xi
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
xiii
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 and browse to
\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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
xv
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
xvii
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
xix
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 \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 \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.
xx
Click Finish.
© 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 \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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
xxi
COGNOS
REPORTNET
–
METADATA
MODELING
Prepare for Samples and Solutions Deployment 1. Open Windows Explorer. 2. Navigate to \Program Files\cognos\crn\ webcontent\samples\content. 3. Copy the Cognos_Samples.zip file. 4. Navigate to \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 \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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
xxiii
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 Consumers role.
for the
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
xxv
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
xxvii
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
xxix
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 the product
Alt+Tab or click the application name on the status bar
You can also jump to a specific slide by typing its slide number and pressing the Enter key. However the slide number is not the same as the printed page number because a page may be built from several slides to produce an animation sequence. Important Tips: •
xxx
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.
© 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). Use this slide to welcome the participants to the course, to introduce yourself, and to mention your background (for example, how long you have been teaching the course, your teaching experience overall, how long you have been working with the product, and so on). Make sure you have customized the slide ahead of time.
Instructor Introduction Course Name Instructor Name Instructor Background
Have the participants take turns introducing themselves with respect to the items listed on this slide. The intent of the slide is to act as an icebreaker and to encourage participation.
Student Introductions Name Company Position Product Experience Personal objective(s) for this course
Use this slide to go through the list of administrative items that participants often ask about.
Administrative Items Sign-in sheet Smoking Messages Telephones Washrooms Refreshments Turn off cell phones and pagers
Class Format lecture with slides student guides as reference material
hands-on demos to learn and practice
independent workshop exercises for more practice
Use this slide to explain the class format and emphasize that participants are encouraged to actively perform the hands–on demos while following along with the instructor.
Mention that the Student Guide contains copies of the slides and further supporting notes for the participants to use as reference material in the future.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
xxxi
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
xxxiii
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 [email protected]. 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 [email protected]. 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 [email protected]. 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
II
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
III
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
IV
•
Cognos ReportNet – Introduction to Report Authoring
•
Cognos ReportNet – Ad Hoc Querying
•
Knowledge of SQL and data modeling
© 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 online
You are working in the product and you need specific task-oriented help.
Framework Manager – Help menu/Contents
Books for Printing (.pdf)
You want to use search engines to find information. You can then print out selected pages, a section, or the whole book.
Framework Manager - Help menu\Contents\Introduction, click an online book
Use online books (.pdf) if you want to know how to get something done but prefer to read about it in a book. The online books contain the same information as the online help although the method of presentation may be different.
Documentation CD \webcontent\ documentation\, scroll down and choose ug_fm.pdf Windows Start menu/Programs/Cognos ReportNet/Documentation/ Framework Manager
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
V
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
VII
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
IX
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
•
The Great Outdoors Company is a sporting goods and camping equipment wholesaler with operations in Europe, the Americas, and Asia Pacific.
•
You are a data modeler tasked with providing report and ad hoc query authors at the Great Outdoors Company with a business presentation 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 need to use it. The Great Outdoors Company has just purchased the Cognos ReportNet solution, and you will use Framework Manager to prepare the appropriate metadata models.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Instructional Tips Inform students that this scenario will be used throughout the demos and workshops of this course. They will create a project, and then model the metadata within that project. They will learn and apply the Framework Manager workflow process.
This course uses the GO Sales and GO Retailers databases, which are MSSQL databases containing transactional and operational data for the fictional Great 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.
XI
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 item, and then click Properties. Notice that the usage of this query item is set to attribute. This is a property that is set during the modeling process in Framework Manager. 7. Click Close.
Additional Information The usage and aggregate properties are set on query items to control how aggregate values will be determined in reports. These are set in Framework Manager, but the aggregate property can 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
XIII
COGNOS
REPORTNET
–
METADATA
9. On the toolbar, click Run Report
MODELING
.
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
XV
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
XVII
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 structure is a best practice for presenting model objects for use by report and query authors. This structure allows a modeler to logically group query subjects so that the authoring experience is intuitive. The Database layer represents foundation objects in the model, and are typically not available for use by authors. These objects map directly back to objects in the data source or are reusable objects for use in one or more presentation layers.
Additional Information An example of an object that maps directly back to an object in the data source would be a data source query subject that maps to a table in a relational database. An example of a reusable objects would be a calculation that is used in more than one 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. 9. Close Cognos Connection. Results: You have shown examples of reports that have been created in Report Studio and Query Studio based on the Framework Manager GO Model.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Instructional Tips Open Cognos Connection, log in with User ID = admin_person, Password = admin1234, and then delete the GOSL and GORT data sources from the Data Sources tab in the Directory tool. Otherwise, these data sources will be shown when you perform Demo 2-1, Task 4 - Create a data source and test the connection.
XIX
COGNOS
XX
REPORTNET
–
METADATA
MODELING
© 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
1-2
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
1-3
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
•
Framework Manager provides the metadata model development environment for ReportNet.
•
When you work in Framework Manager, you work in a project. A project contains metadata objects (the model) organized for report authors according to the business model and rules.
•
At the highest level, objects in a project include a model, namespaces, data sources, parameter maps, and packages.
•
After you define a Framework Manager project and namespace, you can publish a package containing metadata information to the ReportNet server for use by authors and query users.
Additional Information Framework Manager is a Windows-based client application as opposed to Query Studio, Report Studio, and Cognos Connection, which are Web-based applications. A model in Framework Manager is a business presentation of the structure of the data from one or more data sources. A model describes data objects, structure, and grouping, as well as relationships and security. The terms model and project are often 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
In Framework Manager, you will interact with the following objects:
Instructional Tips Additional information on projects, models, and query subjects will be presented on upcoming slides. Parameter maps are similar to data source look-up tables. Parameter Maps will be discussed in Module 3 – Prepare the Metadata.
•
project – contains metadata objects organized for report authors according to the business model and rules
•
model – the set of metadata that is available for publishing to the ReportNet server
•
namespace – container for an object; provides a unique name
•
folder – used to organize objects
•
query subject – maps to a corresponding object in the data source and uses an SQL statement to retrieve the data
Use folders to organize objects according to specific business views, for example, Sales, HR, and Inventory.
•
query item – contained within a query subject; maps to a column in the data source
Query subjects map to objects in the data source, such as tables, views, synonyms, procedures, or functions.
•
relationship – connection that explains how the data in one query subject relates to the data in another
•
parameter map - use parameters to create conditional query subjects that allow for substitutions at report run time
•
Additional Information The term namespace in Framework Manager has nothing to do with the term namespace in Access Manager. The namespace in Framework Manager plays no role in authentication.
When you create a relationship, you define the cardinality of each end of the relationship. 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
1-5
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.
1-6
•
A Framework Manager project appears as a folder that contains a project file (.cpf) and the specific XML files that define the project.
•
The files in a project folder are unique to each project.
Additional Information The project and the project’s associated files are contained in a project folder. It is recommended that no other files be added to this project folder. File definitions: • <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
© 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.
•
A report or ad hoc query author interacts with a run-time version of the Framework Manager model. This model appears as the set of published metadata on which reports and queries are based.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information Framework Manager publishes XML to the ReportNet server. The server compiles XML into binary run-time information after each publish. There may be a short delay on first use due to compile time.
1-7
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
1-8
contains query items based on the return list of a stored procedure
•
The most important component of the Framework Manager project is the query subject.
•
During the initial metadata import operation, a default data source query subject is created for each object you select (for example table) and creates the default relationships between query subjects for you automatically.
Additional Information The query subject for importing a table uses the following general SQL syntax: select * from . Model query subjects - can be enhanced even further, perhaps by adding filters or calculations to create more query items.
© 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
Plan for Implementation
Install
Configuration
MODEL
Framework Manager Projects
AUTHOR
CONSUME
Author Reports
Run, View, Print Reports
Publish Package
Setup & Maintain Security Administer Servers & Reports
•
Instructional Tips Before explaining this slide, instructors should be pointing students to the Services Reference Card, which contains the Cognos Solution Framework slide. This 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 platform.
As part of the Cognos ReportNet workflow, you use Framework Manager to develop metadata models. The Cognos ReportNet workflow Additional Information consists of the following phases: Manage •
Plan – develop the application scope, including identifying the user community, and establishing business & technical requirements
•
Manage – including installation, configuration, security setup and maintenance, and report and server administration
•
Model – model underlying data source metadata into business views, and publish those views for use by report and ad hoc query authors
•
Author – using Report Studio and Query Studio to create and save reports for the business community
•
Consume – end-users consume the required business reports
•
•
•
•
Installation – use install guides to install ReportNet, including the Content Store (MSSQL, Oracle, DB2) Configuration – use Cognos Configuration to: 1) set the initial configuration of ReportNet components after you install them, 2) configure ReportNet components if you want to change a property value or you add components to your environment, 3) start and stop ReportNet services Security Setup and Maintenance – 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
1-9
COGNOS
REPORTNET
–
METADATA
MODELING
Framework Manager Workflow Data Sources
Import
Design/Create Project
Prepare Metadata
Prepare the Business View
Publish
Create and Manage Packages
Manage Project
Set Security
Report Studio Query Studio
•
1-10
Content Store
Instructional Tips It is important to mention that although the diagram gives the appearance of a oneway flow, in a real-world scenario, metadata modeling is an iterative process. Metadata modelers may need to request database changes or additions (such as views, stored procedures and functions) to database administrators to meet the needs of their reporting application. They would then re-import objects, remodel and retest, repeating this process until the model meets the reporting requirements.
Before report authors can create reports, you must follow a workflow process in Framework Manager. This workflow consists of the following phases: Emphasize to students again, that this
workflow is also the basis for the flow of the course modules; and flow of the content, demos, and workshops within the modules.
•
Design and Create Project – foundation for the modeling process
•
Prepare Metadata – examine and modify properties and relationship, The graphic in the slide shows the organize objects
•
Prepare the Business View – add business value specific to reporting requirements
•
Create and Manage Packages – identify subsets of the metadata to be published
•
Set Security – based on ReportNet security, can be set at the package level or on individual query subjects and query items
•
Publish – to the ReportNet server for use by report authors to create reports
•
Manage the Project – to be performed throughout the modeling process, this includes a set of project management features used to manage the project, and other management tasks
Framework Manager workflow process, with publishing models as the final task. For the purposes of course flow we will be publishing models in the demos and workshops in each module. This is to view the results of modifications made to the models, right away, instead of waiting until the end of the modeling process (in this case after a 2 day course) to view them. Otherwise, students may not remember what they have modeled on the first day, and may not recognize those changes reflected in the reports and queries created in Query Studio and/or Report Studio. Additional Information Project management features include enabling multiuser modeling through version control, and sharing and reusing information through project linking and segmenting. Another management task includes verifying the project for errors or problems.
© 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: •
understand your data and the structure of your data source(s)
•
analyze and understand your reporting requirements
•
identify a project structure – how will it be organized
To create a Framework Manager project, you must: •
name a project and establish the file system location for project files
•
import the required metadata
You should also create a physical view of the metadata by organizing foundation objects into a separate physical layer.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information Understanding data and structure of data sources – for example, data source type, locations, and connections. Identifying project structure – for example, use a two-tier model to determine how metadata is presented to users (for example folders, namespaces). You should import only what you need (for example, tables, procedures, etc…). This will depend on how you design.
To create a two-tier model, use a combination of folders and/or namespaces 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.
1-11
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.
To prepare the model for reporting, you must examine and, if necessary, modify the imported metadata. To do this, you may have to: •
1-12
specify whether query processing occurs entirely at the database or partially on the local server
•
define functions sets that are available in the project
•
examine and modify object properties, such as name, description, usage, and aggregate rule
•
examine and modify relationships such as ambiguous relationships, or create relationships, for example, between two data sources
•
edit the SQL in a query subject definition
Additional Information You should modify ambiguous relationships so that you achieve the query results you expect. An example of an ambiguous relationship is a redundant relationship. This occurs when a query would have more than one possible path between query subjects. One path may achieve accurate results, while the other may achieve inaccurate results. You may have to modify a relationship by changing the cardinality. For example, you may want a relationship defined as an outer join (0…n) rather than an inner join (1…n). For reporting purposes, you may have to create relationships that do not exist in the underlying data source. For example, if you want to run a query that spans two data sources, but no relationship exists between them, you must create a relationship between them in the Framework Manager model.
© 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
•
Create one or more presentation views based on business or organizational requirements.
•
You can add business rules to the query subjects in your model to refine the data retrieved and ensure that the right information is 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 conformed dimensions
•
specify dimensional information
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information For example, you could create separate presentation views for HR, IT, Sales. These views would contain query subjects that have been modeled to meet the specific business requirements of each group.
Instructional Tips Star schema groups and specifying dimensional information are discussed in Module 8 – Use Advanced Modeling Techniques.
1-13
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
1-15
COGNOS
REPORTNET
–
METADATA
MODELING
Manage the Project Manage Project
Perform project management activities such as:
implementing multiuser modeling
sharing and reusing information
•
1-16
repository control
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
© 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.
•
After you create or open a project, the project page appears. This page contains several panes and views that you can use to view and modify the objects in a project, including the: •
•
Project Viewer – shows the objects in a project in a hierarchical view. You can use the Project Viewer to view, modify, and create objects. Project Info, Object Diagram, and Object Explorer views: •
Project Info view – shows the highest level objects in the project; you can navigate to, view, and modify other child objects
•
Object Diagram view – shows the hierarchy and relationships between objects in a project in a diagram
•
Object Explorer view – shows the contents of a project, similar to any file system
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information The project page is the environment in which you design, package, and publish project metadata. In the Project Viewer, you can create query subjects, data sources, namespaces, parameter maps, folders, segments, links, calculations, filters, and packages. In the Object Diagram view, relationships between query subjects are shown as lines with cardinality notation. You can expand objects that are grouped in folders to show the hierarchy of the query subjects and relationships that it contains. To organize objects In the Object Diagram view, click Auto Layout from the Diagram menu. To center a query subject, click a query subject and, from the Diagram menu, click Set Focal Point. In the Object Explorer view, you can 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.
1-17
COGNOS
REPORTNET
–
METADATA
MODELING
•
Properties pane – lets you view and modify the properties of the objects you last selected in the Object Explorer view, Object Diagram view, Project Viewer, or Search pane.
•
Summary pane – shows the statistics and tasks available for a selected object:
•
•
Statistics section - shows the number of objects, by class, located in the currently selected object
•
Tasks section - shows actions that are applicable to the currently selected object, based on the object class
Search pane - lets you quickly find objects by applying different criteria that describe the object you want to search for
Additional Information Object properties are set during import, and some property values can be modified during modeling. You can use the Properties pane to add, modify, or delete the properties of objects. In the Statistics section, if the selected object contains a folder, the contents of the folder are included in the number count. Selected objects include projects, namespaces, and folders. The object selected by default is the project. In the Tasks section, if you select a folder, actions for the folder are listed. If you select 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
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., [GoSales].[Product].[ProductCode]
e.g., query subjects:[GoSales].[Product]
All objects in a project must be identified by a unique name that is used to reference them. The identifying name can consist of one, two, or three parts, depending upon the type of object. The parts include: •
an object name
•
a location in the project hierarchy, as expressed in the default language of the project
Additional Information If you want to have objects with the same name in a project, these objects must be contained within different namespaces. Most of the objects in a Framework Manager project have a two-part identifier. The two-part identifier consists of the name of the containing namespace and the name of the object. The object name must be 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
1-19
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 Purpose: As the Data Modelers for The Great Outdoors Company, we have been tasked with developing a model that supports the business requirements of our report and ad hoc query authors working with Cognos ReportNet. Before we begin the modeling process, we will explore the Framework Manger user interface to become familiar with it and to facilitate the modeling process. Task 1. Open a project. 1. From the Start menu, point to Programs, Cognos ReportNet, and then click Framework Manager. The Welcome window of Framework Manager appears. From here you can create projects, navigate to, and open existing projects, or open a project that has been recently opened. 2. Under Projects, click Open a project, and then in the Open Project dialog box, navigate to C:\ProgramFiles\cognos\crn\ webcontent\samples\Models\gosales_goretailers. 3. Click gosales_goretailers.cpf, and then click Open. 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 gosales_goretailers project opens in Framework Manager. Task 2. Examine objects in the Project Viewer. 1. In the Project Viewer pane, expand the gosales_goretailers namespace
.
The model consists of a root namespace that cannot be deleted. All other objects appear within this namespace. At the level that is now shown, this namespace contains query subjects and folders. From the icons, we can see that some of the query subjects contain query items of type Fact
, while others do not
2. Expand the Orders query subject
.
Instructional Tips If necessary, maximize the Framework Manager Welcome window. Unless specified in a step, you will always log on to Framework Manager and Cognos Connection using the following credentials: User ID = admin_person, Password = admin1234 After logon, a message box may appear indicating that the language you are logged on with is not one of the supported languages of this model. It also states that the language English will be used as the active language of the model. This message appears because you are logging into Framework Manager through a Web page. This page is opened through the browser, and the Logon is picking up the Locale setting of the browser. In this case, your browser Locale setting is set to English (United States), but this language locale is not one of the language locales specified or modeled in this project. To avoid getting this message, go to the language settings for your browser and set English as the default language of your browser. Alternatively, instruct students to disregard the message and click OK. This will not impact any steps to be taken in this demo. Additional Information Use the Properties pane to view and modify the properties of the objects you last selected in either the Object Explorer View, Object Diagram View, Project Viewer, or Search pane. Although the icon is not shown in the demo, you may also see query items of type Identifier . Query item types will be discussed in Module 3 – Prepare the Metadata.
.
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 Fact
, while others have their usage property set to
.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
1-21
COGNOS
REPORTNET
–
METADATA
MODELING
Additional Information A filter can be added as a model object or it can be embedded within a query subject definition. The latter can be done through the user interface or the query subject’s SQL can be manually edited. Filters will be discussed and demonstrated in Module 4 – Prepare the Business View.
3. Expand the Filters folder. This model includes some stand-alone filters that, when published as part of a package, can be used by report and ad hoc query authors to filter their reports. 4. Expand the Data Sources
folder.
This folder contains the two data sources currently referenced in this model. Data sources are specified during the import of metadata. 5. Expand the Parameter Maps
If there are query subjects that reference a data source in a model, then the data source cannot be deleted from the model.
folder. Instructional Tips The use of parameter maps, session parameters, and macros will be discussed and demonstrated in Module 3 – Prepare the Metadata.
. You can use a This folder contains a single parameter map parameter map in combination with a session parameter to create a macro that will allow you to model a single query subject to represent all possible data source languages. 6. Expand the Packages
folder.
that are available for This folder contains the packages 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 the middle of the user interface between the Project Viewer and the Summary panes.
This view provides a flat view of the contents of the project, as opposed to the hierarchical view objects provided by the Project Viewer. 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 then click Fit All.
, and
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 to zoom and re-draw your diagram.
can also be used
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 Current View, and then click Large Icons. The query subjects now appear with the same icons as seen in the Project Viewer.
Instructional Tips After step 8, tell students to scroll, if necessary, to find the query subjects in the diagram.
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. You can perform a search to quickly find objects and then change their properties. You can apply different criteria that describe the object you want to search for. You can either search for the object name alone, or add additional criteria, such as the location, class, or a condition. 2. In the Search for box, type product, and then click More.
Additional Information The Summary pane shows the statistics and tasks available for a selected object. The Statistics section shows the number of objects, by class, located in the currently selected object. The Tasks section shows actions that are applicable to the currently selected object, based on the object class.
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
1-23
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
1-25
COGNOS
1-26
REPORTNET
–
METADATA
MODELING
© 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
2-2
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
2-3
COGNOS
REPORTNET
–
METADATA
MODELING
Framework Manager Workflow Data Sources
Import
Design/Create Project
•
2-4
The Design and Create Project phase provides the foundation for the modeling process in Framework Manager.
Instructional Tips Remind students that the diagram shown on the Framework Manager Workflow slide will be built up and shown at the beginning of each module.
© 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 for design.
•
You design a project in Framework Manager to structure metadata in a format that will be meaningful, and minimize complexity, for report authors.
•
•
The recommended structure is a two-tier model with both a physical and presentation layer, where you: •
organize foundation objects into a physical layer
•
organize reporting objects into a presentation layer
When you design a project, you might want to consider where to share and reuse information, and where to organize a project according to business needs.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information You also attempt to structure the metadata in a way that will assist in model maintenance. The two-tier 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. You can create segments, or extend a project to other users by linking to other projects, to share and reuse information. One way of organizing your project is to create namespaces to allow duplicate 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.
2-5
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:
2-6
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.
© 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
•
The presentation layer makes it easier for report authors to find and understand their data.
•
The presentation layer is made up primarily of model query subjects that you create.
•
When creating the presentation layer, consider: •
using shortcuts instead of copies of query subjects
•
including a calculation or filter in the presentation layer only if it is used to satisfy a specific business requirement
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information Shortcuts make it easier to maintain metadata in the physical layer. This helps you maintain the objects by ensuring that changes to the target object are reflected in the shortcut. When you use shortcuts, consider where you use them and what the impact is on relationships: • shortcuts in the same folder as the target query subject use the relationships of the target query 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
2-7
COGNOS
REPORTNET
–
METADATA
MODELING
Create a Project Specify a name and file location for your project.
2-8
•
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.
© 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. This is the design language of the project and it cannot be changed.
•
You can add languages to the project after you have created it. When you add a language to a project, Framework Manager generates a new property value for every multilingual property of each object in the project.
Additional Information The design language value is stored in the model and cannot be changed. It serves as the default language value. You should make this selection based on the language of the metadata you will be working with. The selection you make will also become the active language of the project. This 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
2-9
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
third-party metadata sources
XML data file
Additional Information Importing Architect models includes models 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.
The data sources, from which you can import metadata into the model, include: •
relational databases - such as Oracle, DB2, and Microsoft SQL Server
•
existing Cognos ReportNet models
•
Architect models
•
Impromptu catalogs
•
third-party metadata sources
•
XML as a data source
Importing Impromptu catalogs includes 7.0, 7.1, and 6.1[Japanese and English Multibyte (EMB) catalogs. Impromptu Automation must be installed; the Impromptu migration utility must be installed. Use the migration utility to export Impromptu catalog (.cat) to the XML file, then import the XML file through the Import Wizard. Framework Manager supports the import of a wide range of third-party metadata sources (Informatica, Erwin, BO, Sybase, etc…). See the Import Wizard for a listing and description of the supported sources. “MetaIntegration”, a third-party software, is used as the bridge to these sources. Upgrades to the Metaintegration bridges 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.
•
Import from one or more of the supported sources.
•
To set up multiple data source access in your model, take these steps: •
Create a separate namespace to contain the data source query subjects from each data source.
•
Define at least one relationship between them using data source query subjects from each data source.
•
Create model query subjects using query items from any data source query subjects.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information The following rules are applied when setting multiple data source access in your model: • Like named tables from different data sources will result in name collision. For example, both GO Sales and GO Retailers have COUNTRY tables. By default, Framework Manager creates data source query subjects with the same name as the table. Resolve this by adding a second 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.
2-11
COGNOS
REPORTNET
–
METADATA
MODELING
Import Metadata Import metadata from a relational database. Select Object for Import
Select Import Source
Select Data Source
Select Objects to Import
Select Criteria to Generate Relationships
Import Create Data Source
•
Additional Information You can import metadata into a namespace or a folder.
The slide above shows the import process of metadata from a relational database. Choose the model object, into which you will 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 data source:
When creating a connection, the wizard is interfacing with the New 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 3. Select the objects to import, for example, tables, views, or procedures. 4. Select the criteria for how Framework Manager will generate relationships.
2-12
Framework Manager creates relationships during the import of data. You can specify the criteria that will be used to generate those relationships.
© 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
•
You need to select at least one of the following options to control how relationships are created: •
Use primary and foreign keys – relationships are created based on the primary key/foreign key relationships defined in the underlying database
•
Use matching query item names that represent uniquely indexed columns – relationships are based on the contents of unique indexes of the two tables
•
Use matching query item names – creates relationships based on matching query item names and data types
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information The default option is Use primary and foreign keys. You can select multiple options to control how Framework Manager detects and generate relationships. The second option should be used when there are not many constraint relationships defined in the database, but there are many tables that have unique indexes defined. The third option should be used only when there are not many keys or indexes defined in the database, as it can generate too many relationships.
2-13
COGNOS
•
•
2-14
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
© 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.
•
A function set is a collection of vendor specific database functions.
•
The expression editor lists the function sets for all available vendors. However, you can restrict the function sets so that it lists only the vendors that you want to use in your project.
Additional Information You customize the function set by identifying the specific vendor for each data source defined in the 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
2-15
COGNOS
REPORTNET
–
METADATA
MODELING
Examine and Organize Objects After importing metadata:
examine objects to validate the metadata
organize objects to create a structure
Verify and test query subjects
•
2-16
Set properties 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
© 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.
•
You can export your Framework Manager model as a Common Warehouse Metamodel (.cwm) file.
•
You can export query subjects, query items, folders, namespaces, expressions and functions.
Additional Information CWM is used for exchanging metadata between different data warehouse tools and repositories. Each instance of the CWM metamodel is exchanged via XMI (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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
2-17
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 then click OK.
, and
A warning message appears indicating that the French language will be added to every text property of every object. © 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
2-19
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 and then click Rename.
namespace,
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 the same wizard that is used to create data sources through the Directory tool in the Cognos Connection administration interface. 4. Click Next, in the Name box, type GOSL, and then click Next.
Additional Information Data sources listed in the Import Wizard can only be deleted from the Data Sources tab in the Cognos Connection Directory 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. 7. Under Signon, select the User ID and Password check boxes, and then in the User ID, Password, and Confirm password boxes, type sa. 8. Scroll to the top of the page, click Test, and then click OK. A message appears indicating the test was performed successfully. 9. Click OK to close the message box.
The isolation level specifies how transactions that modify the database are handled. By default, the default object gateway is used. You can select from a list of isolation levels. Not all types of databases support each isolation level, and some database vendors use different names for the isolation levels. For more information on isolation levels, see the 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 Next. We do not require all the metadata objects in the database, only the tables and the columns within them. 3. Leave the defaults for the Generate Relationship criteria, and then click Import. The import process begins, and then a message appears summarizing the count of objects that were imported. 4. Click Finish. 5. In the Project Viewer pane, expand the gosales namespace. The namespace now contains a list of query subjects, which represent each of the tables that were imported from the relational database.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
After selecting which objects to import, there are two options to choose from to control how Framework Manager will handle a duplicate name when it is detected: • Option (1) Import and create a unique name: The import does not update the existing query subject (it is unchanged), but a new query subject will be created whose name is appended with a sequence number. All selected columns and corresponding keys and indexes will be generated for this new query subject. There is a problem with relationships 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.
2-21
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 significant modeling, we will take the opportunity to publish a package and view it as it would appear to report authors in its current state. We will repeat this task after each demo and workshop to provide some perspective as to how the model has changed as a result of our modeling efforts.
1. In the Project Viewer pane, right-click Packages, point to Create, and then click Package. The Create Package Wizard appears. 2. In the Name box, type GO Model, and then click Next. 3. Leave the default selections, and then click Finish. 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 the remaining defaults, and then click Publish.
We will be discussing Model Versioning in 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/cgibin/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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
2-23
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 model. However, notice that when we added the PRODUCT_NAME query item, we obtain a row for each language that is currently in our multilingual database. This is highly inefficient, 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.
Instructional Tips Modeling techniques for developing a model that supports a multilingual audience will be covered in Module 3 – Prepare the Metadata.
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
2-25
COGNOS
2-26
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
2-27
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 namespace.
Project Viewer
•
The new namespace is called goretailers.
2. Create a data source and test the connection.
goretailers namespace
•
To create the data source, use the following information:
3. Import metadata.
4. Publish the package.
Database layer folder
Import Wizard
Import Wizard
Publish Wizard
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
•
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.
•
Choose the data source.
•
Import tables only.
•
Leave all default selections in the Wizard.
•
Publish the GO Model package.
•
Accept defaults and overwrite the existing package.
•
Save the project.
2-29
COGNOS
REPORTNET
–
METADATA
MODELING
Task
Where to Work
Hints
5. Create an ad hoc query in Query Studio using the updated run-time model.
Query Studio
•
Create a query using the RETAILER_NAME query item from ORDER_HEADER, the CITY query item from 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.
Database layer folder gosales and goretailers folders
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
2-31
COGNOS
2-32
REPORTNET
–
METADATA
MODELING
© 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
3-2
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-3
COGNOS
REPORTNET
–
METADATA
MODELING
Framework Manager Workflow Data Sources
Import
•
3-4
Design/Create
Prepare the
Project
Metadata
Prepare metadata – examine and modify properties and relationships; organize objects.
© 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.
•
•
Limited Local – means that the database server does as much of the SQL processing and execution as possible. However, some reports or report sections use local SQL processing
Additional Information The default selection depends on the database in question. The Limited Local setting is not usually required. In some cases such as with conversion functions, Limited Local may need to be set.
•
Database Only – means that the database server does all the SQL processing and execution with the exception of tasks not supported by the database. An error appears if any reports or report sections require local SQL processing.
If you receive an error message specifying that Limited Local processing is required, examine the error message and determine if the requirement meets your needs and is not actually a modeling error.
There are two types of query processing to choose from:
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-5
COGNOS
REPORTNET
–
METADATA
MODELING
Examine Relationships in Framework Manager Relationships are maintained in the object diagram. They define the cardinality between query subjects.
3-6
cardinality defines the numeric relationships between occurrences of the query subjects on either end of a relationship
•
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: •
the numbers 1..1 and 1..n on the relationship line state the cardinality
•
1..1 means there is only one record
•
1..n means there is one or more than one record (never zero)
•
0..1 (not shown) means there is zero or one record
•
0..n (not shown) means there is zero, one or more than one record
Additional Information Cardinality defines how many rows exist in one query subject for each row in the other.
Additional Information The left most number in the cardinality (1.. and 0..) indicates if the relationship is inner (non optional) or outer (optional) respectively. The second number (..1 and ..n) in the cardinality tells ReportNet whether to account for multiple records when generating results.
© 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. Physical Layer
Presentation Layer
Product
1..1 0..n
Product_Forecast
Product
1..1 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.
•
If you create a relationship between two query subjects in the presentation layer, that relationship will override the existing physical layer relationship. This allows a further degree of control in your reporting requirements. Perhaps, for a specific report, the physical layer relationship does not meet your reporting requirements. You can create the appropriate relationship in the presentation layer specific to that reporting need so that relationships in other presentation layers are not affected.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information The best practice is to create and maintain relationships in the physical layer. If you have a need to override the physical layer, you must be careful as you can damage other relationships in your presentation layer.
3-7
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 1..n
Hierarchical Relationships 1..n
1..1
Parallel Relationships
1..n
1..1
1..1
1..1 1..n
• •
•
•
3-8
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 patterns that may make it difficult to write queries that retrieve the appropriate data. This is because it may not be clear which table columns must be included in the Select statement. Going through either path produces a result, but you should specify the correct or more efficient path. Hierarchical relationships involve multiple query subjects, each of which represent a level in a hierarchy. If you need to use only the query subjects on either end of a hierarchy, ReportNet is aware of the middle query subject(s) and writes the appropriate SQL to return the correct results. Parallel relationships can result in double–counting. ReportNet 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.
Ambiguous or Redundant Relationships are the only types of relationships that need to be addressed when modeling metadata in Framework Manager. ReportNet handles Hierarchical Relationships and Parallel Relationships. Appendix B also addresses, in more detail, how these issues are handled in Frameworks Manager. The best practice for modeling relationships is to go for maximum clarity. As you resolve one scenario, you may create another. This does not mean that your relationships are incorrect. Just make sure that they meet your business rules.
© 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 1..1
Sales Branch 1..1
1..1
1..n
1..n
Orders
Orders 1..n
1..n
Relationship in
1..1
1..1
0..n
Sales Staff
1..1 Shortcut to Sales Staff
0..n Sales Staff
Question
•
In the slide example, we see ambiguous relationships between the three query subjects. Which relationship will be used when querying all three query subjects together?
•
We can create a shortcut to Sales Staff, delete the original relationship between it and Orders and then create the same relationship between the shortcut and Orders, as seen in the slide example.
•
When you create the presentation layer, you can use folders to logically isolate query subjects and shortcuts so that report authors know they are using the appropriate relationships.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information This concept is similar to creating alias tables. Instructional Tips This would be a good time to show Order header to Sales branch to Sales Staff relationship wheel in the GO Model to better illustrate this concept. This ambiguous relationship path will be resolved in the following demo.
3-9
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-11
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 0..n. The result appears as shown below:
Instructional Tips This is a good time to click on the Relationship SQL tab to show students the 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-13
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 Diagram as well as in the Project Viewer. 3. Right–click the Shortcut to SALES_STAFF shortcut, and then click Create Relationship. The Relationship window appears.
Additional Information After a shortcut has been created, you can always view the target of the shortcut by looking at the Target Object Reference property in the Property pane.
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-15
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-17
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.
•
Data source query subjects contain SQL statements that directly reference data in a single data source.
•
Model query subjects create query items that are oriented to reporting needs (presentation layer) while reusing the underlying data source queries.
•
Stored procedure query subjects are generated when you import any procedure that is not identified as a function in the data source. This type of query subject will call a stored procedure in the database, which will return a result set.
3-18
Additional Information Each query subject type has its own advantages, depending on how you want the query to retrieve information. When you create a query subject, Framework Manager prompts you to identify the type of query subject you wish to create: data source, model, or stored procedure.
We will discuss stored procedures in more detail elsewhere in this module.
© 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.
•
With data source query subjects you also have the ability to change the SQL type (Cognos SQL, native, or pass–through).
•
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information Cognos SQL, native, and pass–through will be discussed elsewhere in this module.
3-19
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.
•
You can modify your SQL to include filters (as seen in the slide example), calculations, UNIONS, nested select statements, or any other SQL requirement you may have.
•
This functionality gives the metadata modeler a greater degree of control over what data is returned when a query is executed.
3-20
Additional Information If you change column titles, Framework Manager regenerates the query item as a new item. Any previous changes made to the query item properties will be lost.
© 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 •
By default, Framework Manager uses Cognos SQL to create and edit query subjects. Cognos SQL adheres to SQL99 rules and works with all tabular data sources.
•
Native SQL is the SQL the data source uses, such as Oracle SQL.
•
Pass–through SQL lets you use Native SQL without any of the restrictions the data source imposes on subqueries.
Generate SQL •
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.
•
When the generation type is set to As View, Framework Manager generates queries that contain the full SQL statement of the query subject, which bypasses certain query optimization.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information Framework Manager generates the most optimized SQL possible, while preserving its functionality. In this way, Cognos SQL offers the most added value. You cannot use Native SQL in a model query subject that references more than one data source in the project. Pass-Through SQL query subjects are not processed as subqueries. Instead, the SQL for each query subject is sent directly to the data source where the query results are generated.
Instructional Tips This is a good time to open a query subject definition window, click on the Options 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.
3-21
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
•
3-22
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.
© 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 the Format property. You can also add descriptive information and screen tips for your query items.
Additional Information With the format property you can display Quantity as a number with a thousands 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-23
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
•
An Identifier is usually a key, index, date, or datetime data type. It represents a column that is used to group or summarize the data in a Fact column with which it has a relationship.
•
A Fact is usually a numeric or timeinterval data type. It represents a column that contains numeric data that can be grouped or summarized, for example, Product Cost.
•
An Attribute is usually a string data type. It represents a column that is neither an Identifier nor Fact, such as Description or Product Name.
•
Setting the property to Unknown is used when a modeler is unsure of the data’s role.
3-24
Additional Information During import, the Usage property is set according to the type of data that the query items represent in the data source. If data meets multiple criteria these rules are applied in the order in which they are listed. For example, if you import a numeric column that participates in a relationship, the Usage property is set to "identifier". When you create a model query subject, each query item inherits the Usage property of the query item on which it is based.
© 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.
•
Aggregate settings include sum, count, and average, as well as several others.
•
The report author can either use this default setting to perform calculations on groups of data, or override it by using the reporting application to apply a different type of aggregation.
•
During import, Framework Manager uses the Usage value to determine the value of the Regular Aggregate property of each query item.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information You may also choose to have no aggregation applied at all, which would return detail rows. If desired, report authors can override the default aggregation setting at design time.
3-25
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-27
COGNOS
REPORTNET
–
METADATA
MODELING
Task 3. Define the default behavior of a prompt control. 1. In the gosales namespace, expand the ORDER_HEADER query subject.
Additional Information This will create a prompt with a calendar 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, you now see one entry for both languages (English and French). However, both entries are in English.
Additional Information You may want to mention that you can also 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-29
COGNOS
REPORTNET
–
METADATA
10. On the toolbar, click Run Report
MODELING
.
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 the previous report.
, and then click No to avoid saving
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 Namespace. 10. Expand (fr) ORDER_HEADER, and then point to RETAILER_NAME. A screen tip appears, containing the French text that we specified in Task 4.
Additional Information The (fr) prefix indicates we are now in the French version of the model but we have not yet translated all of our metadata titles and properties, hence the (fr) prefix. We will not translate the entire model but rather show how to do it through specific 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-31
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 arrow
to move them to the Languages to be exported column.
3. Click Browse
.
The Export Language Translation File dialog box appears. 4. In the Save as type box, click CSV (comma delimited) (*.csv). 5. Navigate to C:\Edcognos\CR1052, in the File name box, type GO_Application_LOC.csv, and then click Save. 6. Click OK. A message appears, indicating that the language strings were successfully exported. 7. Click OK, open Windows Explorer, and then navigate to C:\Edcognos\CR1052.
Additional Information We can edit the metadata in Framework Manager, or we can translate the metadata to a more convenient format, such as CSV or Unicode text. We used the first technique in the previous demo. When you export language strings to a TXT or CSV file, you can translate them as necessary. A customer may even send this file to a translation firm for professional translation. The TXT or CSV file only contains the strings that exist. If a given item has no description or screen tip, then no entry will be created and therefore no translation can be imported. For this reason, you should 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-33
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 box.
to add French to the Translate into
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-35
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-37
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-39
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-41
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-43
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-45
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 required, for the newly created query items.
Instructional Tips Ask the students what they think the settings should be.
8. Save the model.
They can use the Order Details and Order Header query subjects as a guideline for these property settings.
Task 3. Re–publish the model 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 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-47
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
•
The example in the slide shows a SQL statement from the ORDER_DETAILS query subject. This SQL statement includes a reference to the Calc_Actual_Revenue function in the data source (as seen below). CREATE FUNCTION Calc_Actual_Revenue (@Quantity int, @Sale_Price decimal(6,2)) RETURNS decimal(6,2) AS BEGIN
Additional Information The reference to the Calc_Actual_Revenue function will be represented as a query item called ACTUAL_REVENUE within the query subject and will return a value for each row of data as calculated by the function. Depending on how you write your SQL to reference the function you may need to adjust your SQL Settings in the query subject’s Options dialog box.
return @Quantity * @Sale_Price END •
3-48
This function is passed two values, the QUANTITY and UNIT_SALE_PRICE values.
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-49
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-51
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:
query items
parameters
functions
[gosales].[ORDER_DETAILS].[QUANTITY] * Operator
[gosales].[ORDER_DETAILS].[UNIT_SALE_PRICE]
There are two types of calculations:
embedded
stand–alone
Query Items
•
If you want to use a calculation with only one query subject, you can create an embedded calculation while modifying a data source query subject or model query subject.
•
Create stand–alone calculations when you want to use reuse the expression by doing any of the following: •
apply it to one or more query subjects to provide calculated data to 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
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information In the previous demo, we used a userdefined function in the data source to calculate the ACTUAL_REVENUE value for us. We can also use calculations in Framework Manager to achieve the same type of result. In this case, we are calculating planned revenue. If you start with an embedded calculation, you can later convert it into a stand-alone expression that you can apply to other query subjects.
3-53
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-55
COGNOS
REPORTNET
8. Click Test Sample
–
METADATA
MODELING
.
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 then double–click the division operator .
, and
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-57
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)
value (used for substitution)
Key Column
Value Column
cs
CS
cs–cz
CS
da
DA
da–dk
DA
de
DE
de–at
DE
de–ch
DE
Tab–Delimited Parameter Map File
•
You can use parameters to create conditional query subjects that allow for substitutions at report run time.
•
A parameter map is a second layer of substitution that ensures your application receives a value it can understand.
•
The key column represents the parameter that is passed to the model. All parameter map keys must be unique so that Framework Manager can consistently retrieve the correct value.
•
The value column represents the value that is to be substituted for use with your application.
•
Keys and values can be manually entered, imported from a file, or based on existing query items in the model.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information Parameter maps can only be used within a macro. The tab-delimited parameter map file shown in the slide example would be used to handle multilingual data. The Key Column is a session parameter called runLocale, which indicates the users current language setting. The Value Column is the language code, which is used in the database in either the column titles or in the data itself. This will be illustrated in the following demo.
3-59
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.
•
You can use a session parameter to affect your query result set. For example, in a multilingual model, you would use the runLocale session parameter to determine the language in which the data should be returned.
•
You can define an override value to test the results that value returns.
•
The override value is valid only while you have the model open, and is not saved when you save the model. If no override value exists, Framework Manager uses the default value when it executes a query that contains a session parameter.
3-60
Additional Information Currently adding new session parameters is beneficial for testing purposes. For example, you could create a session parameter called Database with a value that represents your test database. Create a macro for your Content Manager Data Source property in place of the hard coded value generated when creating your data source. Now you can change the session parameter value from your test database to your production database to test your model in either environment.
© 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
•
The macro in the slide example is used to determine the user’s language locale and then substitute it for a language code that is used in the data source.
•
The reference to the parameter map has the following syntax: $[Locale Map]{}. 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.
•
Additional Information Macros can be used in query subject definitions, calculations, filters and certain model object properties such as the Catalog property of a Data Source object. Do not insert macros between existing quotation marks or square brackets because Framework Manager does not execute anything within these elements.
The resulting expression is illustrated in the slide example and is enclosed by the # character.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-61
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-63
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-65
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-67
COGNOS
REPORTNET
–
METADATA
MODELING
Summary In this module, we have:
3-68
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
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-69
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
•
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.
THE
METADATA
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-71
COGNOS
REPORTNET
–
METADATA
MODELING
Workshop 3–1: Task Table Task
Where to Work
1. Create a relationship goretailers namespace between Object Diagram View RETAILER_SITE and ACTIVE_INDICATOR_ Relationship Definition LOOKUP. dialog box
2. Create a relationship between GENDER_LOOKUP and CONTACT.
3-72
goretailers namespace
Hints •
Use the ACTIVE_INDICATOR query item from both query subjects.
•
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.
•
Use the GENDER_CODE query item from both query subjects.
•
Cardinality on the 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.
Object Diagram View Relationship Definition dialog box
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
PREPARE
THE
Task
Where to Work
Hints
3. Merge metadata from two query subjects.
gosales namespace
•
Select both COUNTRY and COUNTRY_ MULTILINGUAL, then select Merge in New Query Subject.
•
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:
Object Diagram View Query Subject Definition dialog box
METADATA
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-73
COGNOS
REPORTNET
–
METADATA
MODELING
Task
Where to Work
Hints
4. Re–insert the macro from Demo 3–8, “Create a Macro Using a Parameter Map and a Session Parameter.”
Query Subject Definition dialog box
•
Replace "EN" in the from clause with #sq($[Locale Map]{$runLocale})#.
•
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.
•
Create a report with all the query items in the Country query subject, and save it as Wkshp 3–1a.
•
Create a report with RETAILER_SITE_CODE, 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.
Define Languages dialog box
5. Re–publish the package and view the merged query subject in Query Studio.
Cognos Connection
6. Create reports that use the new relationships.
Cognos Connection
Query Studio
Query Studio
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-75
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-77
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: •
•
goretailers namespace: •
3-78
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
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
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
PREPARE
•
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.
THE
METADATA
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-79
COGNOS
REPORTNET
–
METADATA
MODELING
Workshop 3–2: Task Table Task 1. Create the PLANNED_REVENUE calculation.
Where to Work ORDER_DETAILS query subject
Hints •
Create the formula as [gosales].[ORDER_DETAILS].[Q UANTITY] * [gosales].[ORDER_DETAILS].[U NIT_PRICE]
Calculation Definition window
2. Create the PRODUCT_COST calculation.
ORDER DETAILS query subject
3. Set the usage property for query items.
Properties pane
•
Set the usage to Attribute for the appropriate query items in the gosales and goretailers namespaces.
4. Change the aggregation type for query items.
Properties pane
•
In the gosales namespace, change the value of the Regular Aggregate property for the PRODUCTION_COST and MARGIN query items to Average.
5. Re–publish the package and view the results in Report Studio.
Cognos Connection
•
Create a report in Report Studio with PRODUCT_NUMBER, 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.
•
Create the formula as [gosales].[ORDER_DETAILS].[Q UANTITY] * [gosales].[ORDER_DETAILS].[U NIT_COST]
Calculation Definition window
Report Studio Query Studio
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-81
COGNOS
3-82
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-83
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
1. Add a macro to the PRODUCT_LINE query subject definition.
PRODUCT_LINE query subject
Hints • Change the SQL to read: Select PRODUCT_LINE.PRODUCT_LINE _CODE, PRODUCT_LINE.PRODUCT _LINE_EN AS PRODUCT_LINE from [GOSL].PRODUCT_LINE
Query Subject Definition dialog box 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 parameter in Framework Manager.
Session Parameters dialog box
•
Change the value of the runLocale parameter to fr.
3. Re–publish the package and view the results in Report Studio.
Cognos Connection
•
In Preferences, change the content language to French.
•
Create a report with (fr) PRODUCT_LINE_CODE and (fr) PRODUCT_LINE.
•
Save the report as Wkshp 3–3.
Report Studio
If you need more information to complete a task, see the Step–by–Step instructions for this exercise in Appendix A.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3-85
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
4-2
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-3
COGNOS
REPORTNET
–
METADATA
MODELING
Framework Manager Workflow Data Sources
Import
•
4-4
Design/Create
Prepare the
Prepare the
Project
Metadata
Business View
Prepare the business view – add business value specific to reporting requirements.
© 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
•
You can structure projects in many ways in Framework Manager. There are some best practices for structuring your Framework Manager projects to minimize complexity for report authors and to assist in model maintenance.
Additional Information Several packages can be created and published based on the presentation layer, each one providing a different view of metadata for different reporting needs.
•
The basic structure recommended is a two–layer model consisting of a physical layer (database layer) comprised of data source and stored procedure query subjects, and a presentation layer comprised of shortcuts and model query subjects.
Where appropriate, create calculations, filters, and other modifications in the physical layer to maximize reuse in the presentation layer.
•
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-5
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 Create Model Query Subject
•
Model query subjects contain SQL statements that do not directly reference a data source. Rather, they use metadata already in the model, such as query items that exist in other query subjects.
•
Because model query subjects are based on the metadata in your model, they let you:
•
4-6
Model Query Subject
•
reuse complex SQL statements that exist in the model
•
reference objects from different data sources in the same query subject
Additional Information Model queries can only read and test the underlying query subjects that they reference. If you edit the SQL of a model query subject, it becomes a data source query subject whose SQL corresponds to the data source query upon which it is based.
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.
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-7
COGNOS
REPORTNET
–
METADATA
MODELING
Demo 4–1: Create the Presentation Layer and Add Model Query Subjects Purpose: As a metadata modeler, you have been asked by report authors to create more intuitive orders and products query subjects. You will create a presentation layer with sub folders to organize the newly requested model query subjects and create intuitive relationship paths. Task 1. Create folders.
Additional Information IMPORTANT: Ensure that students are now using the GO Model Module 3 model provided on the Student CD. This ensures that all students are working from the same starting point and with a model that has all multi–lingual issues resolved as well as a consistent naming convention. The first time students publish the GO Model package, they may receive an access list warning message. Click OK to publish the model. This message simply indicates that the user that created and initially published the model is not on the student's machine.
1. Open Framework Manager. 2. In Framework Manager, open the GO Model Module 3 model located in C:\Edcognos\CR1052\GO Model Module 3. 3. In the Project Viewer pane, right–click the GO Model namespace, 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 pane: Order Number from Order Header Retailer Name from Order Header Order Date from Order Header
Additional Information After a model query subject has been created, you can always view the query item’s target reference by opening the Query Subject Definition dialog box and looking at the Source column in the Query Items and Calculations pane.
The model query subject should appear as shown below:
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-9
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 Subject
Query Items
Order Information
Returns
Return Date from Returned Item Reason Description from Return Reason Return Quantity from Returned Item
Product Information
Products
Product Number from 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-11
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 Notice the intuitive nature of the presentation layer query subjects. 4. Group the report on Product Line and Product Type. 5. Save the report as Demo 4–1. 6. Close Query Studio. Results: You have successfully created a presentation layer with 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Instructional Tips If time permits, you can also create an ad hoc report using the Orders by Sales Staff query subjects. This will illustrate the resolved ambiguous relationship from Task 3. Create the report using First Name, Last Name, and Position from Sales Staff and Quantity and Actual Revenue from Shortcut to Orders.
4-13
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
•
A filter is an expression that specifies the conditions that rows or instances must meet to be retrieved for the query subject, calculation, or report to which the filter is applied. A filter returns a Boolean value, equivalent to the predicate in the WHERE clause in an SQL statement, so that you can limit the rows returned by a query subject.
•
Framework Manager offers two user interface filters, stand–alone and embedded, but you may also include filters in the WHERE clause of your SQL definition.
•
Create stand–alone filters when you want to reuse the expression by doing any of the following:
•
4-14
•
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
Additional Information If you start with an embedded filter, you can later convert it into a stand–alone expression that you can apply to other query subjects. To do this, right–click the filter expression in the query subject editor and click Convert to Stand–alone Filter. You can also restrict the data that the queries in the model or a package retrieve by setting governors. This will be discussed in another module.
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.
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-15
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. 4. Navigate through the report using the links at the bottom of the report to notice that all product lines are included. 5. In the Menu, click the Insert Data link.
Additional Information If model versioning was not disabled when publishing the package, you will get a message stating a newer version of the model exists and asking if you would like to 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 report. Notice that the report only contains information on Mountaineering Equipment now.
Additional Information You can only drop one model filter on the report at a time because ReportNet uses the AND operator to combine the filters 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-17
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:
??
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.
•
You can use prompt values in:
•
•
parameter maps
•
session parameters
•
stored procedure arguments
•
expressions, including filters, calculations, and relationships
When you test a model object that references a prompt, Framework Manager asks you to enter the prompt value. Framework Manager uses this value for either the duration of the session, or until you clear the prompt value.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information If a stored procedure with a part number parameter returns all rows for a specified part number, instead of using the part number as the argument for the stored procedure query subject, you can use a prompt, such as ?Part_Number?. This will allow the end–user to specify which part they want to retrieve information for. You can change the session value of prompt values through the Options dialog box. This dialog box is available when you modify a query subject or define a calculation, filter, or complex relationship. This lets you change the prompt value at the time that you are testing the expression referencing that value.
4-19
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 gosales namespace under the Database Layer folder, then point to Create, and then click Query Subject. The New Query Subject Wizard dialog box appears. 2. In the Name box, type Find Order Date. 3. Select Stored Procedure, and then click Next.
Additional Information: This Stored procedure has already been created in the GOSL database provided on the Student CD. It expects an OrderNumber parameter that is used to retrieve the order date for that particular order.
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. 10. In the Edit Definition window, click the Test button. The Prompt Values dialog box appears. 11. In the Name column, select Order Number, and then click in the Value field. 12. In the Value field, type 1234, and then click OK. One record will be returned in the Test Results pane specifying the date for that particular order. 13. Click OK.
Additional Information When the stored procedure query subject is tested, you will be prompted to enter an order number value. When the always prompt for values check box is enabled in the Prompt dialog box, Framework Manager prompts you for a value every time you test the object. This check box only applies to testing, when updating the object or performing a count. If it is not enabled, Framework Manager uses the existing prompt value, if one exists.
14. Save the model.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-21
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-23
COGNOS
4-24
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-25
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 Information
Sales Rep
First Name from Sales Staff 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
Sales Targets
THE
BUSINESS
VIEW
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 Information
Retailers (Query Subjects are located in the goretailers namespace)
Type Name from Retailer Type Territory Name from Sales Territory 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-27
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 folders.
Project Viewer pane
•
Right–click Presentation Layer folder, point to Create, and then click Folder.
2. Create model query subjects.
Project Viewer pane
•
Right–click appropriate folder, point to Create, and then click Query Subject.
•
Select the Model query subject option.
•
Use the following syntax to create the Staff Name query item. [gosales].[Sales Staff].[First Name] || ' ' || [gosales].[Sales Staff].[Last Name]
•
Cut and paste Find Order Date query subject.
•
Create shortcut, then cut and paste it to the appropriate location. Rename it to Orders for 2001.
New Query Subject wizard Query Subject Definition dialog box
3. Move data source query subjects and create shortcuts.
Project Viewer pane Presentation Layer
If you need more information to complete a task, see the Step–by–Step instructions for this exercise in Appendix A.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-29
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-31
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 •
•
Outdoor Protection •
•
[gosales].[Product Line].[Product Line Code] =4
Golf Equipment •
•
[gosales].[Product Line].[Product Line Code] =3
[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 with an embedded filter and prompt value.
Project Viewer pane
•
Use the following syntax to create the Staff Name query 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.
•
Test the My Sales Staff query subject and provide a Manager Code value of 18.
•
Publish your package.
•
Use the Demo 4–1 report to test your newly created filters.
3. Test your filters.
Filter Definition dialog box
Framework Manager Cognos Connection Query Studio
If you need more information to complete a task, see the Step–by–Step instructions for this exercise in Appendix A.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-33
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
4-35
COGNOS
4-36
REPORTNET
–
METADATA
MODELING
© 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
5-2
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
5-3
COGNOS
REPORTNET
–
METADATA
MODELING
Framework Manager Workflow Data Sources
Import
Design/Create Project
•
5-4
Prepare the
Prepare the
Metadata
Business View
Create and Manage Packages
Create and manage packages – identify subsets of the metadata to be published.
© 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.
•
Each package can contain a different set of folders, filters, query subjects, and query items. You can completely customize its contents 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information Each report can contain information from a single package only.
5-5
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.
•
5-6
Additional Information Because governors control SQL generation, you use them to reduce system resource requirements and improve performance.
SQL is generated automatically on demand when you: •
run a report in Report Studio or Query Studio
•
test a query subject or relationship in Framework Manager
•
create a new query subject by transforming query subjects or merging objects
A setting of 0 indicates no limit. When a report is run that violates any of the governors set, you receive an error message.
•
By setting governors, you can restrict the number of tables retrieved by a query as well as restrict the number of rows returned. You can also set time limits for query execution, as well as restrict character length on binary large objects (BLOBs).
•
You can set run–time activities, such as deny outer joins and cross– product joins, which may produce very large and resource intensive queries.
An outer join retrieves all rows in one table, even if there is no matching row in another table. This type of join can produce very large queries and reports. A cross–product join retrieves data from tables without joins. This type of join can take a long time to retrieve and can produce meaningless results.
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
5-7
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
5-9
COGNOS
REPORTNET
–
METADATA
MODELING
Create and Modify Packages Include the model objects you want to publish in your package. Package
Model
•
Deselect objects you do not wish to be visible to end-users.
•
At any time, you may go back and edit the definition of your package by adding or removing objects. You must exercise caution when doing this as you may break reports based on a previous version of the model.
5-10
Examples In the slide example, we see a package called Go Sales and Retailers, which includes the majority of the presentation layer created in the model. It excludes the physical layer called Database view as report authors do not require this view of the metadata nor is it modeled for presentation purposes.
© 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.
•
You can specify which languages are to be published with each package. You can create several packages based on the same model, all with different languages.
Examples You may have one package designed for the Mexican sales offices. This package 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
5-11
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.
•
Upon publishing a package, the functions you selected will be accessible to report authors in Report Studio.
•
If you have multiple data sources in your model that are 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
Additional Information In our GO Model application we will only publish the package with the SQL Server function set, as it is the only database we are creating our data sources from.
© 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
•
•
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 dependent on it. With this information, you could notify report authors that a change was made to the model that affected their reports. They can quickly fix their reports so that consumers are not affected.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information Report will be broken indicates that something has been renamed or deleted in the model and will therefore invalidate a report. Report may be affected indicates that an object (for example, query subject, query item or relationship) has been edited and may affect the results returned by the report.
5-13
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
•
When you publish a package to the ReportNet server, you make it available to report authors with the appropriate security rights.
Additional Information You can also verify the entire model by using the Verify option in the Project menu.
•
Publishing to the network lets you back up or share all or a portion of your model with other metadata modelers. They can take this published version of the model and modify it to meet their needs without having to build the model from scratch.
If you wish to change the ReportNet server to which you publish, you need to change the Gateway URI setting in Cognos Configuration.
•
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:
•
5-14
•
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.
© 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 To see the number of model versions set for a package, select a package and, in the Property pane, find the maxVersions property.
•
When you publish a package with model versioning enabled, the next time you publish the same package, you update the version of the model in the existing package on the ReportNet server.
•
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 saved in the report specification.
You can remove all previous versions of the model for a fresh start by using the Delete all previous model versions option.
•
If the package is republished, report authors are notified that the report will use the newest version of the model in the package. The report author must save the report to complete the update.
Reports created against an expired model will need to be updated against the latest 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
5-15
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
United States
Canada
Model Packages
•
Use nested packages to reuse model information.
•
Nested packages save time, are easier to maintain, and let you publish only the master package to make all referenced packages available to report authors.
Additional Information You create three separate packages named Canada, Mexico, and the United States. Each package contains the project objects and security appropriate for that 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
5-17
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
5-19
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
5-21
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
5-23
COGNOS
5-24
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
5-25
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 package.
Project Viewer pane
•
Right–click Packages and select Create.
2. Create and publish a nested package.
Project Viewer pane
•
In the Create 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
5-27
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
6-2
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
6-3
COGNOS
REPORTNET
–
METADATA
MODELING
Framework Manager Workflow Data Sources
Import
Design/Create
Prepare Model
Enhance
Project
for Reporting
Model
Create and Manage Packages
Set Security
•
6-4
Set Security in Framework Manager based on security defined for the ReportNet application.
© 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.
•
It is built on top of one or more third-party authentication providers. You use the providers to define and maintain users, groups, and roles, and to control the authentication process.
•
ReportNet authorization involves a security object, which is used to apply a permission to an entry.
•
In addition to the external namespaces that represent the third-party authentication providers, ReportNet has its own namespace called Cognos. The Cognos namespace contains the Cognos security objects and enhances your organization’s security policies and deployment ability of applications.
•
Creating and modifying, groups, roles, and setting permissions in ReportNet is optional.
Additional Information Each authentication provider known to ReportNet is referred to as a namespace. Set up and configuration of authentication providers is performed in Cognos Configuration. Authorization is the process of granting or denying users access to entries (for example, folders, reports, etc…) and permissions to perform activities on that content based on their user name and roles. If security is not enabled, it means that no third-party authentication providers are 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
6-5
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.
•
Cognos ReportNet uses authentication providers so that you can make use of your existing user and group repositories.
•
Third-party authentication providers manage user authentication in ReportNet. Authentication providers define users, groups, and roles used for authentication. User names, IDs, passwords, regional settings, and personal preferences are some examples of information stored in the providers.
•
You configure authentication providers using Cognos Configuration. You can define multiple providers concurrently. If you configure multiple namespaces for your system, at the start of a session, you must select one namespace that you want to use. However, this does not prevent you from logging on to other namespaces later in the session.
Additional Information You do not have to replicate your existing repositories for use with ReportNet, so long as they already exist. Once you have configured the providers, you then apply the users and groups already defined, to ReportNet content. Out of the box, ReportNet supports LDAP, Active Directory, NTLM, SAP, Cognos Series 7, and Netegrity security sources. In the event that you do not use a supported repository, you can also create custom authentication providers. For example, you may have a proprietary user directory and/or authentication mechanism used for login. ReportNet provides the 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
user-defined groups or roles
You can:
create groups and roles specific to a ReportNet application
repackage users, groups, and roles from the authentication providers
avoid having to set up application specific authentication information in the authentication providers
Use is optional.
•
The Cognos namespace is the ReportNet built-in namespace. It is not used for authentication. It contains the Cognos security objects, which are pre-defined and user-defined groups and roles.
•
You use the Cognos namespace to create groups and roles that are specific to ReportNet. These groups and roles repackage the users, groups, and roles existing in the authentication providers to optimize their use in the ReportNet environment. By using the Cognos namespace, you avoid cluttering your organization security systems with security information required only in ReportNet.
•
The Cognos namespace always exists in ReportNet, but the use of Cognos groups and roles it contains is optional. You can use users, groups, and roles, directly from the authentication providers.
Additional Information The Cognos namespace also includes data sources, distribution lists, and contacts, as created and modified in Cognos Connection. You can rename the Cognos namespace using Cognos Configuration, but you cannot delete it. It also contains the following built-in, predefined security entries: • Anonymous account – If configured, allows public access without authentication • All Authenticated Users group – All users except Anonymous • Everyone group – All Authenticated Users + Anonymous • System Administrators role – Members are super users (System prevents accidental deletion of this group; can choose to not use this group by removing all membership In addition to the Anonymous user and built-in groups defined in the Cognos namespace, several additional groups are 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
6-7
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)
•
In Framework Manager, security is a way of restricting access to metadata and data across ReportNet products.
•
To implement security in Framework Manager, you can: •
specify package access – apply metadata security to a package by identifying who has access to that package
•
give visibility rights to an object – apply object-based security directly by either making the object visible or keeping it hidden
•
6-8
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
Additional Information There are business reasons for restricting access to data. For example, you may have data that contains confidential data, and only specific users are allowed to see it. You may have a variety of data, and your users only need to retrieve data from specific tables or columns. Or, you may have a table that contains many records, and your users only need to retrieve a subset of records from that table. Each type of security implementation uses users, groups, and roles to define access.
© 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
•
When you specify package access, you specify which users, groups, and roles (entries) have access to the published model.
•
You can add entries created both in third-party authentication providers and in ReportNet as members of a Cognos group.
•
You can also organize your security according to business rules by creating new groups or roles or by removing groups or roles.
Additional Information You can specify package access when you initially create the package using the Package Wizard, or by right-clicking a package and selecting Edit Package Access after the package has been created. The interface for creating new groups or 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
6-9
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.
•
By default, every object in your project is visible to everyone. When you set object visibility you add object-based security by specifying which users, groups, or roles will be able to see the object in a runtime model.
•
Every time you include that object in a package, and publish it for report authors, the same security rules apply for that object. When you publish a package that contains secured objects, the visible objects for ReportNet users are the intersection of the package definition and the object security settings.
6-10
Additional Information Set object visibility - for example, in your project, you may have a Sales reps query subject. You can make the Sales reps query subject visible to the Sales Managers group, and keep it hidden from everyone else. If object-based security is not used, security applied to a package remains unchanged. 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 objectbased package, right-click the package, and click Explore Packages.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
SET
SECURITY
Define Security Filters Create a security filter to restrict the data returned by a query subject.
Major Market
• •
Small Market
A security filter controls the data that is shown to report authors
when they set up their reports. When you create a security filter, you apply it to a query subject, and then add the groups and roles, to which the security filter will be applied.
•
For each group/role, you can create a filter expression that will be used to filter data for that group/role.
•
You can base the security filter on existing security filters. If you choose this option, the new security filter inherits the existing filter, and all its properties.
IN
FRAMEWORK
MANAGER
Additional Information In the slide example, we know that the countries, in which our company sells its products, are categorized into two markets; large and small. We have created two 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 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 restrictions as specified by the individual filter expressions. Using the slide example, if a user belongs to both the Major Markets and Small Markets groups, then they would see all of the data for every country, as defined by the two filter expressions. It is also important to note that the behavior of the security filter is such that if a user does not belong to any of the groups specified in the security filter, then they will have unrestricted access to the data, regardless of the restrictions specified by the combined filter expressions. In some 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
6-11
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 the user(s) who are required to: •
republish a package to the ReportNet server
•
ensure that no reports are impacted when a Framework Manager package is republished to the ReportNet server
By default, when you publish a package, the user or group with the administrative role for reporting will be added in the Package Administrator Access dialog box.
Additional Information Republishing is defined as the ability to republish a package to the ReportNet server after it has been initially published. After the first publish, the user who performed the publish, has ownership of the package and is the only user with administrative rights to it, including the ability to republish it. For other users to be able to republish this package, the owner must assign administrative access to the package. 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
6-13
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
6-15
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
6-17
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
6-19
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
6-21
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
6-23
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 republished the Sales Reps package and viewed the results in Query Studio.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
6-25
COGNOS
REPORTNET
–
METADATA
MODELING
Summary In this module, we have:
6-26
examined the ReportNet security environment
created and applied security filters
restricted access to query subjects and query items
restricted access to packages
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
6-27
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 61a. 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 to the Italy group and the United States group, and then grant access to the GO Model package.
Package Access dialog box
•
Add Allessandra Torta (from Local NT namespace) to the Italy group.
•
Add Alex Rodriguez (from the Local NT namespace) to the United States group.
2. Limit access to the database layer and create a security filter for Italy.
Select Users and Groups dialog box
•
Give visibility rights for the Database Layer folder to system administrators only.
•
Add a security filter for the Italy group to the Retailers query subject (in the Retailer Information folder). Use the following formula:
New Cognos Group dialog box
Security Filters dialog box Filter Definition dialog box
[GO Model].[Retailers]. [Country]='Italy'
3. Create a security filter for the United States.
Select Users and Groups dialog box
•
Filter Definition dialog box
Add a security filter for the United States group to the Retailers query subject (in the Retailer Information folder). Use the following formula: [GO Model].[Retailers]. [Country]='United States'
4. View the results in Query Studio.
Query Studio
•
Save the project.
•
Re-publish the GO Model package.
•
Log in (User ID: atorta, Password: password).
•
Add the Company Name and Country query items, and then save as Wkshp 61a.
•
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
6-29
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
7-2
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
7-3
COGNOS
REPORTNET
–
METADATA
MODELING
Framework Manager Workflow Data Sources
Import
Design/Create
Prepare Model
Enhance
Project
for Reporting
Model
Publish
Create and Manage Packages
Manage Project
Set Security
Report Studio Query Studio
•
7-4
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
© 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.
•
You control versions of a project to ensure that each version of a file is recoverable. You can use Framework Manager to: •
connect to a Visual SourceSafe (VSS) or Concurrent Version System (CVS) repository
•
check in and check out a project
•
get the latest version of a project
•
view project history
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information Repository control also ensures that users in a large organization have access to the most recent changes or versions of a project or segment.
7-5
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
•
configure a connection and add projects to the repository from Framework Manager
Additional Information You can add a project to the repository on 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
7-7
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 created so that it can be used as the master project in Demo 7-2 – Link to a Project.
The New Project dialog box appears. 2. In the name box, type GO Sales and Retailers Master, and then 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. 1. From the Repository menu, click Add Project to Repository. The Add to Repository dialog box appears.
Instructional Tips At this point, you could have students navigate to the CVSROOT folder in Windows Explorer at C:\CVS\CVSROOT to 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
. This icon indicates that the project is now Master project icon 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 then click Import Metadata. A message box appears indicating that the project is under repository control and has read-only attributes. It also prompts us to check out the file.
Additional Information We are importing metadata at this point because we will be using this project/model in the next demo. The next demo involves creating another project/model and then 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
7-9
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
7-11
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
•
You can create a segment so that you can: •
•
organize a project according to organizational requirements, for example, human resources, sales, and finance, or according to business rules
•
distribute responsibility for the modeling process amongst multiple groups according to areas of expertise
•
share and reuse project information to avoid duplication of work
When you create a segment, you create a new project in a new folder, complete with its own associated project files.
•
You segment a project either at the folder or namespace level.
•
You can also link the segments to other projects that contain the same information to maintain consistency and reuse information.
Additional Information Organize the project according to organizational requirements or business rules. For example, you have a project named GoSales. You can create two folders, one named Products and the other named Orders. You can divide the GoSales project at the Products folder and at the Orders folder. Distribute responsibility. For example, the project Inventory contains the folder Products. You can segment the Products folder to allow other modelers to work on that segment. If any changes or additions are made to the Product folder segment, they will be reflected in the Inventory project. When you work with a main project and segments in the main project, there are things you may want to consider. If you: • create a master project that contains segments, and the 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
•
A link is a shortcut to an existing project, folder, or namespace.
•
You must create the project, folder, or namespace, before you can link to it. You can create links only to: •
folders
•
namespaces
•
projects or segments
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information For example, the project Inventory contains the folder Products. You can create a link from the GoSales Products to Inventory Products. If any changes or additions are made to the Inventory Products folder, they will be reflected in the GoSales Products folder. 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.
7-13
COGNOS
REPORTNET
–
METADATA
MODELING
Segmenting and Linking Best Practices Follow these best practices when creating segments and links: link to relatively static segments the namespace in the main project and any links in the project to folders must have the same identifier all objects in a project must have unique identifiers update references in both the segment and the main project
•
Additional Information You can use synchronizing and action logging to revert to earlier versions of the main project or a segment. Note to Instructor: consider using a white board or flip chart to explain the examples below.
the main project and any segments in the project must have the same languages
For example, you have a main project and a link in the project to a folder that exists in 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 minimize complexity and ensure stability in a multiuser modeling environment.
For example, you have a main project that contains a query subject named NewQS, and a segment in the project. You open the 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
7-15
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. now appears in the Database View The GORT namespace 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
7-17
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
7-19
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
7-21
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. now appears with icons indicating The GOSL namespace 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
7-23
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
7-25
COGNOS
REPORTNET
–
METADATA
MODELING
Examine Action Logging Capture, view, and playback actions performed on the project.
•
In Framework Manager, you can capture, view, and play back actions performed on the project.
•
Each sequence of actions that you perform in Framework Manager is considered a transaction. Each transaction is recorded in the project or segment action log file.
•
You can choose to play back individual transactions or a combination of transactions in a log file. You can also save individual transactions to a separate log file (script).
7-26
Additional Information The action log file is an XML file that is designated by the project or segment name, date, and time. The log file is stored in the project or segment logs folder. You can simply view a log file or play it back entirely to ensure project integrity. An example of when you might save individual transactions to a script, is if you are making changes to a project in a test 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.
© 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
•
You can use Framework Manager log files to synchronize changes made in the metadata source to a project.
•
You synchronize your project to create a new project by replaying, from the log files, all the actions you made in the original project starting from its initial creation.
•
You can choose to accept the new changes, and create a new project, or return to the original project. If you accept the new changes, the original project is deleted.
Additional Information You cannot synchronize the projects again until additional changes are made and logged. After you save and close a project file, these changes are added to the log file. Because every action that you made in your project is rerun, synchronization may take a long time. 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
7-27
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
When you verify a project, Framework Manager lists invalid objects and their status, including: •
7-28
invalid relationships: •
many-to-many relationships
•
orphaned query subjects (query subjects with no relationships)
•
multiple relationships (or relationship shortcuts) between query subjects (or query subject shortcuts)
Additional Information Framework Manager also provides an option to verify the package objects before you publish a package to ensure that there are no invalid objects that can break queries in the published package. When you verify the project, model query subjects will often appear as orphans because they may not have relationships. In this case they use the relationships of the referenced data source query subjects.
Invalid references occur when an object references another object that no longer exists in the project.
•
invalid references – exist when an object references another object to which it does not have access.
•
invalid object definition – Framework Manager warns you when you change an object so that it cannot be executed. If you proceed, these are marked as invalid.
When you verify a project, Framework Manager identifies any query subjects, shortcuts, filters, calculations, and relationships that were previously marked as invalid so that you can repair them.
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
7-29
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
7-31
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
7-33
COGNOS
7-34
REPORTNET
–
METADATA
MODELING
© 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
8-2
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
8-3
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. …
8-4
•
The self–join must be declared at the data source level for the recursive relationship to be displayed in Framework Manager.
•
While you can view the metadata that defines the relationship, you cannot edit a recursive relationship in Framework Manager.
Additional Information The ReportNet samples databases do not declare any recursive relationships and therefore we will not see a recursive relationship line in the Object Diagram. However, a recursive relationship does exist in the SALES_STAFF table in the GOSL database.
© 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 Subject
Employee ID Manager ID
1..1
Employee ID
Phone Number 1..n
Ext.
Manager ID Phone Number
…
Ext. … Recursive Relationship Can now be edited
•
To modify a relationship that exists as a self–join in the data source, you can create a shortcut of the query subject and define a relationship between the original query subject and the shortcut.
•
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information We will resolve the SALES_STAFF table recursive relationship in the following demo.
8-5
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 Purpose: Management would like to create reports of management staff and the sales staff that report to them. We must resolve a recursive relationship that exists within the Sales Staff query subject to achieve this type of report. Although no recursive relationship is illustrated in the Object Diagram view, we know that Manager Code relates to Sales Staff Code.
Additional Information In order for the recursive relationship to be illustrated in the Object Diagram, the recursive relationship information would need to have been created at the database level. It is not in this case.
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
8-7
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
8-9
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.
•
You define keys for each level for query efficiency.
•
The measures associated with the levels in your dimensional information may or may not be in the query subject. These measures 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.
•
You can specify the key as a Unique Key only if the key values are unique regardless of their context.
•
You may also need to specify composite keys, which are used when two or more query items are required to uniquely identify the level.
•
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
The remaining topics are best illustrated in a data warehouse environment.
Additional Information Associated measures outside of the query subject are related through keys.
Instructional Tips Use PRODUCT_KEY in the slide example as an example of a Unique Key. Additional Information For example, the combination of country and city are required to uniquely identify a city.
8-11
COGNOS
REPORTNET
–
METADATA
MODELING
Resolve Dimensional Level Ambiguity Sales Fact
Inventory Levels Fact
Time Key Unit Cost Unit Price
1..n
1..n
Sale Total
Month Key Closing Balance
Time Dimension
…
Product Key
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 Dimension and Inventory Levels Fact), ReportNet will not know how to roll up the measures from the different fact tables. This will result in repeating values for the CLOSING_BALANCE measure in the Inventory Levels Fact query subject because it rolls up to the MONTH_KEY and not the TIME_KEY.
•
Because the Sales Fact query items are at a more granular level than 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
Additional Information In the slide example, we see a conformed dimension called Time Dimension whose relationships are at different levels in the fact query subjects. The facts from the Sales Fact query subject roll up to the Time Key where as the fact from the Inventory Levels Fact query subject rolls up to the Month Key.
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
8-13
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
8-15
COGNOS
REPORTNET
–
METADATA
MODELING
6. In the Levels pane, select MONTH_KEY, and then select the Unique Key check box. Do the same for TIME_KEY.
Additional Information If asked why the CURRENT_MONTH and CURRENT_YEAR are attributes of MONTH_KEY, the MONTH_KEY in this example is unique and represents a year and month combination. That is why both the CURRENT_YEAR and CURRENT_MONTH query items are associated with it.
7. In the Levels pane, select MONTH_KEY. 8. From the Available items pane, drag and drop the CURRENT_YEAR and CURRENT_MONTH items into the Attributes pane. 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
8-17
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.
•
8-18
It is also recommended to specify dimensional information for all conformed dimensions.
© 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 2
Dimension 1 1..1
1..1 1..n
1..n
Fact Table 1..n 1..1
Dimension 4
1..n 1..1
Dimension 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
8-19
COGNOS
REPORTNET
–
METADATA
MODELING
Examine Conformed Dimensions A conformed dimension has relationships to more than one fact table.
Product Dimension 1..n
Sales Fact
1..1
1..1 1..n
1..n
1..n 1..1
Inventory Levels Fact
1..1
Time Dimension
•
8-20
In the slide example, both the Sales Fact and Inventory Levels Fact query subjects contain time–based and product–based facts. This can create ambiguous relationships and incorrect results when querying across multiple query subjects.
Additional Information For example, which relationships would be used when querying both Product Dimension and Time Dimension?
© 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 Inventory Levels Fact Namespace
Sales Fact Namespace
Product Dimension 1..1
Sales Fact
Product Dimension 1..1
1..n
1..n 1..n
1..n 1..1
Time Dimension
Inventory Levels Fact
1..1
Time Dimension
•
You can use star schema groupings in Framework Manager to ensure the desired relationships are used in multi–query subject queries.
•
When you create star schema groupings in Framework Manager, you can create views in a new namespace where there is only one fact query subject and its related dimensions.
•
You may move the actual objects to this namespace or use shortcuts. Shortcuts are the recommended choice and best practice.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information In the slide example, if you queried across Product Dimension and Time Dimension in the Sales Fact Namespace, you would ensure that the Sales Fact query subject is used to link the two dimensions.
8-21
COGNOS
REPORTNET
–
METADATA
MODELING
Examine Multi–Fact Queries
Product Dimension 1..n
Sales Fact
1..1
1..1 1..n
1..n
1..n 1..1
Inventory Levels Fact
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
Database Query 1
Report Output
ReportNet D1
Stitch Queries Together
Query 2
D2
A
Y1
B
Y2
C
Y3
F1
F2
300
$18 $22
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.
•
If you view the SQL generated for such a query, you will see a function called coalesce, which is used to merge the queries together, 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 actually executed locally by the ReportNet server in a very efficient method and not at the data source level.
•
If one fact table has a value for a returned dimension row and the other does not, you will simply see a blank field in the report.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information We will look at stitch query SQL in the following demo. As seen in the slide example, D1 and D2 represent data from a conformed dimension. F1 represents data from one fact table and F2 represents data from the other fact table. As you can see, F1 had no value for row B and is therefore left blank, but the value in F2 for row B is not lost.
8-23
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 model is open. 2. Expand the Database Layer folder. 3. Right–click INVENTORY_LEVELS_FACT, and then click Create Star Schema Grouping. The Create Star Schema Grouping dialog box appears. 4. Accept the default selections, and click OK. A new namespace appears in the Database Layer folder called INVENTORY_LEVELS_FACT Namespace. 5. Drag and drop INVENTORY_LEVELS_FACT Namespace into the Presentation Layer folder. 6. Right–click SALES_FACT, and then click Create Star Schema Grouping. 7. Deselect SITE_DIMENSION and STAFF_DIMENSION, and then click OK. A new namespace called SALES_FACT Namespace appears. 8. Drag and drop SALES_FACT Namespace into the Presentation Layer folder. 9. Publish the GOSLDW Model package.
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
Additional Information We will not be specifying the complete dimensional information, but rather just enough to test the MONTH_KEY and TIME_KEY levels.
Additional Information Leaving the defaults is good for creating a presentation layer view. The Create shortcuts only for objects that are used outside the star schema option will create shortcuts only for conformed dimensions. Since they are still used by another fact table the original objects are left in their original place. The Move the objects in a new namespace option lets you to keep the same names for the objects, organize them neatly and use them in the presentation layer if desired. Instructional Tips This would be a good time to show the star schema groupings in the Object Diagram in the Presentation Layer folder. This will give students a visual of what they have just created.
8-25
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 then click Query 1.
, and
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
8-27
COGNOS
REPORTNET
–
METADATA
MODELING
Summary In this module, we have:
8-28
resolved a recursive relationship
specified dimensional information
created star schema groupings
© 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
A-2
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-3
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 doubleclick 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-5
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-7
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-9
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. , and then expand the 1. Click New Report 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-11
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-13
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. , click the Model tab, 5. Double–click the multiplication operator 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-15
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 query subjects: ORDER_METHOD query subject: •
ORDER_METHOD_EN
PRODUCTS query subject: •
PRODUCT_NAME
•
INTRODUCTION_DATE
Instructional Tips Indicate to students this would be a good case for setting multiple properties by setting the property for the first item and then clicking and dragging the arrow beside it down to apply the same setting to the other selected items.
RETURNED_ITEM query subject: •
RETURN_DATE
RETURN_REASON query subject: •
REASON_DESCRIPTION_EN
PRODUCT_FORECAST query subject: •
YEAR
•
MONTH
SALES_STAFF query subject:
A-16
•
FIRST_NAME
•
LAST_NAME
•
POSITION_EN
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-17
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-19
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-21
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-23
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-25
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 Subject
Query Items
Sales Rep Information
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 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
Folder
Model Query Subject
Query Items
Retailer Information
Retailers (Query Subjects are located in the goretailers namespace)
Type Name from Retailer Type
TO
THE
WORKSHOPS
Territory Name from Sales Territory 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-27
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-29
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-31
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-33
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-35
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
A-37
COGNOS
A-38
REPORTNET
–
METADATA
MODELING
© 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
B-2
REPORTNET
–
METADATA
MODELING
© 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
B-3
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
B-5
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
B-7
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
B-9
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
B-11
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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
B-13
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 Action logs, 7-26 Ambiguous relationships conformed dimensions, 8-20 examine, 3-8 resolve, 3-9 C Calculations, 3-53 D Data sources import from multiple, 2-11 types, 2-10 Dimensional information best practices, 8-18 conformed dimensions, 8-20 resolve level ambiguity, 8-12 specify, 8-11 F Filters examine, 4-14 security. See Security use Prompt values, 4-19 Folders definition, 1-5 Framework Manager definition, 1-4 environment, 1-5, 1-17, 1-18 naming conventions, 1-19 workflow, 1-10 Function sets definition, 2-15 Functions package function list, 5-12 user defined, 3-48 G Governors edit, 5-6 L Languages select, 2-9 specify package languages, 5-11 Links create, 7-13
© 2003, Cognos Incorporated Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
M Macros, 3-61 Metadata export, 2-17 import, 2-12 prepare, 1-12 Models definition, 1-5 prepare business view, 1-13 types, 1-7 version control, 5-15 N Namespaces Cognos. See Security definition, 1-5 O Objects examine & organize, 2-16 visibility. See Security P Packages access. See Security administrative access. See Security create & manage, 1-14 create & modify, 5-10 definition, 1-5 examine, 5-5 impact of publishing, 5-13 nest, 5-16 publish, 5-14 specify functions, 5-12 specify languages, 5-11 Parameter maps, 3-59 Physical layer definition, 2-6 Presentation layer create, 4-5 definition, 2-7 Projects best practices, 2-5 check, 7-28 create, 2-8 definition, 1-5 design & create, 1-11 files, 1-6 manage, 1-16 synchronize, 7-27 Prompt values. See Filters 1
COGNOS
REPORTNET
–
METADATA
Q Query items definition, 1-5 examine, 3-22 modify properties, 3-23 set Regular Aggregate property, 3-25 Query processing types, 3-5 Query subjects create model, 4-6 create new, 3-37 create stored procedure, 3-43 definition, 1-5 edit SQL, 3-20 examine, 3-18 modify & test, 3-19 set SQL type & generated SQL, 3-21 types, 1-8
MODELING
R Recursive relationships examine, 8-4 resolve, 8-5 Relationships ambiguous. See Ambiguous relationships create & modify, 3-7 criteria, 2-13, 2-14 definition, 1-5 examine, 3-6 recursive. See Recursive relationships ReportNet security, 6-5 workflow, 1-9 Repository control set up, 7-6 use, 7-5 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 Cognos Confidential. For internal use only. This guide contains proprietary information which is protected by copyright.
3
W W W. C O G N O S . C O M
Related Documents