Integrating IBM Cognos with...

29
Tip or Technique Using IBM Cognos to Report on Perforce SCM Systems Product(s): IBM Cognos 8 Area of Interest: Reporting

Transcript of Integrating IBM Cognos with...

Page 1: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Tip or Technique

Using IBM Cognos to Report on Perforce SCM Systems

Product(s): IBM Cognos 8

Area of Interest: Reporting

Page 2: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 2

Copyright and Trademarks

Licensed Materials - Property of IBM. © Copyright IBM Corp. 2009 IBM, the IBM logo, and Cognos are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at http://www.ibm.com/legal/copytrade.shtml

While every attempt has been made to ensure that the information in this document is accurate and complete, some typographical errors or technical inaccuracies may exist. IBM does not accept responsibility for any kind of loss resulting from the use of information contained in this document. The information contained in this document is subject to change without notice. This document is maintained by the Best Practices, Product and Technology team. You can send comments, suggestions, and additions to [email protected].

Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both.

Page 3: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 3

Contents

1 INTRODUCTION ............................................................................................ 4

1.1 PURPOSE ................................................................................................................ 4 1.2 ABOUT THE AUTHOR(S).............................................................................................. 4 1.3 APPLICABILITY ......................................................................................................... 5 1.4 ASSUMPTIONS AND EXCEPTIONS ................................................................................... 5 1.5 OVERVIEW .............................................................................................................. 5

2 ADDING BUSINESS VALUE WITH IBM COGNOS 8 ........................................ 6

2.1 USING P4REPORT AS A DATA SOURCE ........................................................................... 6 2.2 IMPORTING METADATA USING PERFORCE ODBC DATA SOURCE IN FRAMEWORK MANAGER .......... 7 2.3 UNDERSTANDING P4REPORT SCHEMA TABLES................................................................ 11 2.4 MODELING AND REPORT AUTHORING – CHANGELIST COUNT PER USER REPORT...................... 13 2.4.1 Create and Organize objects................................................................................ 13 2.4.2 Defining Relationships ......................................................................................... 15 2.4.3 Create and Publish Package................................................................................. 16 2.4.4 Report Authoring ................................................................................................ 17 2.5 MODELLING AND REPORT AUTHORING – FILES CHANGE COUNT PER USER REPORT AND PROGRESS CHART REPORT PER USER ON DAILY BASIS ............................................................................... 22 2.5.1 Create and Organize Objects ............................................................................... 22 2.5.2 Defining Relationships ......................................................................................... 22 2.5.3 Re-publish the Package ....................................................................................... 23 2.5.4 Report Authoring - Files Change Count per User Report ........................................ 24 2.5.5 Report Authoring - Progress Chart Report per User on a Daily Basis ....................... 26

Page 4: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 4

1 Introduction

1.1 Purpose

This article shows you how to integrate the widely used Configuration Management System, Perforce, with IBM Cognos. It will help you learn and understand the schema exposed by P4Report, modelling techniques over P4Report a database. It will also cover how to create IBM Cognos reports over Perforce (P4) SCM System answering specific business questions.

1.2 About the Author(s)

Deepak Vijh has been a professional software engineer for over five years and is currently working in IBM India Software Labs. He holds a Masters in Computer Applications and is working on IBM Cognos BI solutions. His areas of experience and interest are Java/J2EE, XML, and Web Technologies. He has also worked on EAI, OSS, Telecom, BI solutions.

Kuldeep Jain is a Software Developer in IBM India Software Labs. He holds a Bachelors in Computer Science and has five years of experience in designing and developing applications using Java, J2EE, XML and Web Technologies within the Telecom and BI domains.

Page 5: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 5

Varun Mishra is an Automation Test Engineer working in the IBM India Software Labs. He is responsible for developing automation test frameworks for various products within the IBM Cognos Suite. He has more then 5 years of experience in using automation tools like IBM Rational Functional Tester and HP Quick Test Professional.

1.3 Applicability

The steps outlined in this document were validated using:

• IBM Cognos BI Server

• IBM Cognos Framework Manager

• Perforce SCM Client Software configured with P4 Server

• Perforce (P4Report) Reporting System

1.4 Assumptions and Exceptions

This document assumes that the software referenced in the applicability section is installed and operational.

1.5 Overview

When working in a large team scaled over distributed sites, it becomes mandatory to use a Software Configuration Management (SCM) System. Perforce Software is one of the proven SCM solutions for the valuable code and several digital assets. It helps teams to collaborate, and do parallel development on various project activities such as code development, testing, artefacts management, and release management.

IBM Cognos 8 can be integrated on top of this system to provide the following value:

• Fancy and graphical reports can be generated using IBM Cognos which otherwise may not supported by Perforce SCM as such.

• The development efforts can be easily tracked with reporting.

• The comparative analysis can easily be done using IBM Cognos reports over Perforce SCM.

• Variety of reports can be designed to do the trend analysis in kind of bugs reported, sensitive portion of the code, deliverables and quality.

• It becomes handy to do the status reporting in large teams with the help of reports generated per team member on the work accomplishment.

Page 6: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 6

• Apart from project management, there could be several business benefits of using IBM Cognos reports. One example would be to perform license audits.

2 Adding Business Value with IBM Cognos 8

Upon completion of this section, you will learn the details of some of the tables from P4Report schema, model them, and generate following reports which answers some of the specific business questions:

• A bar graph report which shows the work done, in the form of total number of change lists submitted, by team members in a given time frame.

• A bar graph report for the total number of files checked in by a user in given time frame.

• A progress chart report for the number of files checked in by a user on a daily basis in a given time frame.

2.1 Using P4Report as a Data Source

In order to be able to use the P4Report as a data source, you must configure the ODBC connection. To do this:

1. Traverse to Start>All Programs>Perforce>P4Report>Data Source to open the ODBC Data Source Administrator window.

2. Select the System DSN tab and click add.. to display the Create New Data Source window.

3. Select the driver as Perforce ODBC Driver, and then click Finish.

4. The ODBC P4Report Setup window will be displayed.

5. Enter the required information as follows:

• Data Source Name: Assign a name to the Data Source Connection which will be later used.

• Description: Enter the description for reference. This is optional.

• Port: The host computer name (IP address is preferred) and port number on which the P4 Server listens for client requests. It should match to your Perforce P4PORT setting.

• User: The name of the valid user which will be used to connect to Perforce Server. It should match to your Perforce P4USER setting.

• Password: The Password of the user which will be used to connect to Perforce Server. It should be the one for the user specified above.

• Workspace: This can be set to use as default.

• Host: The name of the Perforce Client Computer. It should match to your Perforce P4HOST setting.

• Charset: This value should be set only when your Perforce Server is running in Unicode mode. Default is P4CHARSET

Page 7: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 7

For any of above values, if you want to configure the data source to use the Perforce settings as in effect on the client computer, check the Default boxes for the desired setting.

2.2 Importing Metadata using Perforce ODBC Data Source in Framework Manager

1. Launch IBM Cognos Framework Manager by selecting Start -> Programs -> IBM Cognos 8 -> Framework Manager.

2. Create a new project in IBM Cognos Framework Manager by entering the project name and location as shown in the image below.

3. Select the language of the project and click OK.

Page 8: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 8

4. From the Metadata Wizard, select Data Sources, and click on Next

5. To create new data source, click New. A New Data Source wizard will open as shown in the below Figure.

6. Enter the Name and Description for the new data source.

Page 9: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 9

7. Click Next and specify the type of Data Source Connection as ODBC from the drop down list

8. Click Next and enter the ODBC data source name as created in the previous section.

9. Also specify the User Id and Password in the Signon section.

Page 10: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 10

10. Click Finish. Now your Data Source has been created successfully.

11. In the Metadata Wizard, select the objects you want to import. Then click Import and Finish.

Now the Perforce objects have been imported successfully. You can see the tables under the model as shown in Figure below. You can rename Model and the namespace name as “P4 Model” and “Foundation Objects View” respectively.

Page 11: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 11

2.3 Understanding P4Report Schema Tables

P4Report renders a set of tables from the Perforce database. The tables which you are going to use to use within the IBM Cognos report to add business value are listed below.

CHANGES: This table contains a row for each changelist. P4Report gives read-only access to this table.

Column Name

Data Type Description

CHANGE Integer The changelist number

DATE Timestamp Changelist creation date

USER Varchar P4 user who created the changelist

CLIENT Varchar P4 client that created the changelist

STATUS Varchar Whether the changlist is pending or submitted

DESCRIPTION Longvarchar User specified changelist

Page 12: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 12

description

P4OPTIONS Varchar It is used to specify the query options. Valid values are: integrated, longdesc

FILESPEC Varchar The files in the changelist

FILES: This table contains a row for each revision of each file in the depot. P4Report gives read-only access to this table.

Column Name

Data Type Description

FILE Varchar Full file path

REVISION Smallint File revision number

TYPE Varchar File type

ACTION Varchar Last P4 action performed on the file

TIME Timestamp Time of last action performed

CHANGE Integer Changelist associated with this particular revision

REVSPEC Varchar This column is added by P4Report engine and is not physically present in Perforce metadata. It can be used in queries to specify change numbers, labels, and dates

USERS: This table contains a row for each P4 user.

Column Name

Data Type Description

USER Varchar Name of P4 user

EMAIL Varchar Email of user

Page 13: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 13

FULLNAME Varchar Full name specified by user

UPDATED Timestamp Last time user information was updated

ACCESSED Timestamp Last time this user performed a P4 action

2.4 Modeling and Report Authoring – Changelist Count per User Report

The first objective is to create a bar graph report to display the amount of work done, in the form of total number of changelists submitted, by team members in given time frame. You will use following metadata, to satisfy this reporting requirement.

2.4.1 Create and Organize objects

To start with the modelling process, you should create another namespace in which you will import only the required metadata in the phased approach as per the reporting requirements to minimize clutter in the model.

1. Create another namespace under the P4 Model with the name Business View as shown below.

2. Right Click on Business View to create new Query Subject.

Changes Fact

Date Users

Page 14: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 14

3. In the New Query Subject enter the name as Changes Fact and select ‘Model’ to build the query subject.

4. In the Query Subject Definition - Changes Fact dialog box, select the Changes table from the ‘Foundation Objects View’ and drag-drop it to the Query Items and Calculations pane as shown below. Then click OK.

5. Verify and that the Changes Fact query subject is present in Business View.

6. Do a test to ensure that the data is getting populated.

Page 15: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 15

7. Similarly create a query subject for the Users table. The Business View should represent the following screen capture.

8. The date query item in the Changes Fact query subject can itself be used as a Date dimension.

2.4.2 Defining Relationships

1. Open the Business View in Diagram Explorer, select user query item from both the Changes Fact and Users query subjects, right click and select Create -> Relationship.

2. In the Relationship Definition dialog box ensure that cardinality is

defined as shown in the below diagram. Click OK and Save the project.

Page 16: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 16

2.4.3 Create and Publish Package

1. Before creating a package, ensure that Query Processing of the

data source connection is set to Limited Local as illustrated below.

2. Create the package in IBM Cognos Framework Manager by right clicking Packages > Create > Package.

3. Specify a name for the newly created package. The name P4Package will be used in this document.

4. Click Next and select the P4Model in the package as shown in the following image.

Page 17: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 17

3. Click Next and Finish. 4. Upon being prompted to publish the package, click Yes.

5. In the Publish Wizard, select the Folder Location in content store, and click Next.

6. In the Add Security box click Next and then click Publish. Ignore errors, warnings if any and click Finish.

2.4.4 Report Authoring

1. Launch Report Studio and select the published P4Package as the

package to be used.

2. Create a New Chart report with any Column chart as below and click OK.

Page 18: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 18

3. Open the Page Explorer, and create a prompt page to enable From

Date and To Date selection by the user and name it as Date Selection Prompt.

4. Inside Date Selection Prompt, drag and drop the Date Prompt object from the Insertable Objects toolbox.

5. In the Prompt Wizard dialog box, select create a new parameter and name it as From_Date as below, and then click Next and Finish.

6. Similarly, add another Date Prompt and create a new parameter as

To_Date. Your Date Selection Prompt page should now represent the following image.

Page 19: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 19

7. Open Query Explorer and select Query1.

8. In the Data Items pane, drag and drop Users.fullname, Changes Fact.date from Business View Namespace as below.

9. Insert a new Data Item from the Insertable Objects toolbox to the

Data Items pane.

10. A Data Item Expression dialog box will appear. Within the Expression Definition create the changes count expression as per the image below.

Page 20: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 20

11. Rename the new added Data Item to Change Count in the Properties pane.

12. To use the From_Date and To_Date parameters in the query criteria, drag and drop the Date field from Data Items pane to Detail Filters pane.

13. In the Detail Filter Expression dialog box, define the Expression Definition and validate as below.

Your Query Explorer pane should represent the following image.

Page 21: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 21

12. Open Report Page 1 in Page Explorer.

13. Open the Data Items pane in Insertable Objects.

14. Drag and drop Query1.fullname to Categories(x-axis) and Query1.Change Count to Default Measure (y-axis). Your page should now represent the following screen capture.

15. Run the Report, select a valid From and To date in the Date Selection

Prompt and click Finish.

Page 22: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 22

2.5 Modelling and Report Authoring – Files Change Count per User Report and Progress Chart Report per User on Daily Basis

The second and third objective is to create a bar graph report to display number of files added/updated/removed by team members in given time frame and to show the number of files changed by the team members on the daily basis in the given time frame. You will use following metadata, to satisfy this reporting requirement.

2.5.1 Create and Organize Objects

In the same Business View namespace create another model query subject as Files, based on the Files table in the Foundation Object View created earlier.

2.5.2 Defining Relationships

Changes Fact

Date Users

Files

Page 23: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 23

1. Open the Business View in Diagram Explorer and select the change query item from the Files and Changes Fact query subjects.

2. Right click and select Create -> Relationship.

3. In the Relationship Definition dialog box ensure that cardinality is defined as shown in the below diagram. Click OK and Save the project.

The Business View in Diagram Explorer should appear as follows.

2.5.3 Re-publish the Package

Page 24: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 24

1. To re-publish the package in IBM Cognos Framework Manager, right click the package P4Package > Publish Packages…

2. Click Next. Ignore warning if any.

3. You will be prompted about an existing package with the same name. Click Yes to publish an additional model version.

2.5.4 Report Authoring - Files Change Count per User Report

1. Within IBM Cognos Report Studio, open Query Explorer and select Query1.

2. In the Data Items pane, drag and drop Users.fullname, Changes Fact.date from Business View Namespace as below.

3. To use the From_Date and To_Date parameters in the query criteria, drag and drop the “date” field from Data Items pane to Detail Filters pane.

4. In the Detail Filter Expression dialog box, define the Expression Definition and validate as below.

Page 25: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 25

5. Insert a new Data Item from the Insertable Objects toolbox to the

Data Items pane.

6. A Data Item Expression dialog box will appear. In the Expression Definition create a Files count expression and validate as per the following illustration.

7. Rename the new added Data Item as Files Count in the Properties

pane.

Your Query Explorer pane should represent the following.

8. Open Report Page 1 within Page Explorer.

9. Open the Data Items pane in Insertable Objects. Drag and drop Query1.fullname to Categories(x-axis) and Query1.Files Count to Default Measure (y-axis).

Your page should now look like this.

Page 26: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 26

10. Run the Report, select proper From and To date in the Date Selection Prompt and click Finish to display the following output.

2.5.5 Report Authoring - Progress Chart Report per User on a Daily Basis

1. Create a new Line Chart Report.

Page 27: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 27

2. In the Data Items pane, drag and drop Users.fullname, Changes Fact.date from Business View Namespace.

To show the file change count on daily basis and not on time basis, you will have to create a new Data Item based on the Date field.

3. In the Data Items pane drag and drop a new Data Item from Insertable Objects.

4. Update the Data Item Expression for this newly added Data Item as per the following definition.

5. Name the new Data Item as “File Checked In Date”. All the Data

Items should look like below:

Page 28: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 28

6. Open Report Page 1 in Page Explorer.

7. Open the Data Items pane in Insertable Objects. Drag and drop Query1.Files Checked In Date to Categories(x-axis) and Query1.Files Count to Default Measure (y-axis) and Query1.fullname to Series.

Your page should look as follows.

8. Run the Report and select a proper From and To date in the Date

Selection Prompt and click Finish.

Page 29: Integrating IBM Cognos with Perforcepublic.dhe.ibm.com/software/dw/dm/cognos/infrastructure/cognos... · Deepak Vijh has been a professional software engineer for over five years

Using IBM Cognos to Report on Perforce SCM Systems 29