multidimentional authoring

476
IBM Cognos Report Studio: Author Reports with Multidimensional Data (v10.2) Student Guide Course Code: B5261

Upload: ruchrucha

Post on 08-Apr-2016

139 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Multidimentional Authoring

IBM Cognos Report Studio: Author Reports with Multidimensional Data (v10.2) Student GuideCourse Code: B5261

Page 2: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10 .2 )

P-2 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

IBM Cognos Report Studio: Author Reports with Multidimensional Data (v10.2)

B5261

ERC: 1.0

Published September 2012

Licensed Materials – Property of IBM

© Copyright IBM Corp. 2007, 2012

US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM corp.

IBM, the IBM logo, ibm.com and Cognos are trademarks of international Business Machines Corp., registered in many jurisdictions worldwide.

Other product and service names might be trademarks of IBM or other companies.

Adobe and the Adobe logo, are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries.

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

Page 3: Multidimentional Authoring

I N S T R U C T O R P R E F A C E

© 2007, 2012, IBM Corporation P-3 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Contents

PREFACE........................................................................................................ P-1

CONTENTS........................................................................................................P-3 COURSE OVERVIEW .......................................................................................P-10 DOCUMENT CONVENTIONS............................................................................P-12 WORKSHOPS ..................................................................................................P-13 YOUR FEEDBACK ...........................................................................................P-14 IBM PRODUCT HELP......................................................................................P-15

INTRODUCTION.................................................................................INTRO-1

COURSE OBJECTIVES ...............................................................................INTRO-3 COURSE ROADMAP ..................................................................................INTRO-4 COURSE DESCRIPTION .............................................................................INTRO-5 ADDITIONAL TRAINING RESOURCES .......................................................INTRO-6

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS .......1-1

OBJECTIVES .....................................................................................................1-3 DATA SOURCES AND MODEL TYPES................................................................1-4 THE OLAP STRUCTURE...................................................................................1-5 THE DIMENSIONAL STRUCTURE IN IBM COGNOS BI ......................................1-6 DIFFERENTIATE DATA ENTITIES......................................................................1-7 WHAT IS A DIMENSIONAL QUERY?..................................................................1-8 THE DIMENSIONAL APPROACH TO QUERIES....................................................1-9 THE QUERY MODEL IN REPORT STUDIO........................................................1-10 THE IBM COGNOS BI QUERY LANGUAGE.....................................................1-11 DATA ITEMS AND DATA ITEM PROPERTIES ...................................................1-12 IDENTIFY DIMENSIONAL EXPRESSIONS .........................................................1-13 DIFFERENTIATE FROM SQL AND MDX .........................................................1-14 DEMO 1: EXPLORE THE DIMENSIONAL DATA TREE ......................................1-15 THE IBM COGNOS BI REPORTING STUDIOS ..................................................1-27 REPORT AUTHORING STYLES ........................................................................1-28 APPLY REPORT AUTHORING STYLES.............................................................1-29 OTHER STUDIO REPORTS IN REPORT STUDIO ................................................1-30 SUMMARY......................................................................................................1-31

Page 4: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10 .2 )

P-4 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS .................2-1

OBJECTIVES .....................................................................................................2-3 WHAT MAKES UP A MEMBER?........................................................................2-4 WHAT IS A MEMBER UNIQUE NAME?..............................................................2-5 WHAT MAKES UP A MUN? .............................................................................2-6 CHANGES THAT IMPACT A MUN .....................................................................2-7 DEMO 1: USE MEMBERS TO CREATE REPORTS................................................2-8 DEMO 2: EXPLORE MUNS .............................................................................2-15 INSERT MEMBERS AND CHILDREN.................................................................2-19 SETS IN REPORT STUDIO ................................................................................2-20 CREATE SETS FOR MEMBERS.........................................................................2-21 TUPLES IN REPORT STUDIO............................................................................2-22 AUTOMATICALLY CREATE SETS AND TUPLES...............................................2-23 CREATE AN INDIVIDUAL TUPLE EASILY ........................................................2-24 MANUALLY CREATE SETS AND TUPLES ........................................................2-25 QUERY CALCULATIONS .................................................................................2-26 THE SET() FUNCTION .....................................................................................2-27 DEMO 3: USE THE SET() FUNCTION TO FOCUS YOUR REPORT.......................2-28 USE SET DEFINITIONS....................................................................................2-34 THE TUPLE() FUNCTION .................................................................................2-35 DEMO 4: IDENTIFY SETS AND TUPLES IN REPORTS .......................................2-36 SUMMARY......................................................................................................2-43

DIMENSIONAL REPORT CONTEXT ........................................................3-1

OBJECTIVES .....................................................................................................3-3 WHAT IS REPORT CONTEXT? ...........................................................................3-4 ROOT MEMBER ................................................................................................3-5 DEFAULT MEMBER ..........................................................................................3-6 CURRENT MEMBER..........................................................................................3-9 DEFAULT MEASURE.......................................................................................3-10 CURRENT MEASURE ......................................................................................3-11 DEMO 1: USE THE DEFAULT MEASURE TO CREATE A SUMMARIZED COLUMN IN A REPORT ...................................................................................3-13 SUMMARY......................................................................................................3-20

Page 5: Multidimentional Authoring

I N S T R U C T O R P R E F A C E

© 2007, 2012, IBM Corporation P-5 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

FOCUS YOUR DIMENSIONAL DATA.......................................................4-1

OBJECTIVES .....................................................................................................4-3 HOW DO RELATIONAL DATA SOURCES BEHAVE? ..........................................4-4 HOW DO DIMENSIONAL DATA SOURCES BEHAVE? .........................................4-5 DMR - RELATIONAL OR DIMENSIONAL? .........................................................4-6 CREATE EFFICIENT DIMENSIONAL QUERIES....................................................4-7 FILTERING TECHNIQUES ..................................................................................4-8 USE DIMENSIONAL OBJECTS AND EXPRESSIONS.............................................4-9 THE EXCEPT() FUNCTION...............................................................................4-10 DEMO 1: FOCUS YOUR REPORT BY EXCLUDING MEMBERS OF A DEFINED SET..................................................................................................4-11 TOPCOUNT() AND BOTTOMCOUNT() ..............................................................4-16 TOPPERCENT() AND BOTTOMPERCENT()........................................................4-17 DEMO 2: CREATE A CROSSTAB REPORT SHOWING THE TOP TWO RETAILERS ............................................................................................4-18 FILTER BASED ON MEASURE VALUES ...........................................................4-22 THE FILTER() FUNCTION ................................................................................4-23 DETAIL FILTERS.............................................................................................4-24 DEMO 3: COMPARE THE USE OF THE FILTER() FUNCTION TO A DETAIL FILTER...............................................................................................4-25 SLICERS..........................................................................................................4-38 SLICER EXAMPLE...........................................................................................4-39 DEMO 4: FILTER DIMENSIONAL DATA USING SLICERS .................................4-40 PROMPT FOR DIMENSIONAL DATA ................................................................4-45 TREE PROMPTS ..............................................................................................4-46 DEMO 5: FOCUS YOUR DATA USING A TREE PROMPT...................................4-47 SUMMARY......................................................................................................4-53 WORKSHOP 1: CREATE A SET USING A PROMPT AND THE EXCEPT() FUNCTION ......................................................................................................4-54

Page 6: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10 .2 )

P-6 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

CALCULATIONS AND DIMENSIONAL FUNCTIONS ...........................5-1

OBJECTIVES .....................................................................................................5-3 IBM COGNOS BI DIMENSIONAL FUNCTIONS...................................................5-4 EXPLORE AVAILABLE COMPONENTS...............................................................5-5 REUSE, PROMPTING, AND COMBINING IN DIMENSIONAL EXPRESSIONS..........5-6 THE TOTAL AND AGGREGATE FUNCTIONS .......................................................5-7 AGGREGATE VALUES IN CROSSTABS ..............................................................5-8 SHOW EXCLUDED MEMBER TOTALS ...............................................................5-9 DEMO 1: SHOW TOTALS FOR THE TOP TWO PRODUCT LINES, EXCLUDED

MEMBERS, AND OVERALL TOTALS................................................................5-10 PERFORM ARITHMETIC OPERATIONS.............................................................5-18 DEMO 2: CREATE A PERCENT OF BASE CALCULATION .................................5-19 SORT DIMENSIONAL DATA ............................................................................5-25 RANK DIMENSIONAL DATA ...........................................................................5-26 DEMO 3: NEST DIMENSIONAL FUNCTIONS TO CREATE A DYNAMIC

BOTTOMPERCENT REPORT.............................................................................5-27 SUPPORT FOR MULTIPLE HIERARCHIES PER DIMENSION ..............................5-38 DEMO 4: CREATE A VARIANCE CALCULATION WITH MEMBERS FROM

DIFFERENT HIERARCHIES OF THE SAME DIMENSION ....................................5-39 COMMON ERRORS IN EXPRESSIONS...............................................................5-43 WHAT IS COERCION? .....................................................................................5-44 SUMMARY......................................................................................................5-45

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES....6-1

OBJECTIVES .....................................................................................................6-3 USE FAMILY FUNCTIONS TO NAVIGATE DATA................................................6-4 RETURN CHILD MEMBERS ...............................................................................6-5 RETURN PARENT MEMBER ..............................................................................6-6 RETURN DESCENDANTS ...................................................................................6-7 DEMO 1: CREATE A CROSSTAB REPORT AND SHOW DESCENDANTS OF THE

PRODUCTS HIERARCHY ...................................................................................6-8 RETURN ANCESTOR MEMBERS ......................................................................6-14 RETURN COUSIN MEMBERS...........................................................................6-15

Page 7: Multidimentional Authoring

I N S T R U C T O R P R E F A C E

© 2007, 2012, IBM Corporation P-7 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

SUMMARY......................................................................................................6-16 WORKSHOP 1: DETERMINE THE PRODUCT LINE FOR A PRODUCT, USING THE ANCESTOR() FUNCTION ...............................................................6-17 WORKSHOP 2: CREATE A DYNAMIC CROSSTAB REPORT WITH COMBINED

DIMENSIONAL FUNCTIONS.............................................................................6-23

RELATIVE FUNCTIONS ..............................................................................7-1

OBJECTIVES .....................................................................................................7-3 USE FUNCTIONS TO NAVIGATE DATA .............................................................7-4 DIMENSIONAL STRUCTURES (REVIEW) ...........................................................7-5 USE RELATIVE FUNCTIONS TO NAVIGATE DATA ............................................7-6 DEMO 1: USE FAMILY AND RELATIVE DIMENSIONAL FUNCTIONS TO FOCUS REPORTS...............................................................................................7-7 USE RELATIVE TIME FUNCTIONS TO NAVIGATE DATA (OVERVIEW)............7-14 THE CLOSINGPERIOD FUNCTION....................................................................7-15 THE PERIODSTODATE FUNCTION ..................................................................7-16 DEMO 2: USE RELATIVE TIME DIMENSIONAL FUNCTIONS TO FOCUS REPORTS ........................................................................................................7-17 THE PARALLELPERIOD FUNCTION .................................................................7-26 DEMO 3: CREATE A PERIODS-TO-DATE REPORT AND COMPARE TO THE

PREVIOUS YEAR.............................................................................................7-27 THE LASTPERIODS FUNCTION........................................................................7-37 DEMO 4: CREATE A REPORT THAT SPANS THE PAST SIX MONTHS BASED ON A SELECTED MONTH ....................................................................7-38 SUMMARY......................................................................................................7-42 WORKSHOP 1: CREATE A DASHBOARD REPORT TO COMPARE VARIOUS TIME PERIODS ................................................................................7-43

Page 8: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10 .2 )

P-8 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS ............8-1

OBJECTIVES .....................................................................................................8-3 WHAT IS DRILLING?.........................................................................................8-4 DEFAULT DRILL UP AND DOWN BEHAVIOR ....................................................8-5 MEMBERS WITHIN SAME HIERARCHY .............................................................8-7 DEMO 1: EXAMINE DEFAULT DRILLING BEHAVIOR ........................................8-8 CASES FOR OVERRIDING DEFAULT................................................................8-15 DEMO 2: CONFIGURE ADVANCED DRILL BEHAVIOR.....................................8-16 DEFINE MEMBER SET STRUCTURES ................................................................8-23 WHEN EXPLICIT MEMBER SETS ARE NEEDED ...............................................8-24 INDEPENDENT DRILL UP AND DOWN.............................................................8-25 DEMO 3: ENABLING INDEPENDENT DRILLING ON MEMBERS OF THE SAME HIERARCHY .........................................................................................8-26 BIND REPORT EXPRESSIONS ..........................................................................8-33 BIND REPORT EXPRESSIONS (CONT'D)...........................................................8-34 DEMO 4: PRESERVE ORDER WHEN DRILLING UP OR DOWN .........................8-35 SYNCHRONIZED DRILL UP AND DOWN WITH MULTIPLE QUERIES ................8-43 DEMO 5: SYNCHRONIZED DRILL UP AND DOWN BEHAVIOR.........................8-44 APPLY ONE FUNCTION TO MEMBER SETS .....................................................8-49 DEMO 6: APPLY A SINGLE FUNCTION TO MULTIPLE MEMBER SETS .............8-50 SUMMARY......................................................................................................8-58 WORKSHOP 1: CREATE A REPORT WITH DRILLABLE COMPLEX FUNCTIONS....................................................................................8-59

Page 9: Multidimentional Authoring

I N S T R U C T O R P R E F A C E

© 2007, 2012, IBM Corporation P-9 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

SET UP DRILL-THROUGH REPORTS ......................................................9-1

OBJECTIVES .....................................................................................................9-3 WHAT IS DRILL-THROUGH ACCESS? ...............................................................9-4 DRILL-THROUGH ACCESS FROM A REPORT .....................................................9-5 DRILL-THROUGH ACCESS FOR A PACKAGE .....................................................9-6 STEPS TO SET UP A PACKAGE-BASED DRILL-THROUGH DEFINITION ..............9-7 SPECIFY THE VALUES PASSED TO TARGET PARAMETERS ...............................9-8 MEMBER-TO-MEMBER DRILL-THROUGH ACCESS ...........................................9-9 DEMO 1: SET UP MEMBER-TO-MEMBER DRILL-THROUGH ACCESS..............9-10 DRILL DOWN THEN DRILL THROUGH ............................................................9-18 DEMO 2: LET USERS DRILL DOWN AND THEN DRILL THROUGH ..................9-19 DRILL THROUGH TO DIFFERENT DATA SOURCES..........................................9-27 MEMBER-TO-MEMBER...................................................................................9-29 FROM OLAP MEMBERS TO DMR MEMBERS.................................................9-30 FROM MEMBERS TO VALUES.........................................................................9-31 DEMO 3: DRILL THROUGH FROM MEMBERS TO A PARAMETER EXPECTING A BUSINESS KEY.........................................................................9-32 DEMO 4: DRILL THROUGH FROM MEMBER CAPTIONS TO VALUES ...............9-40 DRILLING TO DIFFERENT DATA SOURCES .....................................................9-46 DRILL THROUGH FROM DATES ......................................................................9-47 SUMMARY......................................................................................................9-48

END-TO-END WORKSHOP .......................................................................10-1

END-TO-END WORKSHOP ..............................................................................10-3

Page 10: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10 .2 )

P-10 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Course Overview

Course Overview

IIBM Cognos Report Studio: Author Reports with Multidimensional Data (v10.2) is an advanced two-day, instructor-led course in which professional report authors build on their experience with Report Studio by applying dimensional techniques to reports. Through interactive demos and workshops, students will learn how to author reports that navigate and manipulate dimensional data structures using specific dimensional functions and features available in Report Studio.

Intended Audience

This course is intended for professional report authors working with dimensional data sources and who want to take advantage of dimensional functions and features in Report Studio to create complex dimensional reports.

Page 11: Multidimentional Authoring

I N S T R U C T O R P R E F A C E

© 2007, 2012, IBM Corporation P-11 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Topics Covered

Topics covered in this course include:

Compare dimensional and relational data sources

Understand dimensional concepts and reporting styles

Create reports using dimensional data items such as members, levels, and hierarchies

Focus reports using dimensional techniques such as edge filters, slicers, and filter functions

Navigate dimensional data structures using functions to find related members or comparison time periods

Create sophisticated measure calculations

Understand totals and aggregation

Analyze reports with drill-up and drill-down techniques

Configure advanced drilling behavior to support complex calculations and dashboard reports

Set up drill-through access from one data source to another

Course Prerequisites

Attend the IBM Cognos Report Studio: Author Professional Reports Fundamentals (v10.2) course

Knowledge of your business requirements

Experience using basic Windows and Web functionality

genware
Highlight
Page 12: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10 .2 )

P-12 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

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

actionable items

(Point to Sort, and then click Ascending.)

text to type or keys to press

(Type Sales Report, and then press Enter.)

UI elements that are the focus of attention

(In the Format pane, click Data)

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.

Page 13: Multidimentional Authoring

I N S T R U C T O R P R E F A C E

© 2007, 2012, IBM Corporation P-13 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Workshops

Workshop Format

Workshops are 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 presents a business-type question followed by a series of steps. These steps provide additional information to help guide you 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 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 workshop 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 workshop. If you need more assistance to complete the workshop, please refer to the Step-by-Step Instructions at the end of the workshop.

The Workshop Results Section

This section will contain a screen capture(s) of 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 tasks are located at the end of the workshop following the Workshop Results section. Each task in the Task Table is expanded into numbered steps, scripted like the demos.

Page 14: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10 .2 )

P-14 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Your Feedback

Your feedback is important and valuable. We are interested in your comments or questions.

Please address them to:

Attn: Senior Manager, Customer Education

Email Address: [email protected]

Page 15: Multidimentional Authoring

I N S T R U C T O R P R E F A C E

© 2007, 2012, IBM Corporation P-15 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

IBM Product Help

Help type When to use Location

Task-oriented

You are working in the product and you need specific task-oriented help.

IBM Product - Help link

Books for Printing (.pdf)

You want to use search engines to find information. You can then print out selected pages, a section, or the whole book.

Use Step-by-Step online books (.pdf) if you want to know how to complete a task but prefer to read about it in a book.

The Step-by-Step online books contain the same information as the online help, but the method of presentation is different.

Start/All Programs/IBM Product/Documentation

IBM on the Web

You want to access any of the following:

Training and Certification Web site

http://www-01.ibm.com/software/data/education/cognos.html

Online support http://www-947.ibm.com/support/entry/portal/Overview/Software/Cognos/Cognos_Business_Intelligence_and_Financial_Performance_Management

IBM Web site http://www.ibm.com

Page 16: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10 .2 )

P-16 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 17: Multidimentional Authoring

Intro

© 2012 IBM Corporation

IBM Cognos BI

Introduction

Page 18: Multidimentional Authoring

I B M C O G N O S R E P O R T S T U D I O : A U T H O R R E P O R T S W I T H M U L T I D I M E N S I O N A L D A T A ( V 1 0 . 2 )

Intro-2 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 19: Multidimentional Authoring

I N T R O D U C T I O N

© 2007, 2012, IBM Corporation Intro-3 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Course Objectives

At the end of this course, you should be able to: understand dimensional concepts and reporting

styles

create reports using dimensional data items focus reports using dimensional techniques navigate dimensional data structures using

functions create measure calculations configure advanced drilling behavior to support

complex calculations

Page 20: Multidimentional Authoring

I B M C O G N O S R E P O R T S T U D I O : A U T H O R R E P O R T S W I T H M U L T I D I M E N S I O N A L D A T A ( V 1 0 . 2 )

Intro-4 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

IBM Cognos Report Studio: Author Reports with Multidimensional Data (v10.2)

Introduction to Dimensional Reporting Concepts Introduction to Dimensional Data in Reports Dimensional Report Context

Focus Your Dimensional Data Calculations and Dimensional Functions

Page 21: Multidimentional Authoring

I N T R O D U C T I O N

© 2007, 2012, IBM Corporation Intro-5 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

IBM Cognos Report Studio: Author Reports with Multidimensional Data (v10.2)

Functions for Navigating Dimensional Hierarchies Relative Functions Advanced Drilling Techniques and Member Sets

Set Up Drill-through Reports End-to-End Workshop

IBM Cognos Report Studio: Author Reports with Multidimensional Data (v10.2) is an advanced two-day, instructor-led course in which professional report authors build on their experience with Report Studio by applying dimensional techniques to reports. Through interactive demos and workshops, students will learn how to author reports that navigate and manipulate dimensional data structures using specific dimensional functions and features available in Report Studio.

Intended Audience: Professional Report Authors working with dimensional data sources

Prerequisites:

IBM Cognos Report Studio: Author Professional Reports Fundamentals (v10.21) public classroom course or online instructor-led

Knowledge of your business requirements

Experience using basic Windows and Web functionality

Page 22: Multidimentional Authoring

I B M C O G N O S R E P O R T S T U D I O : A U T H O R R E P O R T S W I T H M U L T I D I M E N S I O N A L D A T A ( V 1 0 . 2 )

Intro-6 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Bookmark IBM Cognos Educationhttp://www.ibm.com/cognos/training for details on: instructor-led training in a classroom or online self-paced training that fits your needs and schedule

comprehensive curricula and training paths that help you identify the courses that are right for you IBM Cognos Certification program

other resources that will enhance your success with IBM Cognos software

Additional Training Resources

Page 23: Multidimentional Authoring

1

© 2012 IBM Corporation

Introduction to Dimensional Reporting Concepts

IBM Cognos BI

Page 24: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-2 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 25: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-3 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Objectives

At the end of this module, you should be able to: identify different data sources and models investigate the OLAP dimensional structure identify dimensional data items and expressions differentiate the IBM Cognos BI query language

from SQL and MDX differentiate relational and dimensional report

authoring styles

Custom Courses: Participants should have taken the IBM Cognos Report Studio: Author Professional Reports Fundamentals (v10.2). Additional Notes: The terms multidimensional and dimensional can be used interchangeably. For consistency and simplification, the term dimensional is used throughout the course.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 26: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-4 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Data Sources and Model Types

You can work with both relational and dimensional data sources in IBM Cognos BI. To support these data sources, there are three model

types: relational dimensionally modeled relational (DMR)

OLAP

Relational models have a basic metadata structure that looks like tables and columns in a database.

Dimensionally Modeled Relational (DMR) models are built from relational data sources, but are modeled with a dimensional structure (like OLAP) consisting of measures and dimensions.

Online Analytical Processing (OLAP) models point to multidimensional data sources such as IBM Cognos PowerCubes or MSAS cubes, which in turn are built using their own modeling tools. PowerCubes are built using Transformer typically using relational data as a source.

In the IBM Cognos BI reporting studios, the metadata from DMR and OLAP models is shown in a dimensional structure comprised of dimensions, hierarchies, and measures.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Sticky Note
So OLAP Are bult using transformer which uses relational data source
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 27: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-5 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

The OLAP Structure

Q4Time

Q1 Q2 Q32005

Order Methods

Fax

Dimension

Jan Feb ...

Q1 Q2 ...

2005 2006 ...

Hierarchy/Levels

StartApril 1

EndJune 30

Products

Camping Equipment

Mountaineering Equipment

Outdoor Protection

Golf Equipment

Personal Accessories

TelephoneMail

E-MailWeb

Members

Cell – Web/Golf Eq./ 2005-Q4

Attributes

Members

The OLAP structure consists of the following elements:

dimensions - logical groupings of members

members - data entities that provide context to cell values

hierarchies - provide context to the level structures they contain

levels - provide structure for the members of a hierarchy

attributes - provide additional information for members

cells - are intersection points containing values (measures) for various members from different dimensions (also referred to as tuples)

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 28: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-6 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

<#1234#><#1234#><#Sunscreen#>

<#1234#><#1234#><#Insect Repellents#>

<#Year#><#Year#>Quantity

The Dimensional Structure in IBM Cognos BI

Dimension

Level

Member

Hierarchy

Members used as data items for a report

Child Members

Attribute

Report Studio, Analysis Studio, and Workspace Advanced show members in their metadata trees and let you work directly with the members as report data items. Query Studio does not show members in its metadata tree, although you can still use it to query dimensional data sources.

Report Studio, Analysis Studio and Workspace Advanced are termed "member-aware". Query Studio is not "member aware". IBM Cognos Planning Cubes do not have levels. There will be a performance impact if you use large numbers of individual members to populate the edges. This is due to the high number of requests that will be generated as a result of evaluating each member. Members of a given level may have attributes (for example Product line code). Because they are associated only with members, they have no hierarchical structure; therefore you cannot drill down or drill up on these items in a report.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 29: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-7 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Differentiate Data Entities

TrailChef Kitchen Kit

TrailChef Canteen

TrailChef Water Bag

Product

Auto PilotAstro Pilot Aloe Relief Product

RelationalOLAP/DMR

Members

Values

OLAP and DMR data entities are different from relational data entities:

members (OLAP and DMR)

values (relational)

When you create a report using a dimensional model, you work with the metadata or the members. Each member has certain properties such as a member key and member caption. Report authors and consumers see the member caption. Each member is defined and identified by its member unique name (MUN), which describes its position in the dimensional structure.

genware
Highlight
genware
Highlight
genware
Highlight
Page 30: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-8 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

What is a Dimensional Query?

A dimensional query in IBM Cognos BI: runs against dimensional structures including

dimensions, hierarchies, levels, members, member sets, and measures uses dimensional expressions and possibly

functions that understand and exploit the dimensional structures

returns a dimensional structure that has edges and intersecting values

A dimensional query returns a dimensional structure that has edges, such as columns and rows, which contain members from a level in a dimension. A dimensional query also contains intersecting values, or tuples, which represent the intersection points between the members on the edges.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 31: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-9 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

115208

81259

348058

Mail

31043721

7642306

19230179

Web

117758359414Personal Accessories

93856292408Mountaineering Equipment

203528413958Camping Equipment

SpecialFaxQuantity

The most common presentation of dimensional data is the crosstab.

The Dimensional Approach to QueriesEx

pres

sion

ExpressionExpression

The dimensional approach to querying is based on the premise that you include the items you want in your query rather than filtering out unwanted items. Populating the rows and columns with members is an inclusive process of specifying the required items rather than filtering items that are not required.

Rows and columns define the basic structure and determine cell values.

You can give further context to the cell values by restricting them to specific members from dimensions, which typically are not shown on the edges of the report (slicer).

In the slide example, the crosstab report uses three sets of expressions to populate the rows, columns, and cells.

genware
Highlight
Page 32: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-10 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Queries: specify how data should be retrieved for reports can contain data items to retrieve data, filters to

restrict specific data, and calculations to specify how data is retrieved

The Query Model in Report Studio

Report Studio automatically creates the queries you need as you build reports in the layout. If necessary, you can modify these queries or create your own queries to get the results you require.

You may need to include a data item in a query even though this item will not appear in the report layout. Instead of working in the report layout, you can add data items and filters directly to the query using the Query Explorer. You can use Query Explorer to view queries, and their components including data items, filters, and slicers, and to modify the properties for these objects.

genware
Highlight
genware
Highlight
genware
Highlight
Page 33: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-11 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Report Studio lets you manage the complexities of building queries through: a drag-and-drop interface with automatic

expression creation, providing faster development time the use of IBM Cognos BI dimensional functions in

expressions

The IBM Cognos BI Query Language

Dimensional expression using IBM Cognos BI query language

children([Asia Pacific])

You can use the IBM Cognos BI query language to build custom calculations, dynamically show data, and provide interactive data driven functionality to the end user. The expressions you write or that are generated automatically are written using IBM Cognos BI query language. The IBM Cognos BI query language is then converted at run time to the appropriate vendor-specific language and syntax (MDX or SQL).

genware
Highlight
Page 34: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-12 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Data Items and Data Item Properties

When you use the Report Studio layout to drag dimensional items onto your report, extended data items are created. The properties for the data items are visible in the Properties pane. These extended data items can be used as objects within both the report layout and query.

If you prefer to view and use the IBM Cognos expressions for data items instead of the extended data items objects, you can set the default in the Tools menu.

In 8.3, 8.4, and 10.1, the preferred and default method of adding data items to reports is with these new extended data items. To return to pre-8.3 behavior and use the generated expressions, go to Tools > Options > Report and clear the Always create extended data items for new reports check box. All demos and workshops in this course use the default setting.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 35: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-13 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Hierarchy expression

Level expression

Member expression (alias)

Attribute expression

Identify Dimensional Expressions

[sales_and_marketing].[Products].[Products]

[sales_and_marketing].[Products].[Products].[Product line]

[Camping Equipment]

[sales_and_marketing].[Products].[Products].[Product line]. [Product line - Long Name]

Members can be expressed with their full Member Unique Name (MUN) or with an alias.

MUN - [sales_and_marketing].[Products].[Products].[Product line]->:[PC]. [@MEMBER].[991]

Alias - [Camping Equipment]

genware
Highlight
genware
Highlight
Page 36: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-14 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

SQL used for relational data sources

MDX used for OLAP data sources

IBM Cognos BI query language used by report authors in Report Studio

converted to MDX or SQL at runtime

Differentiate from SQL and MDX

It is important to understand the difference between the various query languages. As an author using Report Studio, you will use IBM Cognos BI query language. It will be automatically converted at run time to the vendor-specific MDX or SQL.

genware
Highlight
genware
Highlight
Page 37: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-15 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 1

Explore the Dimensional Data Tree

Page 38: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-16 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Demo 1: Explore the Dimensional Data Tree

Purpose: You must familiarize yourself with using dimensional reporting objects to create reports. To do this, you will navigate a dimensionally-modeled relational data source and identify the objects in the data tree. You will identify the differences in the result set when using the objects in crosstab reports.

Task 1. Using a DMR data source, identify reporting objects in the data tree.

1. Start your internet browser, in the address box, type http://localhost:88/ibmcognos, and then press Enter.

2. On the Log on screen, in the User ID box, type brettonf, in the Password box, type Education1, and then click OK.

3. On the IBM Cognos Welcome page, click Author advanced reports, and then on the Select a package page, click Samples\Models\GO Sales (analysis) package.

4. On the IBM Cognos Report Studio page, click Create new, and then double-click Crosstab.

Task 1, step 2: Throughout this course, you will log on as Frank Bretton (User ID brettonf, Password Education1), a professional report author. At the end of each module, in the last demo or workshop, you will be instructed to log off. You do not have to log off if you will be doing the next module immediately; you should log off as a best practice if you are finished working with Report Studio/IBM Cognos Connection for the day. The logging off process is mentioned at the end of each module.

Page 39: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-17 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

The Source tab shows the GO Sales (analysis) model as follows:

The GO Sales model consists of a root namespace that takes its name from the package that was published from Framework Manager. This namespace contains six namespaces. This structure represents the contents of the package that was created in Framework Manager, which in turn, represents a business view of the metadata taken from the Framework Manager model. This model is based on a relational source but it was modeled dimensionally.

If you were to examine the data tree at this point, you would see Members folders. This is the default behavior for Report Studio for dimensional data sources. At this point, you will hide the Members folders because you want to only examine the metadata that is available from the tree, and not members.

You can change the view of the data package tree by switching between the

Metadata tree view and the Members tree view on the Source tab. For now, you will work in the default view.

5. Right-click the background of the Source tab, and then click Package Tree Settings.

genware
Highlight
genware
Highlight
genware
Highlight
Page 40: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-18 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

6. In the Settings section, clear the Members and the Members for each level check boxes, and then click OK.

The tree displays levels and member properties.

7. Click + to expand the Sales (analysis) namespace.

It contains measures and dimensions.

8. Expand the Products dimension.

It contains the Products hierarchy.

9. Expand the Products hierarchy.

It contains a hierarchical structure consisting of the Products, Product line, Product type, Product, and Product details levels. The Products level represents the top level of the hierarchy and, when used in a query or report along with a measure, represents the aggregate total for the lower levels of the hierarchy.

10. Expand the Product line, Product type, and Product levels.

Each level contains attributes that describe the parent level. Attributes can be used in queries or reports to provide information about a particular level.

11. Repeat steps 8 to 10 to explore the Time dimension within the Sales (analysis) namespace.

What differences are there?

12. Expand the Sales measure dimension.

It contains the measures that are in scope with all the dimensions within the Sales namespace.

You will now identify the differences between some of these objects when they are used to create reports.

genware
Highlight
genware
Highlight
genware
Highlight
Page 41: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-19 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 2. Use the highest level in a hierarchy to create a report.

1. On the Source tab, drag the Time level to the Columns drop zone of the report.

Time is the highest level in the Time hierarchy, and although not currently visible, has a single member that is called the root member. This same root member is also known as the root member for the hierarchy.

2. On the Source tab, right-click the Time level and then click Properties.

The Properties dialog box for the Time level data item appears, and the following expression appears in the Ref field:

[Sales (analysis)].[Time].[Time].[Time]

[Sales (analysis)] represents the namespace, and [Time].[Time].[Time] represents the dimension, hierarchy, and level (in this case the root level, which is a rollup for all years) of the selected item.

3. In the Properties dialog box, click Close, and then from the Products dimension\Products hierarchy, drag the Products level to the Rows drop zone of the report.

4. From the Sales measure dimension, drag the Revenue measure to the Measures drop zone of the report.

Measures can also be used on the columns or row edges of a report.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 42: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-20 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. On the toolbar, click Run Report .

The report appears in IBM Cognos Viewer as shown below:

Because you included the top levels from both the Time and Product hierarchies, the report shows the corresponding members from each level in the rows and column edges. In this case, each level contains a single member, Products and Time respectively. The value shown for Revenue is a rolled up value for all child levels for both hierarchies.

6. Close IBM Cognos Viewer.

Task 3. Use a level below the highest level in a hierarchy to create a report.

1. In the columns of the report layout, click <#Time#>, and then from the toolbar, click Delete.

2. On the Source tab, from the Products dimension\Products hierarchy, drag the Product line level to the Rows drop zone above <#Products#> as a peer, and then from the Time hierarchy, drag the Year level to the Columns drop zone.

3. On the Source tab, right-click the Year level and then click Properties.

The expression in the Ref field appears as follows:

[Sales (analysis)].[Time].[Time].[Year]

Compared to the previous expression, the level [Year] now replaces [Time].

genware
Highlight
Page 43: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-21 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

4. Click Close, and then on the toolbar, click Run Report.

The results appear as follows:

Because you are using the first levels below the highest levels from both hierarchies, you now see the child members of those levels on both the rows and columns edges. On the rows edge, you can see that the values shown for each child member roll up to the values shown at the parent member, which is Products.

5. Close IBM Cognos Viewer.

Task 4. Use a hierarchy to create a report. 1. In the report layout, click <#Product line#>, Ctrl+click <#Products#>, and

then on the toolbar click Delete.

2. On the Source tab, from the Products dimension, drag the Products hierarchy to the Rows drop zone.

The Insert Hierarchy dialog box appears.

3. Accept the default selection of Root members, and then click OK.

genware
Highlight
Page 44: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-22 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

4. On the Source tab, right-click the Products hierarchy, and then click Properties.

The expression in the Ref field appears as follows:

[Sales (analysis)].[Products].[Products]

5. In the Properties dialog box, click Close.

6. In the report layout, click <#Products#>, and then in the Properties pane, scroll to the Data Item section.

The Data Item section of the Properties pane appears as follows:

The data item properties indicate that the Products hierarchy will be used as a Member Set in the report.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 45: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-23 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

7. Click Run Report.

The results appear as follows:

The result is similar to that shown in step 5 from Task 2. Because you selected Root member as the option for showing the Products hierarchy, the rows edge of the reports shows the root member, Products, from the Products hierarchy. You still see the child members for the Year level on the columns edge.

8. Close IBM Cognos Viewer.

9. In the report layout, click <#Products#>, and then on the toolbar, click Delete.

10. On the Source tab, from the Products dimension, drag the Products hierarchy to the Rows drop zone.

11. In the Insert Hierarchy dialog box, click All members, and then click OK.

This data item will return the Hierarchy Set for the Products hierarchy, and not only Root Members. You will add some formatting so that the report appears properly.

12. In the report layout, click <# Products#>, in the Properties pane, under General, click the Level Indentation property, and then click the ellipsis.

13. In the Level Indentation dialog box, in the Indentation length box type 15.

14. In the Direction section, under Indent towards the right, in the Start after the following level box, type 1, and then click OK.

genware
Highlight
Page 46: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-24 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

15. On the toolbar, click Run Report.

A section of the report appears as follows:

Because you selected All members as the option for showing the Products hierarchy, the rows edge of the report shows all members from all levels based on the structure of the hierarchy.

16. Close IBM Cognos Viewer.

Task 5. Use an attribute to create a report. 1. In the report layout, ensure that <#Products#> is selected, and then from the

toolbar, click Delete.

2. On the Source tab, drag the Product line level to the Rows drop zone.

3. On the Source tab, expand the Product line level, and then drag the Product line code attribute to the rows to the right of <#Product line#> to nest as a child.

4. In the Insert Member Property dialog box, accept the default Insert property only option, and then click OK.

Page 47: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-25 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

5. On the rows edge of the report, click <Product line code>.

In the Properties pane, the Data Item section appears as follows:

Product line code is an attribute of Product line, and the Data Item currently associates it directly to the Product line level. Because Product line is already in the query, the Product line code attribute is labeled Productline1.

6. On the toolbar, click Unlock (currently locked) .

7. In the report layout, click the <Product line code> text item to refresh its properties.

The Data Item section of the Properties pane appears as follows:

This is the data item for the Product line code attribute.

genware
Highlight
Page 48: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-26 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

8. On the toolbar, click Lock (currently unlocked) , and then run the report.

The results appear as follows:

The Product line code attribute is nested for each member of the Product line level.

9. Close IBM Cognos Viewer, and then close Report Studio without saving the report.

10. Log off of IBM Cognos Connection.

Results: You familiarized yourself with using dimensional reporting objects by navigating the data tree of a dimensionally modeled relational data source, and by using the objects to create crosstab reports.

Task 5, step 10: Do not log off of IBM Cognos Connection if you are advancing to the next module today.

Page 49: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-27 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

The IBM Cognos BI Reporting Studios

Query Studio Analysis StudioWorkspace Advanced Report Studio

Use Query Studio for ad hoc querying with little formatting. Query Studio is focused on the relational model types and relational concepts.

Use Analysis Studio for deep comparative analysis. Analysis Studio supports only dimensional model types.

Use Workspace Advanced to create self-service reports for analysis of business performance. You can develop reports using the report layout, live data, or a limited set of data.

Use Report Studio to author professional, statement-style reports. Report Studio supports both relational and dimensional model types.

This slide briefly reviews the reporting studios. This should be review from the IBM Cognos Report Studio: Author Professional Reports Fundamentals (v10.1) course. This course focuses on dimensional capabilities in Report Studio.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 50: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-28 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Report Authoring Styles

The Relational Style lets report authors:work with metadata only create both list reports and crosstabs

The Dimensional Style lets report authors:work with members in addition to metadata

create crosstabs and charts take advantage of dimensional capabilities on DMR

and OLAP data sources achieve more control and flexibility over how data

is retrieved

The Relational Style lets report authors apply relational techniques to relational, DMR, and OLAP data sources. Some examples of relational techniques are detail filters, summary filters, and string functions.

The Dimensional Style lets report authors apply dimensional techniques to DMR and OLAP data sources. Dimensional techniques include dimensional functions and slicers.

With the Dimensional Style authors can work with members and take advantage of dimensional capabilities on DMR and OLAP data sources.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 51: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-29 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

√ √

√ √ √

Apply Report Authoring Styles

Dimensional

RelationalAuthoring Style

Relational OLAPDMR

Data Source

*

*

It is recommend that only advanced authors use a style that does not match its data source, or use two different styles in the same query. It is important to understand the rules, impact, and limitations of these techniques before employing them.

* 1) Be careful using relational authoring style with OLAP data sources, or using dimensional authoring style with DMR data sources. 2) Best practice is to use optimal style for data source. Mixing both styles within a single query, indicated by the red boxes, is not recommended as it can lead to both performance issues and unexpected results. An example of mixing styles in the same query would be, if you were querying an OLAP data source, and you used a caption function on a member to return its caption, and then applied a string function such as substring. It is crucial that report authors learn to distinguish between reporting styles and to apply dimensional styles to their dimensional data.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 52: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-30 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Other Studio Reports in Report Studio

You can open Query Studio, Analysis Studio and Workspace Advanced reports in Report Studio to: identify and learn more about the dimensional and

relational style authoring techniques applied in these reports apply style and augment the reports

Because of the interdependent nature of expressions in an Analysis Studio report, you should not use it as a starting point for your report in Report Studio. Build a new report in Report Studio, based on what you found in the Analysis Studio report.

genware
Highlight
genware
Highlight
Page 53: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL REPORTING CONCEPTS

© 2007, 2012, IBM Corporation 1-31 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Summary

At the end of this module, you should be able to: identify different data sources and models investigate the OLAP dimensional structure identify dimensional data items and expressions differentiate the IBM Cognos BI query language

from SQL and MDX differentiate relational and dimensional report

authoring styles

Page 54: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

1-32 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 55: Multidimentional Authoring

2

© 2012 IBM Corporation

Introduction to Dimensional Data in Reports

IBM Cognos BI

Page 56: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-2 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 57: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-3 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Objectives At the end of this module, you should be able to: work with members

identify sets and tuples in Report Studio

Some topics are review because they have been previously covered in the IBM Cognos Report Studio: Author Professional Reports Fundamentals (v10.2) course. The topics of identifying sets and tuples, as well as expressions, are covered at a high level with more detail to follow in subsequent modules. Participants should have taken the IBM Cognos Report Studio: Author Professional Reports Fundamentals (v10.2) course.

Page 58: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-4 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

What Makes Up a Member?

Feb 15, 1995SilverAluminum canteen that holds 2 liters

TrailChef Canteen2

Feb 15, 1995Blue and red

Lightweight, collapsible bag to carry liquids easily

TrailChef Water Bag1

Introduction DateColorDescriptionProduct

NameProduct Code

Data source table

Member key

Member caption

Attributes

Membersource

Membersource

In the example above, each row is a data entity that contains the data used to make up a member. The member key is used to identify a particular member in a dimensional structure. The member caption is the name that appears for the member. Members may also have attributes, such as alternate member names or other descriptive information.

The data that makes up a member is also described as the properties of a member. Member properties are defined in their originating data source.

For example: In a Framework Manager DMR source: member key property = _businessKey role; member caption property = _memberCaption role In an IBM Cognos PowerCube source: member key = Category code; member caption = Category label In an IBM Cognos Contributor cube source: member key = IID (internal identification); member caption = display name In a MSAS cube source: member key = Member Key Column; member caption = Member Name Column

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 59: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-5 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

What is a Member Unique Name?

A Member Unique Name (MUN):

uniquely identifies a member A MUN is referenced in an expression when a member

data entity is used:

in a report in a filter or calculation for drill-through access

MUNs are not intended to be readable or constructible by users.

Member unique names are similar in concept to business keys which can be used to find records within a relational table. For example, where Product line code is 1, Product line is Camping Equipment.

Why are MUNs important for drill-through? The MUN or a portion of the MUN is passed as a parameter from multidimensional source reports.

In any report scenario, if a MUN for a member, used in a report, changes, the report breaks. This can occur when the member key changes.

MUNs also identify a measure because a measure is a member in a measure dimension. However, they have a simpler appearance.

genware
Highlight
genware
Highlight
genware
Highlight
Page 60: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-6 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

What Makes Up a MUN?

A MUN is not defined in the same way for different OLAP vendors. However, it is typically defined as:

MUN from a PowerCube data source:

MUN from a Framework Manager DMR data source:

level unique name

[sales_and_marketing].[Products].[Products].[Product type]->: [PC].[@MEMBER].[952]

[Product forecast].[Products].[Products].[Product type]->[Products].[991].[952]

->: path consisting of keys or alternate method of uniquely identifying the member

MUN formats are dependent on the data source.

genware
Highlight
Page 61: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-7 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Changes that Impact a MUN

When MUNs change, members referenced in expressions or as drill-through parameters can no longer be found.MUNs can change when: hierarchies or levels change

member keys changemembers no longer exist in the data source

a production environment has more members than in the test environment

Identifying which changes affect MUNs will help modelers to model metadata appropriately so that reports created in the test/development environment will function without issue in the production environment.

When MUNs change, they impact the reports that directly reference the members they point to. Those MUNs must be identified and fixed. If a report references a level that returns all members, then a changed MUN will not affect the report. Levels are not members and therefore do not have MUNs.

During the initial design phase, an organization may use a smaller data set to build cubes in a test environment than they typically would in their production environment. This can produce a MUN change when moving from test to production because production will have more members than test and the references may change. This may also be the case when trying to convert one environment, such as MSAS, to another, such as IBM Cognos PowerCube, or vice versa. There are MUN change management techniques available that will help with fixing reports that are broken as a result of changing MUNs. These techniques are beyond the scope of this course.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 62: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-8 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 1Use Members to Create Reports

Page 63: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-9 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 1: Use Members to Create Reports

Purpose: Because Report Studio lets us use members to create reports, you will navigate an IBM Cognos PowerCube data source to identify members in the data tree. This will include the root member for a hierarchy, the member at the highest level of a hierarchy, and members at lower levels. To demonstrate the power of using members, you will create a report using levels and compare it to creating a report using members.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab Namespace: Sales (analysis)

Task 1. Identify members in the dimensional data tree. 1. On the toolbar click New, without saving the previous report, and then double-

click Crosstab.

2. On the Source tab, right-click the background area, and then click Package Tree Settings.

3. Ensure that the Package Tree Settings check boxes are all selected as follows.

Page 64: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-10 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

4. Click OK.

5. On the Source tab, expand the Products dimension, the Products hierarchy, and then all levels within the Products hierarchy.

Each level in the hierarchy, and the hierarchy itself, contains a Members folder.

6. Under the Products hierarchy, expand the Members folder, and then under the Products level, expand the Members folder.

Each folder contains the same member, Products. The Products member is the member for the highest level, Products, in the hierarchy, a level which represents all products. In some cases, this "all" level is omitted from the model; therefore, report authors can only access the root member(s) from the hierarchy’s Members folder.

7. For each lower level in the hierarchy, expand the Members folder.

Each level contains members at increasingly lower levels of detail. For example, the Product level, which is at the lowest level, has the most members. The Product type level contains fewer members than the Product level, and the Product line level contains even fewer members than the Product type level.

8. Under the Products level\Members folder, expand the Products member.

Members from the next level in the hierarchy, Product line, appear.

9. Expand the Camping Equipment member.

Members at the Product type level for the Camping Equipment member appear.

10. Expand the Tents member.

Members at the Product level for the Tents member appear.

Task 1, step 7: Depending on the dimensional data source you are using, more than one root member at the highest level may be specified, as in SAP BW data sources.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Sticky Note
So as you go upwards from the nu,ber of members reduces
Page 65: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-11 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

11. Expand the Star Dome member.

There are no members to show because Star Dome is at the lowest level in the hierarchy.

You accessed lower-level members by navigating to them from the highest level, Products, in the hierarchy. You can also access lower-level members by navigating to them at their respective level within the hierarchy.

12. Under the Product line level\Members folder, expand the Camping Equipment member and the Tents member.

You can access the same members as previously shown in steps 9 to 11. The only difference is that you began the navigation from the Product line level instead of the Products level.

13. Under the Product type level\Members folder, expand the Tents member.

The members from the Tents member appear, as previously demonstrated.

Are these the same members? Yes, but how can you confirm this?

14. In the Product type level, under the Tents member, place the mouse pointer over the Star Dome member.

The MUN for the member appears in the tooltip as follows:

[sales_and_marketing].[Products].[Products].[Product]->:[PC].[@MEMBER]. [12]

genware
Highlight
Page 66: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-12 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

15. Repeat step 14 in the Products level, for the Star Dome member.

The MUN for the member appears in the tooltip as follows:

[sales_and_marketing].[Products].[Products].[Product]->:[PC].[@MEMBER]. [12]

Both instances of the member have the same MUN; therefore they are the same member. The structure of the hierarchy is flexible so that you can access members using multiple navigation paths. It does not matter where you take the members from when you create reports, because each member is uniquely identifiable through its MUN.

16. On the Source tab, click View Members Tree , expand Products\Camping Equipment\Tents, and place the mouse cursor over the Star Dome member.

Notice that MUN is the same as the previous view. The members tree view allows you easy navigation of members. You will work with levels, rather than members, for the next task.

17. On the Source tab, click View Metadata Tree .

Task 2. Create a report using levels. 1. On the Source tab, drag the Product line level to the Rows drop zone, and

then drag the Product type level to rows to the right of <#Product line#>.

Product type is nested as a child of Product line.

2. On the Source tab, expand the Time dimension and the Time hierarchy, and then drag the Year level to the Columns drop zone.

3. Drag the Month level to columns under <#Year#>.

Month is nested as a child of Year.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 67: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-13 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

4. On the Source tab, expand the Measures dimension, drag the Revenue measure to the Measures drop zone, and then on the toolbar, click Run Report.

A section of the report appears as follows:

Because you are using levels in the report, all members from each of the levels appear. In particular, because you have used the Month level, which contains numerous members, the report is so wide that it requires scrolling.

5. Close IBM Cognos Viewer.

Task 3. Create a report using members. 1. Create a new crosstab report without saving the previous report.

2. On the Source tab, expand the Time dimension\Time hierarchy\Year level\Members folder (under Year), click 2011, and then Ctrl+click 2012.

The members 2011 and 2012 are selected.

3. Drag the items to the Columns drop zone.

Task 2, step 4: When creating reports with levels, a level may have thousands of members, and this would impact the report output.

Page 68: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-14 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

4. On the Source tab, expand 2012, and then expand 2012 Q 4.

5. Click 2012/Oct, Shift+click 2012/Dec, and then drag the items to columns under <#2012#>.

The 2012/Oct, 2012/Nov, and 2012/Dec Month members are nested as children of 2012 in the columns.

6. On the Source tab, in Products dimension\Products hierarchy\Product line level\Members folder, click Camping Equipment, Ctrl+click Mountaineering Equipment, and then drag the items to the Rows drop zone.

Camping Equipment and Mountaineering Equipment appear in the rows.

7. On the Source tab, in the Measures dimension, drag Revenue to the Measures drop zone in the report, and then run the report.

The results appear as follows:

By using members, you narrowed the focus of the report to only those members you are interested in viewing. In this case, you see revenue for 2011 and for the last three months of 2012 for both the Camping Equipment and Mountaineering Equipment product lines.

8. Close IBM Cognos Viewer.

Results: You navigated an IBM Cognos PowerCube data source and identified members in the data tree, including the root member for a hierarchy, the member at the highest level of a hierarchy, and members at lower levels. You learned how you could use members to create focused reports.

Page 69: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-15 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 2Explore MUNs

Page 70: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-16 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Demo 2: Explore MUNs

Purpose: You must become proficient at using members to create reports. To help achieve this, you will add members to the edge of a crosstab report, and then examine the member expressions that are generated.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples\Models\GO Data Warehouse

(analysis) Report type: Crosstab Folder: Sales and Marketing (analysis) Namespace: Sales (analysis)

Task 1. Identify a MUN in a report. 1. Create a new crosstab.

The GO Data Warehouse package is based on a model that was modeled dimensionally in Framework Manager. This is an example of a Dimensionally Modeled Relational (DMR) model.

2. On the Source tab, expand the Sales and Marketing (analysis) folder\Sales namespace\Products dimension\Products hierarchy, and then drag the Product line level to the Rows drop zone in the crosstab.

3. On the Source tab, expand the Order method dimension\Order method hierarchy\Order method type level\Members folder.

Page 71: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-17 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

4. Click the Fax member, Ctrl+click the Telephone, Mail, E-mail, and Web members, and then drag the items to the Columns drop zone.

Fax, Telephone, Mail, E-mail, and Web appear as columns.

You will now examine the MUN for the Fax member. You previously identified a MUN by viewing the tooltip for the member in the Insertable Objects pane. You will now use an alternate method.

5. On the Source tab, click the Order method level to change the focus of the currently selected items.

6. Right-click the Fax member, and then click Properties.

The properties for Fax are displayed. The Member Unique Name value is as follows:

[Sales].[Order method].[Order method].[Order method type]->[Order method].[601]

Notice the last portion of the expression: [601]

7. Close the Properties dialog box.

8. On the Source tab, expand the Sales fact measure dimension, and then drag the Revenue measure to the Measures drop zone.

Page 72: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-18 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

9. On the toolbar click Run Report.

The results appear as follows:

The rows edge is populated with all the members from the Product line level, while the columns edge is populated with members that you selected from the Order method dimension level.

10. Close IBM Cognos Viewer.

11. Close Report Studio without saving the report.

Results: You used members to create a crosstab report and examined the MUN expressions that are generated.

Task 1, step 10: With DMR a broken MUN will simply return no data or the wrong data. This is because the filter syntax generated in the native SQL will still be valid and either return no data if the filter condition is not met, or return the wrong data if the changed MUN's member key is pointing to another row in the database table. With OLAP data sources, this behavior is different. You get an error message indicating which MUNs are broken. This is because OLAP uses MUNs to retrieve members from the data source. Unlike SQL filters, which exclude all data except the ones that meet the criteria, MUNs are used to request a specific item. If that item does not exist, then an error is raised indicating that it cannot be found. Altered MUNs in OLAP data source also have the potential to return the wrong member. For example, if a report uses a MUN pointing to Camping Equipment and that MUN subsequently changes, it could end up pointing to Golf Equipment although the report indicates it should be Camping Equipment. If you frequently encounter reports that are broken as a result of changed MUNs, you should discuss the issue with the data modeler to devise a model maintenance strategy that prevents or minimizes the problem.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 73: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-19 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Insert Members and Children

<#Time#>

<#Time#>

<#2011#>

<#2012#>

<#2013#>

<#2010#>

<#2013#>

<#2012#>

<#2011#>

<#2010#>

By default, when you insert members from the source tree into your report, single members are inserted without any details or children. You can change how members are inserted. For example, you may want to insert a member along with all its children or insert only its children.

When you double-click a member in your report layout, by default its children are automatically inserted after the parent member.

When you double-click a member in your report, you can control whether the children are inserted before or after, nested, or not inserted at all (Tools, Options, Edit tab)

genware
Highlight
genware
Highlight
Page 74: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-20 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Sets in Report Studio

Personal Accessories

Mountaineering Equipment

Outdoor Protection

Golf Equipment

Camping Equipment

201220112010Revenue

In the [Product line] level, the members Camping Equipment, Golf Equipment, Outdoor Protection, Personal Accessories, and Mountaineering Equipment, are a set of members.

In the [Year] level, the members 2010, 2011, and 2012 are a set of members.

If individual members were

used, how many sets

would exist?

A set refers to a group of one or more members from a single hierarchy.

A set can be created manually using a Query Calculation object and creating a set expression, or by using the Create Sets for Members button and dragging multiple members (from within the same hierarchy) to include in the set to the report layout.

A set can be generated automatically by dragging items (with children) to the report layout.

A set can be sorted and summarized.

To create the crosstab structure shown in the graphic you could drag the Product line level to the rows, and then drag the Year level to the columns edge. These would be examples of generating sets automatically. In the example in the diagram above, the answer to the question is 5 sets.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 75: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-21 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Create Sets for MembersInsert Individual Members

(default mode)Create Sets for Members

<#Mountaineering Equipment#>

<#Camping Equipment#>

Mountaineering Equipment

Camping Equipment

<#Products)#>

Mountaineering Equipment

Camping Equipment

When you drag a member to the report layout, the mode you are using will determine what result will be in the layout, the query, and the final report.

In the diagram, you can see the effect of each mode when dragging Golf Equipment and Mountaineering Equipment members to the report layout, followed by the resulting data items created in the query, followed by the resulting report.

genware
Highlight
Page 76: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-22 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Tuples in Report Studio

230,110,270.55168,006,427.07153,553,850.98 Golf Equipment

4,471,025.2625,008,574.0836,165,521.07Outdoor Protection

594,009,408.42456,323,355.90391,647,093.61 Personal Accessories

161,039,823.26107,099,659.940.00Mountaineering Equipment

500,382,422.83402,757,573.17332,986,338.06Camping Equipment

201220112010Revenue

The result set of a dimensional query contains tuples, which refer to the measure values at the intersections of members from different dimensions.

To return the tuples, a dimensional query also uses the default member from all dimensions that are not explicitly referenced in the query.

In queries where default members are implicitly used, dimensions with more than one hierarchy will typically use the default member from the first hierarchy in the natural order of the dimension. Certain data source vendors may have different behaviors.

The tuple [Golf Equipment], [2011], [Revenue] returns the revenue measure value for golf equipment in 2011 and for all order methods, retailers, promotions, and so on.

genware
Highlight
genware
Highlight
genware
Highlight
Page 77: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-23 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Drag the Product

line level to the

Rows drop zone.

Drag the Year level to the Columns drop zone.

Drag the Revenue measure to the Measures drop zone.

Tuple value

Set

<#1234#><#1234#><#Product line#>

<#1234#><#1234#><#Product line#>

<#Year#><#Year#>Revenue

230,110,270.55168,006,427.07153,553,850.98Golf Equipment

10,349,175.842,008,574.0836,165,521.07Outdoor Protection

594,009,408.42456,323,355.90391,647,093.61Personal Accessories

161,039,823.26107,099,659.94Mountaineering Equipment

500,382,422.83402,757,573.17332,986,338.06Camping Equipment

201220112010Revenue

Set

MeasuresRows

ColumnsBlank crosstab layout

Automatically Create Sets and Tuples

Set

Report Studio provides a graphical design interface for creating reports using sets, tuples, and individual members. For example, in a crosstab report, measure values are placed in the measures drop zone, while sets are added to the column and row drop zones. You can implicitly create a set by dragging a single member such as Camping Equipment to the columns or rows edge, to a collection of members, such as 2011 Q 1, and 2011 Q 2, to a level, or to a hierarchy.

A tuple references a value defined by the intersection of dimensions both in and out of the query. Therefore, 107,099,659.94 (highlighted) is the revenue value of not only the tuple [Mountaineering Equipment],[2011] but also for the default member of all other hierarchies of other dimensions not included in the query (all Product brands, all Retailers, all Order methods, and so on)

By dragging in the [Product line] level, the report shows the [Revenue] for each member of [Product line]. That is, [Product line] represents the set of members [Camping Equipment] through [Mountaineering Equipment]. If another dimension level is added to the columns, such as [Year] after [Product line], the report would return the [Revenue] value for each [Product line] member for each [Year] member. Remember that.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 78: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-24 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Revenue

2011

Golf Equipment

2011,Golf Equipment,Revenue

Create an Individual Tuple Easily

Select multiple members from

data tree

Right-click, and drag to report layout The tuple is created in

the report layout

Run the report to display results

2011,Golf Equipment,Revenue 168,006,427.07

In the data tree, select multiple members from different hierarchies, and right-click while you drag the items to the report layout. A tuple cannot contain more than one member from a hierarchy.

genware
Highlight
genware
Highlight
genware
Highlight
Page 79: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-25 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

You can use IBM Cognos BI dimensional expressions and functions to manually create sets and tuples.

Create expressions using:

Manually Create Sets and Tuples

Add to the queryAdd to the report layout

and query

Create expressions that contain dimensional functions using:

an Intersection (Tuple) object, or Query Calculation object from the Page Explorer, which results in a data item being added to both the query and the report layout

a Query Calculation object, Intersection (Tuple) object, or a Data Item object from the Query Explorer, which results in a data item being added to only the query and not to the report layout

existing expressions, which you can access from the report layout or the Data Items pane of the Query Explorer

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 80: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-26 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Query Calculations

Create:

calculated member calculated measure set expression

other expression

[Revenue]- [Planned Revenue]

[2006]- [2005]

children([2006])

localtime

Create calculated members or calculated measures where the expression is a member or a tuple-based (not property-based) value expression.

Use set expressions to create calculated sets of members. You must base each set expression on a hierarchy, and the set expression must contain only members from this hierarchy.

Create value expressions when you want to insert a string, number, date, or interval value.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 81: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-27 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

1,176,790,495.28178,641,846.18165,823,206.65Total

42,951,811.8910,029,884.3111,928,314.52Outdoor Protection

1,133,838,683.39168,611,961.87153,894,892.13Camping Equipment

WebSales visitTelephoneRevenue

The set() Functionset(member {,member})

set([Camping Equipment],[Outdoor Protection]) named "Selected Product Lines"

Properties of Total

YesUse Set Aggregation

TotalLabelProductsDimension

ProductsHierarchy

Selected Product LinesAggregate Data ItemTotalAggregation Method

1Solve Order

Total(Selected Product Lines)NameDimensional Edge SummaryType

Data Item

The set function returns the list of members defined in the expression.

The members must be from the same hierarchy.

The set function is valuable because you can use it to create a set expression and then reuse the set expression in other expressions.

The Selected Product Lines set was created by dragging a Query Calculation object to the rows.

Use the syntax provided in the callouts to describe how the Selected Product Lines set is created and how it is reused.

genware
Highlight
genware
Highlight
genware
Highlight
Page 82: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-28 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 3Use the set() Function to Focus Your Report

Page 83: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-29 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 3: Use the set() Function to Focus Your Report

Purpose: To create dimensional reports you need to understand how the set function behaves. To accomplish this, you will create a crosstab report by using individual members from a level instead of using an entire level. You will modify the report by using the Report Studio functionality to include a set expression to show individual members on an edge. You will also show how the set you create can be reused in another expression.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create an unfiltered report. 1. Create a new crosstab report.

2. On the Source tab (in the View Metadata Tree mode), expand the Retailers dimension\Retailers hierarchy, and then drag the Region level to the Columns drop zone.

3. On the Source tab, expand the Order method dimension\Order method hierarchy, and then drag the Order method type level to the Rows drop zone.

Page 84: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-30 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

4. On the Source tab, expand the Measures dimension, drag Revenue to the Measures drop zone, and then on the toolbar, click Run Report.

The report runs in IBM Cognos Viewer and appears as follows:

The report shows revenue for all order methods for all retailer regions.

You want to narrow the focus of this report so that you see revenue for only the Telephone and E-mail order methods. You will do this by replacing the Order method type level in the report with the appropriate members.

5. Close IBM Cognos Viewer.

Task 2. Focus your data using individual members. 1. In the report layout, click <#Order method type#>, and then on the toolbar,

click Delete.

You can use the metadata tree to select members from their respective members folders, but for ease of navigation, you will use the members tree.

2. On the Source tab, click View Members Tree, expand Order method, click the Telephone member, and then Ctrl+click the E-mail member.

Task 2, Step 2: Another method to do this would be: On the Source tab, expand the Order method type level and the Members folder (under the Order method type level), click the Telephone member, and then Ctrl+click the E-mail member.

Page 85: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-31 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

3. Drag the items to the Rows drop zone, and then on the toolbar, click Run Report.

The report appears as follows:

The report shows revenue for the Telephone and E-mail order method types for all retailer regions.

4. Close IBM Cognos Viewer.

Task 3. Add a total for the members on the rows. 1. In the report layout, click <#Telephone#>, and then Ctrl+click

<#E-mail#>.

2. On the toolbar, click Summarize , and then click Total from the drop-down menu.

A message appears that reads: "One or more of the objects selected represents a single value. No summary is performed for the object(s)."

By dragging the Telephone and E-mail members to the Rows drop zone, you have included only the individual, separate members in the rows. Instead you should create a set using the set() function, and then summarize that set. You could create a set expression using a Query Calculation, but you will use the user interface functionality to efficiently create a set from members.

3. Click OK to close the dialog box.

4. With <#Telephone#>and <#E-mail#> selected, on the toolbar, click Delete.

5. On the Source tab, click Create Sets for Members (currently inserting

individual members) .

Task 3, Step 5: Another method of doing this is to edit the set definition of the Order method type in the rows, to exclude all members except Telephone and E-mail. You will be exploring more about Set Definition later in the module.

genware
Highlight
Page 86: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-32 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

6. On the Source tab, click the Telephone member, Ctrl+click the E-mail member, and then drag the items to Rows drop zone.

7. In the report layout, click <#set(Telephone, E-mail)#>.

8. On the toolbar, click Summarize, and then click Total from the drop-down menu.

9. On the toolbar, click Run Report.

The results appear as follows:

You have effectively filtered the report to show only the Telephone and E-mail members of the Order method type level. You have done this by modifying a row expression of the report. You have also summarized the set to show a total for the set and not the members within it.

10. Close IBM Cognos Viewer, and then, in the report layout, click Total.

In the Properties pane, in the Data Item section, the following properties appear:

Notice that the expression reuses the expression set(Telephone, E-mail).

Page 87: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-33 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

11. On the Source tab, click Insert Individual Members (currently creating

sets) , and then click View Metadata Tree to return to return to the default settings.

Leave report Studio open for the next demo.

Results: You created a crosstab report that is focused by using individual members from a level instead of an entire level. You modified the report to include an expression that uses the set function to show individual members on an edge. You also identified how the set you created could be reused in another expression.

Page 88: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-34 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Use Set Definitions

A set definition allows the following operations:

exclude membersmove members to the top or bottom of a set join multiple sets

filter the set expand and collapse a member within a set

The set definition graphically displays the history of operations performed on the base set. It lets you edit the operations performed on the set, such as add or remove operations, and reorder the operations, with no manual change required to the syntax of the function expression.

The set definition in the slide represents the set of product lines, excluding Mountaineering Equipment, that are the top 10% based on revenue in 2012. Set Definition operations will be explored in more detail later in the course.

Page 89: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-35 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

The tuple() Function

tuple(member {,member})

13,445,559.93

Revenue

8856249234tuple([Fax],[2006])

ReturnsQuantity

A tuple identifies a cell location (intersection) based on the specified members, each of which must be from a different dimension. You can also include a measure from a measure dimension. A tuple implicitly includes the current member from all dimensions that are not specified in the arguments or the report.

Returned values are in context of other members in the report layout.

Similar to "tuple", completeTuple identifies a cell location (intersection) based on the specified members, each of which must be from a different dimension. However, completeTuple implicitly includes the default member from all dimensions not otherwise specified in the arguments, rather than the current member. The tuple function provides a great deal of control to the report author over what is returned in the cells of the crosstab. An example of this is how the tuple function can be used to override the context defined by a slicer. For example, you have a report that returns the top 3 product lines for revenue for all Sales Regions. If you add a slicer on Asia Pacific, you will see a different set of product line members as my top 3. Obviously, my cell values will also be affected. If I include the tuple function in the topCount function that includes the Sales Region member as a parameter, it will override the slicer with respect to what is returned as your top 3 product lines. Essentially, you will get the same product line members that were returned when the slicer wasn’t applied. The difference will be the cell values. Even though you get the same members, the cell values will still be sliced on Asia Pacific.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 90: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-36 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 4Identify Sets and Tuples in Reports

Page 91: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-37 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 4: Identify Sets and Tuples in Reports

Purpose: Automatically create sets by adding items to the rows, columns, and measures drop zones in a crosstab report. Identify tuples in the report, including those defined by members on both separate and the same axes. Compare results to a tuple that you created manually.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples\Cubes\Sales and Marketing (cube) Report type: Crosstab

Task 1. Identify sets in a report. 1. Create a new crosstab report without saving the previous report.

2. On the Source tab, expand the Time dimension\Time hierarchy, add the Year level to the Columns drop zone, and then run the report.

The results appear as follows:

You have created a set for this report. This set appears on the columns edge of the report and shows the list of members for the set that is generated by the following expression:

[sales_and_marketing].[Time].[Time].[Year]

3. Close IBM Cognos Viewer.

4. In the report layout, click <#Year#>to set the focus, right-click <#Year#>, and then click Edit Set.

The set definition indicates that the members for the Year level are in this set.

Page 92: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-38 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. Hover the mouse cursor over the Year level in the set definition.

The message indicates that the set is defined by members of the level.

6. Click OK to close the Set Definition dialog box.

7. On the Source tab, add Products dimension\Products hierarchy\Product line level to the Rows drop zone, and then run the report.

The results appear as follows:

You have created a second set for this report. This set, shown on the rows edge of the report, shows the list of members for the set that is generated by the following expression:

[sales_and_marketing].[Products].[Products].[Product line]

8. Close IBM Cognos Viewer.

9. In the report layout, click <#Product line#> to set the focus, right-click <#Product line#>, and then click Edit Set.

The set definition indicates that the members for the Product line level are in this set.

10. Click OK to close the Set Definition dialog box.

Page 93: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-39 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

11. Add Order Method dimension\Order Method hierarchy\Order Method type level to columns to nest as a child under <#Year#>, and then run the report.

A section of the report appears as follows:

You have created a third set for this report that is nested and shown on the columns edge of the report. It shows the list of members that is generated by the following expression:

[sales_and_marketing].[Order Method].[Order Method].[Order Method type]

Optional: Open the Set Definition for the Order Method type set in the report layout and observe the results.

12. Close IBM Cognos Viewer.

Up to this point, you identified sets in a crosstab report. You will now identify tuples.

Page 94: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-40 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 2. Identify tuples in a report. 1. Add the Measures dimension\Revenue measure to the Measures drop zone.

2. On the toolbar click Run Report.

A section of the report appears as follows:

Examine the value 80,467,596.88. This value represents the rolled up revenue value for all months and quarters of the year 2010, for all product names and product types of the Camping Equipment product line, and for the Telephone order method. It can also be expressed using dimensional terminology as the tuple of the 2010, Camping Equipment, and Telephone members for the Revenue measure. Although not evident by what appears in the report, the dimensional query, which is used to return the measure values in the cells, also uses the default members from all other dimensions in the cube.

3. Close IBM Cognos Viewer, in the report layout click <#Product line#>, and then on the toolbar, click Delete.

Task 2, Step 3: Even if Revenue was on the report by itself, a value would still be returned. This value would be the tuple of default members from all dimensions.

genware
Highlight
Page 95: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-41 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

4. On the toolbar click Run Report.

A section of the report appears as follows:

Examine the value 178,793,580.36. This is the tuple of the 2010 and Telephone members for the Revenue measure. This shows that tuples can exist, not only for members on separate axes, but for members on the same axis, in this case nested members. Because you removed Product line from the report, you are now seeing that the query is using not only the default members from other dimensions, such as Retailers and Promotions, but also the default member from the Products dimension. The value 178,793,580.36 is now a rollup of all products (not individual product lines) for the year 2010 and the Telephone order method.

You will also examine the MDX that is generated for this dimensional query.

5. Close IBM Cognos Viewer, and then from the Tools menu, click Show Generated SQL/MDX.

The Generated SQL dialog box opens as shown below:

The Native MDX is shown. It is generated automatically by dragging and dropping items in the user interface.

6. Close the Generated SQL dialog box.

Page 96: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-42 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Create a tuple manually. 1. Create a new crosstab report without saving the previous report.

2. On the Source tab, expand the following items:

Time dimension\Time hierarchy\Year level\Members folder Order method dimension\Order method hierarchy\Order method type

level\Members folder Measures dimension

3. Click the 2010 member, Ctrl+click the Telephone member and the Revenue measure, and then right-click and drag to the columns drop zone on the report layout.

4. Click Insert as Tuple.

5. On the toolbar click Run Report.

The results appear as follows:

The results for this manually created tuple item (178,793,580.36) match the results of the tuple automatically created in task 2, step 3. The tuple displays revenue for all products for the year 2010 and the Telephone order method.

You could have also created the tuple manually by dragging an Intersection (Tuple) object from the Toolbox tab to the report layout.

6. Close IBM Cognos Viewer, and then close Report Studio without saving the report.

7. Log off of IBM Cognos Connection.

Results: You created sets by adding items to the rows, columns, and measures drop zones in a crosstab report. You identified tuples in the report including those defined by members on both separate and the same axes. You also compared results to a tuple that you created manually.

Task 3, step 7: Do not log off of IBM Cognos Connection if you are advancing to the next module today.

Page 97: Multidimentional Authoring

INTRODUCTION TO DIMENSIONAL DATA IN REPORTS

© 2007, 2012, IBM Corporation 2-43 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Summary At the end of this module, you should be able to: work with members

identify sets and tuples in Report Studio

Page 98: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

2-44 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 99: Multidimentional Authoring

3

© 2012 IBM Corporation

Dimensional Report Context

IBM Cognos BI

Page 100: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

3-2 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 101: Multidimentional Authoring

DIMENSIONAL REPORT CONTEXT

© 2007, 2012, IBM Corporation 3-3 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Objectives At the end of this module, you should be able to: understand the purpose of report context

understand how data is affected by default and root members identify default measure and current measure

Page 102: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

3-4 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

What is Report Context?

Dimensional reports aggregate measures at different levels within hierarchies. Report context defines which measure and which

dimensional members impact the cell values of each intersection in a report.

Understanding report context helps you to understand what will happen to data in a report when you filter, drill, and summarize.

As we continue to work with dimensional functions throughout the course, it will become increasingly important that report authors understand the context of the report and each intersection calculation.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 103: Multidimentional Authoring

DIMENSIONAL REPORT CONTEXT

© 2007, 2012, IBM Corporation 3-5 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

The root member is the member at the highest level of aggregation for a particular hierarchy.

Root Member

Retailers is the root member for the Retailers hierarchy

Dimensions with multiple hierarchies may have multiple root members.

The root member of a hierarchy can be found with the function rootMembers().

The root member of a single root hierarchy can be found with the function rootMember().

genware
Highlight
genware
Highlight
Page 104: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

3-6 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Default Member

The default member is typically the root member, or in some cases can be specified by the modeler.

Time is the default member for the Time dimension

There is only one default member per hierarchy. The default member is typically the root member at the highest level in a hierarchy. Depending on what data modeling tool is used, a data modeler can define which member from a dimension will be the default member. If not done explicitly by the modeler, most data modeling tools will automatically assign the default member.

The definition for default member is not the same as for root member. Depending on the data source, multiple root members can be defined. Despite having multiple root members in a hierarchy, there can only be one default member. When would a default member be defined, other than for a member at the highest level? Example: for the Time dimension, by default you may want to only report on current month. In the Dimensional data source (for example, a cube) define the default member for the Time hierarchy in the Time dimension, as the current month (such as 2007/Jan) then generate the data source. A report author then creates a crosstab using that data source. With default member specified as the current month, consumers will only see revenue values for the current month (the default member for the Time dimension). If you need to identify the default member for a hierarchy, you can use the defaultMember function. This function takes a hierarchy as its only parameter.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 105: Multidimentional Authoring

DIMENSIONAL REPORT CONTEXT

© 2007, 2012, IBM Corporation 3-7 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

<#1234#><#1234#><#Campaign#>

<#1234#><#1234#><#Campaign#>

<#Order method type#><#Order method type#>Quantity

Default Member (cont'd)

Product brand (default member)Product brand

Retailers (default member)Retailers

Products (default member)Products

Time (default member)Time

Order method typeOrder method

CampaignPromotions

Member UsedDimension

In a dimensional query, when an item is not explicitly specified from a dimension, the default member from that dimension is implied.

In this example, Campaign and Order method type are specified in the query. All other dimensions such as Time, Products, and Retailers are not included in the query, but their default members are applied to the context of the measure values.

genware
Highlight
genware
Highlight
genware
Highlight
Page 106: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

3-8 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

44,318,886.43

881,315,747.68

79,721,524.37

107,160,284.09

2005

23,701,042.57

1,339,714,172.77

73,918,652.38

37,199,842.80

2006

55,481,936.15101,072,721.10Sales visit

1,017,434,523.30473,771,464.65Web

16,420,318.9595,402,796.21E-mail

17,832,073.81178,793,580.36Telephone

20072004Revenue

Default Member (cont'd)

There are seven order method types. Only four meet the condition. Which Time values is the

condition being tested against?

Default member (Time) values

A filter is applied to show order method types with revenue over 150,000,000

310,194,834.00

3,712,235,908.40

179,843,044.16

340,985,781.06

Total

Because the filter specifies only revenue and order method types as criteria, values will be calculated using the default member for all other dimensions.

Even though the report displays revenue by Year, the filter itself evaluates against the Time dimension default member, or the summary of all years.

genware
Highlight
genware
Highlight
Page 107: Multidimentional Authoring

DIMENSIONAL REPORT CONTEXT

© 2007, 2012, IBM Corporation 3-9 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Current Member

The current member is the member of the hierarchy returned during an iteration.

In iteration 1, the current member for the Month level is 2012/Oct, and for iteration 2, it is 2012/Nov.

1 2

605,564.36652,757.441,734,154.241,794,878.00Golf Equipment

1,992,682.582,225,443.464,966,619.847,629,536.42Camping Equipment

Revenue Previous Year

RevenueRevenue Previous Year

Revenue

2012/Nov2012/OctRevenue

During each iteration, the current member changes. In iteration 1, the member for the Month level is 2012/Oct, and for iteration 2, it is 2012/Nov.

The concept of current member is important when applying advanced calculations in a report using the currentMember function. You can use the function currentMember to return the current member of a hierarchy during iterations.

When a dimensional function expects a member, you can specify the current member by using the currentMember function.

In the slide example, the Revenue Previous Year calculation requires a month member in order to retrieve the values for the previous year. Therefore, the currentMember function is used to pass the appropriate month member during each iteration of the Time hierarchy to calculate the values

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 108: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

3-10 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

605,564.36652,757.441,734,154.241,794,878.00Golf Equipment

1,992,682.582,225,443.464,966,619.847,629,536.42Camping Equipment

ProfitRevenueProfitRevenue

2012/Nov2012/OctRevenue

Default Measure

Report Studio automatically sets the default measure when you insert a measure into the Measures drop zone of a crosstab.

Default measure

For any intersection or expression where a measure is not explicitly defined, the default measure will be used.

You implicitly set the default measure for a crosstab report when you insert a measure into the Measures drop zone. You can explicitly set the default measure of the crosstab by setting the Default Measure property in the Properties pane. To do this, you must first select the crosstab object in the work area. The measures that you can choose from must already exist in the query.

If you insert a measure on the rows or columns that is different from the one you inserted in the Measures drop zone, that measure will appear, instead of the default measure. It does not become the default measure for the crosstab.

When the current measure keyword is used in member summary expressions, and there is no other measure inserted on the rows or columns, the default measure is used to resolve the expression. If you do insert a measure on the rows or columns, the current measure used to resolve the member summary expression will be derived from the context provided by the measure you have inserted on the rows or columns.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 109: Multidimentional Authoring

DIMENSIONAL REPORT CONTEXT

© 2007, 2012, IBM Corporation 3-11 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

605,564.36652,757.441,734,154.241,794,878.00Golf Equipment

1,992,682.582,225,443.464,966,619.847,629,536.42Camping Equipment

ProfitRevenueProfitRevenue

2012/Nov2012/OctRevenue

Current Measure

The current measure is the measure returned during an iteration.

Current Measure1 2

Many measures can be used in a report. Measures can be explicitly added to an edge of a report, or used in expressions for filtering or complex calculations.

The current measure is the value returned in a cell, at the time the query iterates through and returns an intersection of given member on the rows and columns edges. For example, when the query returns the intersection of Golf Equipment, 2006/Oct, Revenue, the current measure value is 1,794,878.

genware
Highlight
genware
Highlight
Page 110: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

3-12 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Current Measure (cont'd)

141,520,649.70

174,740,819.29

4,471,025.26

443,693,449.85

352,910,329.97

2013

161,039,823.26

230,110,270.55

4,471,025.26

594,009,408.42

500,382,422.83

2012

726,411,367.89168,006,427.07153,553,850.98 Golf Equipment

409,660,132.90107,099,659.94Mountaineering Equipment

75,994,296.2525,008,574.0836,165,521.07Outdoor Protection

1,885,673,307.78456,323,355.90391,647,093.61 Personal Accessories

1,589,036,664.03402,757,573.17332,986,338.06Camping Equipment

Total for All Years20112010Revenue

The current measure is the current intersection (tuple) for the members defined on the edges during an iteration.

Current Measureaggregate(currentMeasure within set [Year])

You can use the current measure to create more complex calculations using the currentMeasure keyword.

The currentMeasure keyword is used as the first argument of member summary functions such as aggregate(currentMeasure within set [Year]).

The aggregate function uses the aggregation type defined in the source. You will use the aggregate function throughout this course. The aggregate function will be discussed in more detail in the module Calculations and Dimensional Functions.

genware
Highlight
genware
Highlight
genware
Highlight
Page 111: Multidimentional Authoring

DIMENSIONAL REPORT CONTEXT

© 2007, 2012, IBM Corporation 3-13 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 1Use the Default Measure to Create a Summarized Column in a Report

Page 112: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

3-14 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Demo 1: Use the Default Measure to Create a Summarized Column in a Report

Purpose: To have more control over the result set of your dimensional queries, you must identify the behavior of the default measure in your crosstab reports. You will create a crosstab report and identify its default measure. You will include a summary calculation on the columns that will use the default measure. You will add a measure to the columns to show that the summary calculation still uses the default measure when there is no context provided by a measure on the rows. You will move the measure from the columns to the rows and again show the behavior of the summary calculation. You will modify the default measure for the crosstab and observe the impact on the calculation.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab Task 1. Identify the default measure in a crosstab report.

1. Create a new crosstab report.

2. On the Source tab, expand the Products dimension\Products hierarchy, and drag the Product line level to the Rows drop zone.

3. On the Source tab, from the Measures dimension, drag the Revenue measure to the Measures drop zone.

4. On the Source tab, expand the Time dimension\Time hierarchy, and then drag the Year level to the Columns drop zone.

In the Properties pane, in the Data section, notice that the Default Measure property is set to Revenue. This is the default measure for the crosstab report.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 113: Multidimentional Authoring

DIMENSIONAL REPORT CONTEXT

© 2007, 2012, IBM Corporation 3-15 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 2. Summarize the rows.

1. In the report layout, click <#Year#>, on the toolbar, click Summarize , and then from the drop-down menu, click Automatic Summary.

Automatic Summary will use the aggregate function to summarize the data.

2. In the report layout, click Summary.

In the Properties pane, in the Data Item section, notice that the Aggregation Method the value is set to Aggregate, and the Name value is Summary(Year). The same result could be achieved by using the expression aggregate(currentMeasure within set [Year]).

You will run the report to identify the context for the current measure.

3. On the toolbar, click Run Report.

The report appears as shown below:

The report shows revenue values for each product line for each year and also as a total for all years in the last column. Because there is no measure provided on the rows or columns, the context for the current measure in the calculation for this column is obtained from the default measure in the crosstab, which is Revenue. You will examine what happens when you add a measure to the columns with the existing summarization.

4. Close IBM Cognos Viewer.

Page 114: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

3-16 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Add measures on the columns and then aggregate on the rows.

1. On the Source tab, from the Measures dimension, drag the Quantity measure to columns to nest as a child under <#Year#>.

You will run the report to identify the context for the current measure.

2. On the toolbar, click Run Report.

The report appears as follows:

The report shows the quantity measure values for each product line for each year. The totals shown in the last column are for revenue for each product line. The context for the current measure in the calculation for the column is still obtained from the default measure of the crosstab because no other measure context is provided on the rows. You added only a measure to the columns and not the rows.

3. Close IBM Cognos Viewer.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 115: Multidimentional Authoring

DIMENSIONAL REPORT CONTEXT

© 2007, 2012, IBM Corporation 3-17 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 4. Add measures on the rows and aggregate on rows. 1. In the report layout, drag <#Quantity#> from the columns, and drop it under

<#Product line#> on rows as a peer.

You will run the report to identify the context for the current measure.

2. On the toolbar, click Run Report.

The report appears as follows:

The last row of the report shows the Quantity measure on rows with the quantity values for each year appearing in the cells. This is quantity for all product lines.

The summary column shows totals for revenue for all rows (product lines), except for the last row where it shows a total for quantity. For the last row, the presence of the Quantity measure on the rows provides the context for the current measure in the calculation.

3. Close IBM Cognos Viewer.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 116: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

3-18 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 5. Change the default measure of the report. In the top left corner of the crosstab, notice the three orange dots. This icon will allow you to select the container with one click.

1. In the crosstab, click the Container Selector .

2. In the Properties pane in the Data section, click the Default Measure property, and then in the list, click Quantity.

3. In the report layout, click Revenue in the top left corner, and then on the

toolbar, click Cut .

You will run the report to identify the context for the current measure.

4. On the toolbar, click Run Report.

The report appears as shown below:

The summarized column now shows totals for quantity for all rows. For the first five rows (product lines), the context for the current measure in the calculation for this column is obtained from the default measure of the crosstab which is now Quantity. For the last row, the presence of the Quantity measure provides the context for the current measure in the calculation.

genware
Highlight
Page 117: Multidimentional Authoring

DIMENSIONAL REPORT CONTEXT

© 2007, 2012, IBM Corporation 3-19 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

5. Close IBM Cognos Viewer, and then close Report Studio without saving the report.

6. Log off of IBM Cognos Connection.

Results: You created a crosstab report and identified its default measure. You included a summary calculation on the columns that used the default measure. You added measures to the report columns to show that the summary calculation still used the default measure when there is no context provided by a measure on the rows. You moved the measure from the columns to the rows and again showed the behavior of the summary calculation. You modified the default measure for the crosstab and observed the impact on the calculation.

Task 5, step 6: Do not log off of IBM Cognos Connection if they are advancing to the next module today.

Page 118: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

3-20 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Summary

At the end of this module, you should be able to:

understand the purpose of report context understand how data is affected by default and

root members

identify default measure and current measure

Page 119: Multidimentional Authoring

4

© 2012 IBM Corporation

Focus Your Dimensional Data

IBM Cognos BI

Page 120: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-2 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 121: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-3 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Objectives At the end of this module, you should be able to: compare dimensional queries to relational queries

explain the importance of filtering dimensional queries evaluate different filtering techniques

filter based on dimensions and members filter based on measure values filter using a slicer

dynamically filter using a tree prompt

Participants should be familiar with basic concepts of reporting using the dimensional style and dimensional data sources. Suggested modules to reference: • Introduction to Multidimensional Concepts • Introduction to Multidimensional Data in Reports • Multidimensional Report Context

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 122: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-4 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

775,128.03Fax1 for 1 Sports shop

1,097,318.271,715,812.951,841,265.461,002,725.61Web

1,260,903.271,081,439.08Sales visit4 Golf only

1,472,511.68614,326.06586,195.45Web

135,201.76Sales visit4 Your Eyes

737,820.6Web

189,400.37250,847.75Sales visitAarhus Sport

Web

Web

Telephone

1,752,647.69

1,170,080.59

2013

2,613,580.91

2,506,561.08

2012

1,711,149.2Accapamento

1,025,420.15712,494.7

145,102.25

20112010Revenue

How do Relational Data Sources Behave?

Relational models return a result based on relationship cardinality between items in the query.

3 out of 7

1 out of 7

2 out of 7 order

methods are

returned

Queries run against relational data sources return data based on relationship cardinality. Depending on the cardinality, if there are no matching records between the queried tables, rows may or may not be returned. Typically, the relationships are modeled with a cardinality of 1..n (inner join), so only matching records are returned.

The data source for the report in the slide example is the GO Data Warehouse (query) package.

Page 123: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-5 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Mail

E-mail

Telephone4 Golf only

1,260,903.271,081,439.08Sales visit

1,472,511.68614,326.06586,195.45Web

Special

Fax

Telephone4 Your Eyes

135,201.76Sales visit

737,820.6Web

Special

Mail

E-mail

Fax

Telephone1 for 1 Sports shop

Sales visit

1,097,318.271,715,812.951,841,265.461,002,725.61Web

Special

Mail

E-mail

775,128.03Fax

2013201220112010Revenue

How do Dimensional Data Sources Behave?

All order methods are returned for

each instance of a retailer

Typically, queries run against dimensional data sources return all members whether they have measure values or not. When there is nesting in a crosstab or chart, all members are returned for each level of nesting. This is true whether the levels of nesting are from the same dimension or from another dimension.

Large dimensional structures without proper filtering can lead to large, inefficient reports.

In the screen capture, the data source for the dimensional report is the sample Sales and Marketing (cube) package. Students may ask why the sorting of the data in the report is not the same as the report on the previous slide. This is because the sort order for the cube is different from what is defined in the relational source. For presentation and comparison purposes, we have sorted the first column (Retailer name) in this report, to return the same order that was achieved in the report on the previous slide. The behavior of nested levels differs as follows: nested levels from different dimensions: results are as seen in slide with cross products shown in slide. Each order

method is displayed for each retailer. nested levels from the same dimensions: members displayed will reflect the actual parent-descendant relationships.

If you nest Product type in Product line, Tents will only be shown in Camping Equipment; no cross products are displayed.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 124: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-6 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Mail

Fax

614,326.061,472,511.68586,195.45Web4 Golf only

E-mail

Telephone

1,260,903.271,081,439.08Sales visit

Special

737,820.6Web4 Your Eyes

E-mail

Telephone

135,201.76Sales visit

Mail

Fax

Special

1,715,812.951,002,725.611,097,318.271,841,265.46Web1 for 1 Sports shop

E-mail

Telephone

Sales visit

Mail

775,128.03Fax

Special

2012201020132011Revenue

DMR - Relational or Dimensional?

All order methods are returned for each

instance of a retailer. Why?

To identify when a query against a DMR model returns all members and when it does not, you need to understand the behavior of DMR models.

The underlying data source for a DMR model is relational. At run time, a relational query is processed and the result is based on the relationship cardinality of the queried items. At run time, the IBM Cognos BI server generates a temporary cube to return the dimensional structure. To build the dimensional structure of the cube, the resulting values of the relational query are used to generate the required members.

If there are no combinations of values returned from the relational query, then the rows are dropped and the members are not generated when building the cube.

In the screen capture, the data source for the DMR report is the sample Go Data Warehouse (analysis) model. To explain why members are sometimes returned, you can use the slide example. As soon as one instance of a retailer, order method, year, and a measure value is returned by the relational query, the values are used to generate the members for building the temporary cube. Alternately, if there was no revenue for Fax in any year for any retailer, the Fax rows would be eliminated from the report. In other words, the resulting cube structure is presented in the crosstab rows and columns, based on the members that are generated from the query.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 125: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-7 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Create Efficient Dimensional Queries

Filter dimensional queries to:

avoid large, slow reports condense blank data for easier viewing

When designing filters:

use dimensional filtering techniques, not relational use a building block approach

develop against realistic data volumes and data distribution

The key to creating efficient queries is to limit, or filter, the number of items examined in the data source, while still meeting the report requirements. The goal of any filter operation is to ensure that the user gets the desired data without impacting performance.

Use a building block approach to author your reports. Add one data item at a time, filter that item down to the smallest number of members, and then test the report before proceeding to the next data item. By using a building block approach, you ensure that your report is not unnecessarily large at any stage, thereby reducing intermediate testing times, resource consumption, and the possibility of failures. Your motto should be "Filter Early, Filter Often". Develop your reports using data sources with realistic data volumes and data distribution. Reports that run quickly in the development environment may exhibit poor performance in the production environment when run against large data volumes. Often a snapshot of production data (or sterilized data) can be used to ensure an equitable development environment. If it is not possible or practical to make production data volumes available in the development environment, then you should perform performance and final tests in the production environment prior to declaring the report ready for production.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 126: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-8 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Filtering Techniques

Relational filtering techniques:

detail filters summary filters

Dimensional filtering techniques:

dimensional objects, set definitions, and expressions to specify members filter() function

slicers

The main ways to restrict data in dimensional queries are through set definitions and expressions that contain dimensional functions, and through slicers. These techniques are part of the dimensional style of report authoring.

It is not recommended to use relational style filters with OLAP data sources. With DMR data sources, use caution when applying relational style filters; this combination should only be used by advanced report authors who have an understanding of the behavior.

The reporting that you do with dimensional data sources is considered as a form of filtering. For example, if you use only the Camping Equipment member in your report, you have already filtered results to only include Camping Equipment member. There are certain scenarios where relational filters, when applied to dimensional data, do not return expected results and may result in poor performance. For example, relational filters applied to measure values, in reports that contain complex dimensional expressions, or that mix members from different levels as a result of nesting. These scenarios are of concern because at runtime the relational filters trigger re-aggregation that could cause the values to change.

genware
Highlight
genware
Highlight
Page 127: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-9 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Use Dimensional Objects and Expressions

Use dimensional objects such as:

hierarchies levels individual members

Use expressions containing dimensional functions such as: set(), children(), descendants()

except() topCount(), bottomCount(), topPercent(),

bottomPercent()

Use dimensional objects directly from the data tree to determine what will be returned by a dimensional query.

Because dimensional functions such as set, children, descendants, and except provide a greater degree of control over what is returned by a dimensional query, they are often used in more complex calculations which return a specific set of members. You can also modify a set definition of a base set for results like exclude, top and bottom count and percent.

Refer to Module 5: Focus Your Dimensional Data, page 4, for more dimensional functions.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 128: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-10 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

The except() Function

except([sales_and_marketing].[Order method].[Order method].[Order method type], set([Mail],[E-mail], [Fax]))

All order method types except those defined in the

second set expression.

except(set_expression1, set_expression2 [,all])

17846021230541311750732310050830Web

982938141146817789412640065Sales visit

30730

336381

2013

13622

684667

2012

252429340021Special

22518983979898Telephone

20112010Quantity

Alternatively, use Set Definition to exclude members.

Use the except() function to exclude a set of members from a defined set. This function returns the members of the first set expression that are not in the second set expression.

The example in the slide displays order method types that are typically handled on an individual person-to-person contact such as telephone and sales visits, and excludes order method types that can be handled through bulk processing such as mail and fax.

Use the syntax provided in the callout to describe how the except() function behaves. A common use of except() is to combine it with the topCount or bottomCount functions. For example, you want to return the top two [Product type]’s sold in conjunction with the members that are not part of the top two [Product type]’s sold. An example of this can be found in the module Calculations and Dimensional Functions (Module 5, Demo 1). When creating a new set by combining sets (the except(), union(), and intersect() functions do this), use of the ALL argument will always keep duplicates in the resulting set. If the optional keyword ALL is supplied as the third argument, duplicates are retained. For example, if set A includes (w,x,y,x,y,z) and set B includes (w,x), then union(A,B) returns (w,x,y,z) but union(A,B, All) returns (w,x,y,x,y,z,w,x). Intersect(A,B) returns (w,x) but intersect(A,B, All) returns (w,x,x). Finally, to return to the except function: except(A,B) returns (y,z) but except(A,B, All) returns (y,y,z).

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 129: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-11 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 1Focus Your Report by Excluding Members of a Defined Set

Page 130: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-12 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Demo 1: Focus Your Report by Excluding Members of a Defined Set

Purpose: You want to create a report to compare the performance of product line sales when they are on promotion. Since the promotions dimension includes a category for Regular Sale, you will exclude that member from your report.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create an unfiltered report comparing product sales across time.

1. Create a new crosstab report.

2. From the Source tab, expand the Time dimension\Time hierarchy, and drag the Year level to the Columns drop zone.

3. Expand the Products dimension\Products hierarchy, and drag the Product line level to the Rows drop zone.

4. Expand the Promotions dimension\Promotions hierarchy, and drag the Campaign level to the right of <#Product line#> in the Rows drop zone to nest as a child.

5. From the Measures dimension, add the Revenue measure to the Measures drop zone.

Page 131: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-13 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

6. In the report layout, click <#Campaign#>, on the toolbar click Summarize, and then select Automatic Summary from the drop-down menu.

7. On the toolbar click Run Report.

A section of the report appears as follows:

The report displays the revenues for each product line and each different promotional campaign. The summary row aggregates all revenues for the product line including the regular sale revenues.

You want to modify the Summary label to identify what is being summarized in the report.

8. Close IBM Cognos Viewer, and then in the report layout, click Summary.

9. In the Properties pane, under Data Item, notice that the Name value is Summary(Campaign).

You will modify the label to clearly identify that all campaigns are included in this summary.

10. Click Label, change the property to Summary(All Campaigns), and then press Enter.

Page 132: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-14 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 2. Exclude the campaign type Regular Sale for the default measure.

1. From the Source tab, drag Campaign level above <#Campaign#> in the report layout.

This new set definition displays as <#Campaign1#>, because there is an existing set definition based on this level in the crosstab.

2. Right-click <#Campaign1#>, and then click Edit Set.

You will exclude a member from this set definition.

3. In the Set Definition dialog box, click New , and then click Exclude.

4. In the Available members pane, expand Promotions, click Regular sale, click the green right arrow to add it to the Members pane, and then click OK.

The set definition graphically displays that there is an exclusion applied to the base set. If you hover the mouse cursor over Exclude, the excluded member(s) will display in a tooltip.

5. Click OK to close the Set Definition dialog box.

Instead of creating a new set definition, you could have also used the except() function to create the following expression in a query calculation in the crosstab:

except([sales_and_marketing].[Promotions].[Promotions].[Campaign], set ([Regular sale]))

Because you have the summary row for all campaigns in the crosstab, you no longer require the detailed rows for all campaigns.

6. In the report layout, click <#Campaign#>, and then on the toolbar, click Delete.

You will rename the Campaign1 set definition to clearly identify the campaigns in this customized set.

Task 2, step 5: The except() function does not need the single [Regular Sale] member to be included in a set function. A member is recognized as a set composed of one member only. Students could use the expression except([sales_and_marketing].[Promotions].[Promotions].[Campaign], [Regular sale]) and achieve the same results.

Page 133: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-15 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

7. Click <#Campaign1#>, in the Properties pane, in the Data Item section, click Name, change the property to Promotional Campaigns, and then press Enter.

8. In the report layout, click <#Promotional Campaigns#>, click the Summarize button, and then select Automatic Summary from the drop-down menu.

9. To rename this summary to be more meaningful, click Summary, in the Properties pane, in the Data Item section, click Label, change the property to Summary(Promotional Campaigns), and then press Enter.

10. On the toolbar click Run Report.

A section of the report appears as follows:

The report now shows all promotional campaigns, excluding regular sales. The two summary rows compare the aggregation of promotional campaigns to the aggregation of all campaigns.

11. Close IBM Cognos Viewer.

Results: You have created a report that shows you revenues for product lines for all promotional campaigns except Regular sales.

Page 134: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-16 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

topCount() and bottomCount()

topCount([sales_and_marketing].[Products].[Products].[Product line], 2, [Revenue])

Only the top two Product lines are returned.

topCount(set_expression, index_expression, numeric_expression)

273011491,589,036,664.03Camping Equipment

349077051,885,673,307.78Personal Accessories

QuantityRevenueQuantity

Alternatively, use Set Definition to define top or bottom count.

The topCount() function sorts a set according to the cell values of a specified measure and returns the top specified number of members.

For the example above, the topCount() function returns the top two revenue-generating product lines.

genware
Highlight
Page 135: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-17 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

topPercent() and bottomPercent()

bottomPercent([sales_and_marketing].[Products].[Products].[Product type], 3, tuple([2006],[Planned Revenue]))

bottomPercent(set_expression, numeric_expression1, numeric_expression2)

Only the product types in the bottom 3% planned revenue

for 2006 are returned.

2,006,172.663,342,648.85Sunscreen

3,457,024.635,217,019.63Insect Repellents

10,066,864.5916,184,834.94Golf Accessories

2006Planned revenue

12,287,850.5932,716,937.10Safety

923,995.661,789,507.36First Aid

Planned RevenueRevenue

Alternatively, use Set Definition to define top or bottom percent.

The bottomPercent() function sorts the second numeric expression for the corresponding member of a set expression, and picks up the bottommost elements whose cumulative total is equal to or less than the first numeric expression percent of the total.

For the example above, the bottomPercent() function returns the bottom product types by planned revenue in 2006, whose total contributes 3 % of the total for all product types.

genware
Highlight
Page 136: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-18 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 2Create a Crosstab Report Showing the Top Two Retailers

Page 137: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-19 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 2: Create a Crosstab Report Showing the Top Two Retailers

Purpose: A request was made for a top two Retailers by revenue report. Users want to see the top two retailers by revenue in 2012, their total revenue, the total quantity sold, and profit margin for 2012. They also want to see the total revenue for all years.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create a crosstab report. 1. Add the following query items to a new crosstab:

Columns area: Time dimension\Time hierarchy\Year level\Members folder\2012 Time dimension\Time hierarchy\Members folder\Time (to the right

of <#2012#>, as a peer) Rows area: Retailers dimension\Retailers hierarchy\Retailer name level

Measures area:

Measures dimension\Revenue measure

Task 1, Step 1:Throughout the course, when working with members, you may switch between the metadata tree view and the members tree view to populate report objects like crosstabs and charts with members.

Page 138: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-20 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

2. From the Source tab\Measures dimension, click Revenue, Ctrl+click Quantity and Profit Margin, and then drag them below <#2012#> in the report layout, as nested items.

The results appear as follows:

Task 2. Determine the top two count. 1. In the crosstab, right-click <#Retailer name#>, and then click Edit Set.

2. In the Set Definition dialog box, click New, and then click Top.

3. In the Top or Bottom dialog box, in the Count box type 2.

4. In the Based on intersection (tuple) box, click the ellipsis .

5. In the Available members and measures pane, expand Time folder\Time node, click the 2012 member and then click the green right arrow to add it to the Intersection members and measures pane.

6. Repeat step 5 to add Measures\Revenue to the Intersection members and measures pane, and then click OK to close the Members dialog box.

The Top or Bottom dialog box indicates that you want a top two count of items based on the tuple (2012, Revenue).

Page 139: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-21 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

7. Click OK to close the Top or Bottom dialog box.

The Set Definition dialog box indicates that for the set based on the level Retailer name, there is a top 2 count applied.

Instead of creating a set definition, you could have also used topCount() and tuple() to create the following expression in a query calculation in the crosstab:

topCount ([sales_and_marketing].[Retailers].[Retailers].[Retailer name], 2, tuple([2012],[Revenue]))

8. Click OK to close the Set Definition dialog box, and then from the toolbar, click Run Report.

The results appear as follows:

Only the top two retailers for 2012 are returned.

9. Close IBM Cognos Viewer.

Results: You used the top count set definition functionality to create a crosstab report that returns the top two retailers for 2012, their revenue, quantity, profit margin, and their all-time revenue total.

genware
Highlight
genware
Highlight
Page 140: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-22 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Determine which members are returned by the query by testing the values of a measure.

The most common options for filtering on measure values are: filter() function or set definition filter (dimensional

style)

detail filters (relational style)

Filter Based on Measure Values

Both options filter data but they behave in different ways based on the dimensional structure of reports. They should be used appropriately to return the desired data with little performance degradation.

There is potential for performance degradation when running complex dimensional reports against dimensional data sources, and relational filters are used to filter measure values,. For example, if there are multiple levels of nesting, or if there are many expressions that contain dimensional functions.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 141: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-23 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

44,318,886.43

881,315,747.68

79,721,524.37

107,160,284.09

2005

23,701,042.57

1,339,714,172.77

73,918,652.38

37,199,842.80

2006

55,481,936.15101,072,721.10Sales visit

1,017,434,523.30473,771,464.65Web

16,420,318.9595,402,796.21E-mail

17,832,073.81178,793,580.36Telephone

20072004Revenue

The filter() Functionfilter(set_expression, boolean_expression)

filter([sales_and_marketing].[Order method].[Order method].[Order method type], [Revenue]>150000000)

There are seven order method types. Only four meet the condition.

This condition is being tested against which values?

Default member values

310,194,834.00

3,712,235,908.40

179,843,044.16

Total

340,985,781.06

Alternatively, use Set Definition to define a filter.

Use the filter() function to reduce the number of members on an edge by testing cell values. The filter() function returns the set of members of a specified set which fulfill the boolean condition.

In the slide example, the expression returns the order methods whose revenue for the total of all time exceeds 150,000,000.

The cell values that are evaluated can be further controlled by nesting dimensional functions, such as the tuple() function, in the Boolean condition of the expression.

The measures being tested by the filter expression are in fact the values for the default member of the Time hierarchy. In this case the default member is Time which is a roll up for all years in the data source. This may not always be the case, so report authors should be aware of what the default member is. See the module Multidimensional Report Context for more information on the default member.

genware
Highlight
Page 142: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-24 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Detail Filters

[Revenue]> 150000000

No value is returned for Telephone in the years 2011, 2012, and 2013 because Telephone based revenue was less than 150,000,000 duringthose years.

Only two order method types

meet the condition.

881,315,747.68

2011

1,339,714,172.77

2012

1,017,434,523.30473,771,464.65Web

178,793,580.36Telephone

20132010Revenue

Detail and summary filters are the relational style approach to filtering.

A detail filter is applied to the details of the report using the set of members at the lowest level on both the columns and rows edges as context. The condition of a detail filter is applied to the measure value within each individual cell.

If a value does not meet the condition it is removed. If all the values are removed for an entire row, the row is not returned.

Only two order method types are returned. The other five (there are seven order method types in this data set) are not returned because their detail values, for all columns, do not meet the criteria and are removed. Conversely if there were values removed for an entire column, the column would not appear.

genware
Highlight
genware
Highlight
Page 143: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-25 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 3Compare the Use of the filter() Function to a Detail Filter

Page 144: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-26 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Demo 3: Compare the Use of the filter() Function to a Detail Filter

Purpose: To understand the differences between the behavior of the filter function and the relational style detail filter when they are applied to dimensional data, you will create a crosstab report and apply the filter function two different ways on edge expressions and then apply a detail filter to the same report. You will identify the result sets and the performance characteristics in each scenario.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create an unfiltered report. 1. Add the following query items to a new crosstab:

Columns area: Time dimension\Time hierarchy\Year level

Rows area: Products dimension\Products hierarchy\Product level Order method dimension\Order method hierarchy\Order method

type level (to the right of <#Product#> nested as a child) Promotions dimension\Promotions hierarchy\Campaign level (to the

right of <#Order method type#> nested as a child) Measures area:

Measures dimension\Revenue measure

While you could use set definition in this demo, to have more control over changing the expression of the function in this demo, you will use query calculations.

Page 145: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-27 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

2. On the toolbar, click the Run Report list, click Run Report - PDF.

This report may take an exceptionally long time to run.

A section of the report appears as follows:

This report is 285 pages long and contains 11,088 rows. Using the first page as an example, the report contains many null values for Revenue. For each product, all promotional campaigns for all order methods are shown, regardless of whether there is any revenue.

3. Close IBM Cognos Viewer.

You want to filter the campaigns to only show those with revenue values that are not null. You will use the filter function to accomplish this.

Page 146: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-28 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 2. Apply the filter function to filter out nulls. 1. In the report layout, click <#Campaign#>, and then on the toolbar, click

Delete.

You will replace it with a query calculation.

2. From the Toolbox tab, drag a Query Calculation to the right of <#Order method type#>, click the Set expression radio button, from the Hierarchy list, click the Promotions hierarchy, and then in the Name text box, type Non-null Campaigns.

3. Click OK.

4. Create and validate the following expression:

filter ([sales_and_marketing].[Promotions].[Promotions].[Campaign], [Revenue]<>null)

Hints:

Available Components pane\Source tab: Promotions dimension\Promotions hierarchy\Campaign level

Available Components pane\Data Items tab: Revenue

Task 2, Step 2: While you could leave the Hierarchy setting as Automatic, if you know the hierarchy you want to use, it is best to declare it.

Page 147: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-29 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

5. Click OK to close the Set Expression dialog box, and then on the toolbar, click Run Report.

The report runs in PDF again, but this time more quickly.

A section of the report appears as follows:

This report is only 34 pages long. Rows that contain all null values have been filtered. Only campaigns that have generated revenue for a product for at least one of the years are shown.

Page 148: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-30 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

In the Time dimension, this filter is evaluated against the default member's values, in this case the Time member which is a rollup of all years. In fact, the filter evaluates against the default member of all dimensions not explicitly mentioned. The filter evaluates revenue for each Campaign, rolled up for all Time, all Retailers, and so on.

You will now alter the Revenue measure and the filter function on Retailer name to evaluate the individual cell values. In other words, create a filter using the dimensional style of authoring.

6. Close IBM Cognos Viewer.

Task 3. Create a detail filter to filter out nulls. 1. In the report layout, right-click <Non-null Campaigns>, click Edit Set, and

then in the Set Definition dialog box, double-click Set Expression .

2. In the Set Expression box, delete the filter function that was applied in Task 2.

3. Create and validate the following expression:

[sales_and_marketing].[Promotions].[Promotions].[Campaign]

Hints:

Available Components pane\Source tab: Promotions dimension\Promotions hierarchy\Campaign level

This removes the filter function that is applied to the edge expression for the rows.

genware
Highlight
Page 149: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-31 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

4. Click OK to close the Set Expression dialog box, and then click OK to close the Set Definition dialog box.

You will now create a detail filter using the relational style to achieve the same result as in Task 2. Detail filters in the relational style typically present no issues for zero suppression but are not recommended for threshold filters.

5. On the toolbar, click Filters , and then click Edit Filters.

6. In the Filters dialog box, click Add , in the Create Filter dialog box, click Advanced, and then click OK.

Create and validate the following expression:

[Revenue]<>null

Hints:

Available Components pane\Data Items tab: Revenue 7. Click OK to close the Detail Filter Expression dialog box, and then click OK

to close the Filters dialog box.

8. On the toolbar, click Run Report.

The report contains the same results as the report run in Task 2, Step 4. It is 34 pages long and the null values have been filtered. For each product, only campaigns and order methods with revenue for at least one of the years are shown.

The detail filter affects lowest level items on both the crosstab rows and columns (Campaign and Year). Each individual cell is evaluated rather than the overall totals for Year. The initial filter function you created only evaluated the totals for row items (Campaign).

To this point there is no significant difference between using the filter function and a relational style detail filter, but you will see the difference in the following two tasks.

9. Close IBM Cognos Viewer.

genware
Highlight
genware
Highlight
genware
Highlight
Page 150: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-32 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 4. Nest an additional set on the rows edge and filter on details.

1. From the Source tab, expand the Retailers dimension\Retailers hierarchy, and then drag the Region level to the right of <Non-null Campaigns> on the rows.

The detail filter is still applied.

2. On the toolbar, click Run Reports.

The report might take quite a while to run.

A section of the report appears as follows:

This report is 181 pages long, and there are no rows with all null values, indicating that the detail filter is working.

3. Close IBM Cognos Viewer.

Page 151: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-33 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 5. Use the filter function to attempt the same report. 1. On the toolbar, click Filters, click Edit Filters, click the [Revenue]<>null

filter, and then under Usage, click Disabled.

2. Click OK, right-click <Non-null Campaigns> in the rows of the report layout, click Edit Set, and then double-click Set Expression.

3. Create and validate the following expression:

filter ([sales_and_marketing].[Promotions].[Promotions].[Campaign], [Revenue]<>null)

Hints:

Available Components pane\Data Items tab: Revenue 4. Click OK to close the Set Expression dialog box, and then click OK to close

the Set Definition dialog box.

Page 152: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-34 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. On the toolbar, click Run Report.

A section of the report appears as follows:

The report is 226 pages long. It ran faster than the one in the previous task, even though it is longer. This is because the detail filter, applied in the previous task, affects the lowest level item intersections of Region and Year. The intermediate result set that returns products, order methods, and campaigns must still be created to test against those intersection values (details).

Although the report performs well, there are rows that contain all null values. This is because the filter function is applied only to the Campaign level and not to the Region level.

6. Close IBM Cognos Viewer.

Page 153: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-35 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 6. Use another filter function to filter on a nested set. 1. In the report layout, click <#Region#>, and then on the toolbar, click Delete

to remove it from the report.

2. From the Toolbox tab, drag a Query Calculation to the right of <#Order method type#>, click the Set expression radio button, from the Hierarchy list, click the Retailers hierarchy, and then in the Name text box, type Non-null Regions.

3. Click OK.

4. Create and validate the following expression:

filter ([sales_and_marketing].[Retailers].[Retailers].[Region], [Revenue]<>null)

Hints:

Available Components pane\Source tab: Retailers dimension\Retailers hierarchy\Region level

Available Components pane\Data Items tab: Revenue

Page 154: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-36 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. Click OK to close the Set Expression dialog box, and then on the toolbar, click Run Report.

A section of the report appears as follows:

The report is returned quickly, is 162 pages long, and rows with all null values have been removed.

The filter function is not required on the higher levels in the nesting, but is recommended for more efficient zero suppression queries. The filter function on Campaign could be removed and the report would run with the same results. However, if it is left in and if the condition at the higher level is not met, then the lower level does not need to be evaluated, thereby saving processing time. This is only valid for zero suppression filters. For threshold filters such as [Revenue]>1000000, the filter should only be applied at the level you are trying to evaluate.

This demo is about filtering, and happens to filter null values in its examples. In IBM Cognos BI (v10.2), zero suppression is available in the product UI. This demo is about using the filter function vs. using a detail filter, but zero suppression is yet another way that you could have achieved the same results quickly with another method (the UI toolbar).

genware
Highlight
Page 155: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-37 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

6. Close IBM Cognos Viewer.

Results: You created a crosstab report, and then applied the filter function on the edge expressions. You also applied the relational style detail filter to the same report. You identified the result sets and the performance characteristics in each scenario.

Page 156: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-38 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Slicers

A slicer:

provides context to intersection values affects the values of the cells of the report but

not the rows or columns

uses an expression that returns a set of members from the same dimension

You can create multiple slicers if you need to filter across two or more dimensions.

You cannot create two slicers for the same dimension.

Slicers require a dimensional model and cannot be used without one. This is because they are member set expressions which are a dimensional structure.

There are certain scenarios where a slicer does affect the rows or columns. For example, if you use a topCount function to return a set of members, the slicer provides context to what is evaluated as the top members of a set.

A practical use of slicing on the same dimension might be if you include a root member of a dimension, such as Order Method in the report, and then create a dynamic slicer (that includes the Order Method level in the expression) that prompts the user to choose an order method from a list of order methods.

If you have used PowerPlay or Analysis Studio then you have already used a slicer – in PowerPlay it is called the dimension bar and in Analysis Studio it is called the context. Analysis Studio even uses a slicer to implement the context. If you were to create an analysis with a context in Analysis Studio and bring it into Report Studio, you can see the slicer that Analysis Studio generated.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 157: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-39 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Slicer Example

Create a slicer containing the 2005 member.2011

France

Germany

United Kingdom

All Countries

Tents

Stoves

Golf

All P

roducts

20122011

France

Germany

United Kingdom

All Countries

Tents

Stoves

Golf

All P

roducts

All Years2010

If we use the example of a cube as an OLAP data source, we can see that the height of the cube corresponds to the rows, the width corresponds to the columns, and the depth corresponds to the slice.

You can use either the slicer pane in the query, or the context filter pane in the report page to slice the data.

genware
Highlight
genware
Highlight
genware
Highlight
Page 158: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-40 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 4Filter Dimensional Data Using Slicers

Page 159: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-41 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 4: Filter Dimensional Data Using Slicers

Purpose: You will create slicers to filter the rollup values of the measures that appear in the cells of a crosstab report. You will create a simple slicer using a single member and a more complex slicer using the set function to slice on multiple members. Both of these slice on a dimension that is not referenced on the columns or rows edge. You will then modify the slicer to slice on a dimension that does exist on the columns edge.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create a simple slicer. 1. Add the following query items to a new crosstab:

Rows area :Products dimension\Products hierarchy\Product type level

Columns area: Order method dimension\Order method hierarchy\Order method

type level Measures area:

Measures dimension\Quantity measure

genware
Highlight
genware
Highlight
Page 160: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-42 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

2. On the toolbar, click the Run Report list, click Run Report - HTML.

A section of the report appears as follows:

The report shows quantities for all product types for all order methods for all years. You want to filter the report to show quantities for all product types for all order methods for only the year 2011. You will create a slicer to do this.

3. Close IBM Cognos Viewer.

4. On the Explorer bar, point to Query Explorer, and then under Queries click Query1.

5. From the Source tab, expand the Time dimension\Time hierarchy\Year level\Members folder, and then drag the 2011 member to the Slicer pane.

6. On the toolbar, click Run Report.

A section of the report appears as follows:

The product type and order method row and column edges are not affected, but the quantity sold values now reflect only the year 2011.

You will now modify the slicer by adding an additional member from the same dimension. You will use the set function inside the slicer to accomplish this. This will add an additional year of data to the report.

7. Close IBM Cognos Viewer.

Page 161: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-43 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 2. Create a slicer using the set function. 1. In the Slicer pane, double-click [2011].

2. Create and validate the following expression:

set([2011],[2012])

Hints:

From the Source tab: Time dimension\Time hierarchy\Year level\Members folder\2011and 2012 member

3. Click OK to close the Slicer Member Expression dialog box, and then on the toolbar, click Run Report.

A section of the report appears as follows:

The product type and order method row and column edges are not affected, but the quantity sold values now reflect the years 2011 and 2012.

You have created a slicer using the set function, which uses members from the same dimension. You will now examine the result when you add an additional slicer that uses members from a dimension that appears on the columns or rows edge.

4. Close IBM Cognos Viewer.

Page 162: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-44 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Create a compound slicer that uses members from a dimension that appears on the columns edge.

1. In Query Explorer, from the Toolbox tab, drag a Slicer Member Set to the Slicer pane.

2. Create and validate the following expression:

set([Fax],[Telephone],[Mail])

Hints:

From the Source tab, expand the Order method dimension\Order method hierarchy\Order Method type level\Members folder, click Fax, Ctrl+click Telephone, and Mail, drag the items to the Expression Definition.

3. Click OK to close the Slicer Member Expression dialog box.

The slicer populates the pane.

4. On the toolbar, click Run Report.

A section of the report appears as follows:

The row and column edges are not affected by the slicer. The slicer filters the cell data only, returning null values where there is no matching member on the edge.

5. Close IBM Cognos Viewer.

Results: You created slicers to filter the rollup values of the measures that appear in the cells of a crosstab report.

genware
Highlight
Page 163: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-45 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Prompt for Dimensional Data

edge and slicer expressions

multiselectset ([level or hierarchy]-> ?p?)Dimensional

edge and slicer expressions

single select[level or hierarchy]-> ?p?Dimensional

detail and summary filter expressions only

multiselect [data item] in ?p?Relational

detail and summary filter expressions only

single select[data item] = ?p?Relational

Where to use syntaxPrompt ReturnedSyntaxStyle

p represents <prompt name>

You can add prompts to assist users in filtering dimensional data.

You can add prompt pages to a report. Each prompt page can contain one or more prompt controls, such as a value prompt or a date prompt. You can configure the prompt appearance and behavior by setting their properties.

In the case of SAP BW, if variables are defined in the BEx query, IBM Cognos BI will automatically generate the appropriate prompt type for the SAP BW variable. SAP BW variables can be included on a prompt page if you use generated prompts.

As an example of changing a prompt control behavior, you can configure a value prompt as a drop-down list or a radio button group.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 164: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-46 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

32,914,074.6745,151,584.0635,916,138.5930,715,630.22Brazil

32,001,318.48

78,692,359.03

2011

40,026,308.86

101,900,270.64

2012

29,528,025.1316,640,047.83Belgium

76,540,904.1562,519,525.96Canada

20132010Planned revenue

Tree Prompts

Tree prompts only work with dimensional data.

The tree prompt returns a set of members from one or more levels within a single hierarchy.

The parameter expression that you create must reference a hierarchy.

Keep in mind to choose the appropriate prompt control. If you want to prompt for members of a single level, a tree prompt could be used, but a value prompt is a more appropriate choice.

For example, it makes no sense to filter the Product line level based on Product type members. However, it does make sense to filter Products based on any selections from Product line, Product type or Product name. Therefore, the tree prompt is used to filter against a hierarchy.

Participants should be familiar with other types of prompts from IBM Cognos Report Studio: Author Professional Reports Fundamentals (v10.2).

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 165: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-47 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 5Focus Your Data Using a Tree Prompt

Page 166: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-48 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Demo 5: Focus Your Data Using a Tree Prompt

Purpose: You will create a crosstab report that includes a tree prompt. Users will be able to select members from within the Retailers hierarchy so that they see planned revenue for each year for the members they select. You will then modify the prompt to control where users can begin navigating the hierarchy.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create an unfiltered report using a hierarchy. 1. Add the following query items to a new crosstab:

Columns area: Time dimension\Time hierarchy\Year level

Rows area: Retailers dimension\Retailers hierarchy, (In the Insert Hierarchy

dialog box, click All members, and then click OK.) Measures area:

Measures dimension\Planned revenue

Page 167: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-49 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

2. On the toolbar, click Run Report.

A section of the report appears as follows:

The rows edge of the report shows the entire Retailers hierarchy. You want to prompt users to select members from this hierarchy.

3. Close IBM Cognos Viewer.

Task 2. Filter the report using a tree prompt. 1. In the report layout, click <#Retailers#>, and then from the toolbar, click

Delete.

2. From the Toolbox tab, drag a Query Calculation object to the Rows drop zone.

3. In the Name box, type Selected Retailers, click Set expression, from the Hierarchy drop-down list, click Retailers hierarchy, and then click OK.

Page 168: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-50 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

4. Create and validate the following expression:

Validate by selecting the Retailers check box.

set ([sales_and_marketing].[Retailers].[Retailers]->?Retailer?)

Hints:

Available Components pane\Source tab: Retailers dimension\Retailers hierarchy

5. Click OK to close the Prompt dialog box.

There are no errors in the expression.

6. Click OK to close the Set Expression dialog box.

7. On the toolbar, click, Run Report.

A report appears with a tree prompt. A tree prompt is generated automatically because Report Studio has identified that you are using a hierarchy in the expression that is used to build the rows of the report.

8. Click the Deselect all link to clear all check boxes, and then expand Retailers, expand Americas, and then expand Central Europe.

Notice the check boxes that are available, allowing you to select multiple members from the hierarchy.

9. Under Americas, select the Mexico check box, under Central Europe, select the Belgium check box, and then click OK.

The results appear as follows:

The report is filtered based on your selections.

You want to modify the prompt so that users can only select from the hierarchy at a particular level and any lower levels.

10. Close IBM Cognos Viewer.

Task 2, Step 8: It is best practice to deselect all; otherwise the previously selected items may be cached when the prompt is re-run in the same browser session.

Page 169: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-51 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Control where users can begin navigating the hierarchy.

1. On the Explorer bar, point to Page Explorer, and then click Prompt Pages.

2. From the Toolbox tab, drag a Page object to the Prompt Pages pane, and then double-click Prompt Page1.

3. From the Toolbox tab, drag a Tree Prompt object to the work area.

4. Click Use existing parameter, in the list click Retailer, and then click Next.

5. Ensure that the Create new query check box is selected, and then click Finish.

6. Point to Query Explorer, and then under Queries click Query2.

7. In the Data Items pane, double-click Retailers , and then delete the expression that appears in the Expression Definition box.

You will replace this expression with the appropriate member lower in the hierarchy so that the prompt shows only the member as the starting point for the user.

8. On the Source tab, expand the Retailers dimension\Retailers hierarchy\Region level\Members folder.

9. Drag the Northern Europe member to the Expression Definition box, validate the expression to ensure there are no errors, and then click OK to close the Data Item Expression dialog box.

Report Studio has generated a new data item in Query2 called Northern Europe because this member is referenced in the expression for the Retailers data item.

10. On the toolbar, click Run Report.

The Northern Europe member appears as the first item in the tree. To select members that satisfy the prompt, you are forced to begin your navigation at this member.

11. Click Deselect all, and then expand Northern Europe, Sweden, and Netherlands.

Task 3, Step 11: It is best practice to deselect all; otherwise the previously selected items may be cached when the prompt is re-run in the same browser session.

Page 170: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-52 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

12. Under Netherlands select the Extra Sport check box, under Sweden select the Sport Jonas check box, and then click Finish.

The results appear as follows:

13. Close IBM Cognos Viewer.

Results: You created a crosstab report that prompts users to select members from within the Retailers hierarchy so that they can see planned revenue for each year for the members that they select. You modified the prompt to control where users can begin navigating the hierarchy.

Page 171: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-53 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Summary At the end of this module, you should be able to: compare dimensional queries to relational queries

explain the importance of filtering dimensional queries evaluate different filtering techniques

filter based on dimensions and members filter based on measure values filter using a slicer

dynamically filter using a tree prompt

Page 172: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-54 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Workshop 1Create a Set Using a Prompt and the except() Function

Page 173: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-55 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Create a Set Using a Prompt and the except() Function

Users have requested a report that shows returns for each year for specific product types. You will create a crosstab report that prompts users to choose the product types for which they do not want to see returns. They will see returns for all other product types.

To accomplish this you need to:

Add the following query items, from the Sales and Marketing (cube) package, to a new crosstab:

Column area: Time dimension\Time hierarchy\Year level

Measure area: Measures dimension\Returns

Add a query calculation named Selected Product Types to the rows in the report. The calculation will prompt the user to select from multiple product types.

Modify the Selected Product Types expression to display values for all product types not selected by the user. You will accomplish this by modifying the edge expression (through the set definition) so that it includes the except() function and the appropriate prompt syntax.

Run the report, using Eyewear, Navigation, and Watches when prompted for a product type.

For more detailed information outlined as tasks, see the Task Table section.

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

Page 174: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-56 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Task Table

Task 1. Filter a report using a prompt. Where to Work Hints

File menu Create a new crosstab report, using the Sales and Marketing (cube) package.

Source tab Add the Year level to the Columns drop zone.

Add the Returns measure to the Measures drop zone.

Toolbox tab Use a Query Calculation object to create and validate the following expression for a prompt: set ([sales_and_marketing]. [Products].[Products].[Product type]->?pt?)

IBM Cognos Viewer Run the report, selecting Eyewear, Navigation, and Watches when prompted for a product type.

Task 2: Modify the prompt to include the except function. Where to Work Hints

Set Definition dialog box\ Set Expression dialog box

Edit and validate the <Selected Product Types> expression to include the except function: except ([sales_and_marketing]. [Products].[Products].[Product type], set ([sales_and_marketing]. [Products].[Products].[Product type]->?pt?))

IBM Cognos Viewer Run the report, selecting Eyewear, Navigation, and Watches when prompted for a product type.

If you need more information to complete a task, see the Step-by-Step Instructions section at the end of the Workshop.

Page 175: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-57 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Workshop Results

After running the report at the end of Task 1, it appears as follows:

After running the report at the end of Task 2, it appears as follows:

Page 176: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-58 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Step-by-Step Instructions

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Filter a report using a prompt. 1. Add the following query items to a new crosstab:

Columns area: Time dimension\Time hierarchy\Year level

Measure area:

Measures dimension\Returns measure

2. From the Toolbox tab, drag a Query Calculation item to the Rows drop zone.

3. In the Name box, type Selected Product Types, click Set expression, from the Hierarchy drop-down list click Products hierarchy, and then click OK.

4. Create and validate the following expression:

set ([sales_and_marketing].[Products].[Products].[Product type]->?pt?)

You are using the prompt syntax that will return a multiselect prompt.

Validate using the Binoculars product type.

Hints:

Available Components pane\Source tab: Products dimension\Products hierarchy\Product type level

5. Click OK to close the Prompt dialog box.

Page 177: Multidimentional Authoring

FOCUS YOUR DIMENSIONAL DATA

© 2007, 2012, IBM Corporation 4-59 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

6. Ensure there are no errors, click OK to close the Set Expression dialog box, and then on the toolbar, click Run Report.

The prompt appears as follows:

This is a multiselect prompt.

7. Click Eyewear, Ctrl+click Navigation and Watches, and then click OK.

The report shows returns for the product types selected in the prompt.

8. Close IBM Cognos Viewer.

Page 178: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

4-60 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 2. Modify the prompt to include the except function. You now want to modify this prompt so that when users make their selections, they will see returns for all other product types except the ones they select in the prompt.

1. In the report layout, right-click <Selected Product Types>, and then click Edit Set.

2. In the Set Definition box, click Set Expression, click Edit , and then create and validate the following expression:

except ([sales_and_marketing].[Products].[Products].[Product type], set ([sales_and_marketing].[Products].[Products].[Product type]->?pt?))

The except function returns all members of the first set expression that are not in the second set expression. In this case, the second set expression uses a prompt to fulfill the expression.

Hints:

Source tab: Products dimension\Products hierarchy\Product type level 3. Click OK to close the Set Expression dialog box, and then click OK to close

the Set Definition dialog box.

4. On the toolbar, click Run Report.

5. In the prompt, click Eyewear, Ctrl+click Navigation and Watches, and then click OK.

The report shows returns for all product types except the ones you selected in the prompt, which were Eyewear, Navigation and Watches.

6. Close IBM Cognos Viewer, and then close Report Studio without saving the report.

7. Log off of IBM Cognos Connection.

Task 2, step 7: Do not log off of IBM Cognos Connection if you are advancing to the next module today.

Page 179: Multidimentional Authoring

5

© 2012 IBM Corporation

Calculations and Dimensional FunctionsIBM Cognos BI

Page 180: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-2 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 181: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-3 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Objectives At the end of this module, you should be able to: use IBM Cognos BI dimensional functions to create

sets and tuples perform arithmetic operations in OLAP queries

identify coercion errors and rules

Custom Courses: Participants should be familiar with: basic concepts using the dimensional style and relational style of report authoring basic concepts of dimensional data sources the behavior of relational queries versus dimensional queries creating efficient dimensional queries options for focusing data returned by dimensional queries Suggested modules to reference: Introduction to Dimensional Reporting Concepts; Focus Your Dimensional Data Additional Information: Coercion: Attempting to force the system to do something it is not designed to do.

Page 182: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-4 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

IBM Cognos BI Dimensional Functions There are many dimensional functions available which can

be loosely categorized as: family functions children, descendants, ancestor, parent

top and bottom functions topCount, bottomCount, topPercent, bottomPercent

filter functions filter, except

intersection functions tuple, completeTuple

member and summary functions aggregate, total

set functions set, head, tail

The function category depends on the scenario in which it is applied. For example, the topCount function could be considered a type of filter function because it returns what is desired based on the defined parameters only.

Many of the functions listed above are available in the set definition.

The functions mentioned above that are explained in this module are: total, aggregate.

In addition, other functions mentioned above that are referenced in demos in this module (but explained in more detail in other modules of this course) are: children, topCount, except, set, tuple, bottomPercent.

For more information on these and other dimensional functions, there is a document titled "IBM Cognos 8 BI Dimensional Functions" available from IBM developerWorks: Information Management: Technical library view http://www.ibm.com/developerworks/views/data/libraryview.jsp?sort_by=Title&sort_order=1&show_abstract=true&show_all=false&search_flag=true&product_by=Cognos&topic_by=All%20Topics&type_by=All%20Types&search_by=cognosppreportingdimensionalqueries&Submit.x=0&Submit.y=0, at the time of writing this course (B5161). The concepts would still apply to IBM Cognos 10.

The categories described in the slide are subjective and may be described differently by different subject matter experts.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 183: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-5 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Explore Available Components

The expression editor shows the expression components that are supported by the data source in which the metadata is stored. Not all data sources support functions the same way. The data modeler can set a quality of service indicator on functions to give a visual clue about the behavior of the functions. Report authors can use the quality of service indicators to determine which functions to use in a report. The data modeler can set a quality of service indicator for relational and DMR models (not packages that use cubes).

The quality of service indicators are: not available (X): This function is not available for any data source in the package. limited availability (!!): The function is not available for some data sources in the package. poor performance (!):The function is available for all data sources in the package but is not naturally supported for

that data source. IBM Cognos uses a local approximation for that function. Because an approximation is used, performance can be poor and the results may not be what you expect.

unconstrained (no symbol): The function is available for all data sources. If you import metadata from an Oracle data source, the expression editor shows only the elements that are supported in Oracle.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 184: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-6 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Reuse, Prompting, and Combining in Dimensional Expressions

topCount (set ([sales_and_marketing].[Retailers]. [Retailers].[Retailer country]->?RetailerCountry?),3,

lected Year] )tuple ([Se ,[Planned revenue])

Use techniques such as prompting, combining, and the reuse of existing expressions to create more complex expressions.

This example expression in the diagram includes:

reuse of the [Selected Year] calculation, which is defined by the expression: [sales_and_marketing].[Time].[Time].[Year]->?Year?

the set ([sales_and_marketing].[Retailers]. [Retailers].[Retailer country]->?RetailerCountry?) prompt syntax, which at run time will provide a value the first argument in the topCount function

the tuple function, which returns a value for the last argument of the topCount function

genware
Highlight
genware
Highlight
genware
Highlight
Page 185: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-7 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

The total() and aggregate() Functions

726,411,368230,110,271Mountaineering Equipment

9,373,551,5382,991,782,202Total

4,686,775,7691,495,891,101Summary

75,994,296

1,885,673,308

409,660,133

1,589,036,664

4,686,775,769

Time

10,349,176Golf Equipment

594,009,408Outdoor Protection

161,039,823Personal Accessories

500,382,423Camping Equipment

1,495,891,101Products

2012Revenue

The total and aggregate functions are summary functions that return value calculations based on a set of members.

The total function calculates either the total for the currentMeasure or a value defined by the expression argument. The same applies for the aggregate function, except that this function aggregates according to the rollup rules defined in the data source.

You should use the aggregate function rather than the total function, to take advantage of the default settings defined in your model.

In the crosstab, Product lines are the children of Products, and in the total function, the total revenue of Products is included with the totals of the Product lines. The aggregate function recognizes the duplication, and aggregates the revenue of the Product lines, but does not include the revenue of the parent member Products, which has already been evaluated. You should not use an explicit summary function unless you know the data well enough to know where it is safe to use. Communicate with your modeler(s) to ensure that the aggregation tasks you apply will return expected results. Be aware that it can be more efficient to use a parent member instead of a member summary function when creating an aggregate across the full set of sibling members when the aggregate matches the default aggregate function for the measure.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 186: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-8 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Aggregate Values in Crosstabs

829354First AidOutdoor Protection

5800964Insect Repellents

5384127Sunscreen

1284570Putters

317939Woods

1075087BinocularsPersonal Accessories

20311396Eyewear

7229314Knives

1992713Navigation

3119747Golf AccessoriesGolf Equipment

391445Irons

5850251Climbing AccessoriesMountaineering Equipment

418560Rope

1135194Safety

2496086Tools

17847418Average(Product line) - within set

4249385Average(Product line) - within detail

4299195Watches

4040007Average(Product line) - within aggregate

3164285

3153218

2756540

4826755

13400351

Quantity

Tents

Sleeping Bags

Packs

Lanterns

Cooking GearCamping Equipment

In crosstabs, aggregated values are calculated using one of the following aggregate expressions:

aggregate ([measure] within set [data item]): aggregates the member values from the data source within the current content

aggregate ([measure] within detail [data item]): aggregates the lowest level of details in the report

aggregate ([measure] within aggregate [data item]): aggregates each level of details in the report

You decide which aggregate expression is used by setting the aggregation mode.

In the example: within set: This summary is the average of the product type values rolled up into sets at the product line level. within detail: This summary is the average of the detail values in the crosstab. within aggregate: For each product line, the average of the detail values is calculated; this summary is the average

of the product type averages.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 187: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-9 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Show Excluded Member Totals

Some reports display limited sets, such as reports that return the top or bottom count. Consumers may want to see the totals for members

not included in the limited set. To accomplish this, authors can use the following

expression:

The except function reduces the product line set by filtering out the top

products

aggregate (currentMeasure within set except([Product line],[Top Two Product Lines]))

The expression above aggregates the totals of all product line members with the exception of the top product line members. By doing this you return the totals for all product members not shown in the report.

With large data sets, this expression may perform slowly. If performance becomes an issue and these values are required in your report, you can instead use the following calculation: aggregate(currentMeasure within set [Product line]) - aggregate(currentMeasure within set [Top Products]). This expression accomplishes the same result by taking the totals from the top products and subtracting them from the totals of all products.

We say performance may be degraded because this is typically true for any large data set. More processing time is required when asking for values that are not pre-calculated in the data source.

In this case, we filtered out items from the set, and we are aggregating the remaining set. The data source does not have this value pre-calculated. If we had only aggregated the set without filtering, the data source would simply retrieve the rollup value for all product lines which is pre-calculated in the data source. To use this expression, you must know your data extremely well to ensure that accurate values are returned (what is default roll up for the measure: sum, average, minimum?). Talk to your data modeler to ensure that there are no data source configurations that may return unexpected results.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Sticky Note
Page 188: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-10 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 1Show Totals for the Top Two Products, Excluded Members, and Overall Totals

Page 189: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-11 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 1: Show Totals for the Top Two Product Lines, Excluded Members, and Overall Totals

Purpose: Consumers want to see the totals for the top two product lines, the totals for excluded members and the overall totals. You will accomplish this by editing the set definition for top two, and by using the aggregate function and the except function.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create a crosstab report showing the top two product lines.

1. Add the following query items to a new crosstab:

Columns area: Time dimension\Time hierarchy\Year level

Rows area: Products dimension\Products hierarchy\Product line level

Measures area: Measures dimension\Revenue measure

Page 190: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-12 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

2. From the Source tab, expand the Time dimension\Time hierarchy\Members folder, and drag the Time member to the right of <#Year#> as a peer.

3. In the crosstab, right-click <#Product Line#>, and then click Edit Set.

4. In the Set Definition dialog box, click New, and then click Top.

5. In the Top or Bottom dialog box, in the Count box type 2, and then in the Based on intersection (tuple) box, click the ellipsis.

6. In the Available members and measures pane, expand Measures, click Revenue, click the green right arrow to add it to the Intersection members and measures pane, and then click OK to close the Members dialog box.

The Top or Bottom dialog box indicates that you want a top two count of items based on the tuple (Revenue).

7. Click OK to close the Top or Bottom dialog box.

The Set Definition dialog box indicates that for the set expression, there is a top two count applied.

8. Click OK to close the Set Definition dialog box

You will rename the Product line set definition to clearly identify the content in this customized set.

9. Click <#Product line#>, in the Properties pane, under the Data Item section, click Name, change the Name property to Top Two Product Lines, and then press Enter.

Page 191: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-13 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

10. On the toolbar, click Run Report.

The results appear as follows:

The top two product lines for all years are displayed.

11. Close IBM Cognos Viewer.

Task 2. Aggregate the Top Two Product Lines data item to show totals.

1. In the report layout, click <#Top Two Product Lines#>, on the toolbar,

click Summarize , and then in the drop-down menu, click Automatic Summary.

You want to apply a meaningful name to the summary.

2. Right-click Summary, click Edit Data Item Label, in the Data item label box, change the text to Summary (Top Two Product Lines), click OK, and then on the toolbar, click Run Report.

The results appear as follows:

The report shows the aggregated summary for the top two product lines for each year and for all years.

3. Close IBM Cognos Viewer.

Page 192: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-14 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Create a calculation to return totals for excluded members.

1. From the Source tab, drag Products dimension\Products hierarchy\Product line level below Summary(Top Two Product Lines).

2. With <#Product line#> selected, on the toolbar, click Cut.

You do not want Product line in the report, but you want to reuse the data item in the query.

3. From the Toolbox tab, drag a Query Calculation object to the Rows drop zone under Summary (Top Two Product Lines) as a peer.

4. In the Name box type Excluded, click Calculated member, and then click OK.

You left the Hierarchy setting in the Create Calculation dialog box as Automatic.

5. Create and validate the following expression:

aggregate (currentMeasure within set except([Product line],[Top Two Product Lines]))

Hints:

Available Components pane\ Data items tab: Product line Available Components pane\ Data items tab: Top Two Product Lines

This expression aggregates the totals of all product line members with the exception of the top two product line members, as defined in the expression <#Top Two Product Lines#> in the crosstab, and returns the totals for all product members not shown in the crosstab.

Task 3, step 3: This type of expression can result in poor performance if the data set is large as stated earlier.

Page 193: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-15 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

6. Click OK to close the Calculated Member Expression dialog box.

7. On the toolbar, click Run Report.

The results appear as follows:

8. Close IBM Cognos Viewer.

Task 4. Add and label the totals for all products. 1. From the Source tab, expand Products dimension\Products

hierarchy\Members folder, and then drag the Products member to the rows under Excluded as a peer.

Remember, Products is the root member for the Products hierarchy and will show the totals for all products.

The results appear as follows:

The Products row is not labeled intuitively to let consumers know it is an overall total. You will change the label to be more intuitive, and format the row to be consistent with the Summary (Top Two Product Lines) row.

Page 194: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-16 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

2. In the report layout, click <#Products#>, in the Properties pane, under the Text Source section, click the Source Type property, and then in the list, click Text.

3. Click the Text property, click the ellipsis, type All Products, and then click OK.

4. In the Properties pane, under the Miscellaneous section, click the Classes property, and then click the ellipsis.

5. In the Selected classes pane, click Crosstab member cell, and then click the

green left arrow to remove it from the list.

6. In the Global classes pane, double-click Crosstab member cell (outer member, not nested) to add it to the Selected classes pane, and then click OK.

7. In the crosstab, right-click All Products, and then click Select Member Fact Cells.

8. In the Properties pane, click the Classes property, and then click the ellipsis.

9. In the Global classes pane, double-click Crosstab fact cell (outer total, not nested) to add it to the Selected classes pane, and then click OK.

Page 195: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-17 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

10. On the toolbar, click Run Report.

The results appear as follows:

The report now shows the overall totals for products in an appropriate format.

11. Close IBM Cognos Viewer.

12. Save the report in My Folders as Module5_Demo1, and leave the report open to continue building this report in the next demo.

Results: Using the set definition top two functionality, the user interface summary feature, the aggregate and except functions and appropriate labeling, you showed the totals for the top two product lines, the totals for excluded members and the overall totals for products.

Page 196: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-18 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Perform Arithmetic Operations

Perform simple arithmetic operations in OLAP queries, such as +, -, *, and /. Use these operators with members from the same

hierarchy.

Apply arithmetic operators to measures.

110,605,341.52 20,891,350.60 89,713,990.92

Camping Equipment + Mountaineering Equipment

Mountaineering Equipment

Camping Equipment

[Revenue]/tuple ([Revenue],[Products])

The report above uses the following calculation for the last column:

[Camping Equipment]+[Mountaineering Equipment]

The Camping Equipment and Mountaineering Equipment members are summed, which causes their corresponding values to be summed to provide a total value.

The expression [Revenue]/tuple ([Revenue],[Products]) takes revenue for all time and divides it by the intersection values of Revenue for all time and all Products (the root member for the Products hierarchy). This expression can be used to show the percentage that particular members contributed to the overall revenue total. In other words, a percent of base calculation.

Aggregate functions are often preferable to using simple arithmetic operators between members of a single hierarchy.

Page 197: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-19 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 2Create a Percent of Base Calculation

Page 198: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-20 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Demo 2: Create a Percent of Base Calculation

Purpose: Consumers want to see the percentage each value in the report contributed to the overall revenue for all time.

You will use simple arithmetic and the tuple function to achieve this calculation, and then arrange and format the report as required.

Note: You need to complete Demo 1 before starting this demo.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create a percent of base calculation using an arithmetic operator and the tuple function.

You will use the report built in the previous demo (Show Totals for the Top Two Product Lines, Excluded Members, and Overall Totals, saved as My Folders\Module5_Demo1) as a starting point for this demo.

1. From the Toolbox tab, drag a Query Calculation object to the columns under <#Year#> to nest as a child.

2. In the Name box type % of Base, click Calculated measure, and then click OK.

Task 1: If you were unable to complete the previous demo successfully, you can use the Solution file for the previous demo, found in IBM Cognos Connection\B5261 Solution Reports\05-Calculations_and_Dimensional_Functions\Module5_Demo1_solution.

Page 199: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-21 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

3. Create and validate the following expression:

[Revenue]/tuple ([Revenue],[Products])

This expression takes each revenue value in the context of the report and divides it by the values found at the intersection of Revenue and Products (all products). In other words, they are divided by the total of all products for each respective year.

Hints:

Available Components pane\ Data Items tab: Revenue Available Components pane\ Data Items tab: Products

4. Click OK to close the Calculated Measure Expression dialog box.

If the report is run now, the Revenue measure values will not appear because a new calculation has taken the place of Revenue in the report layout. You will add it back into the report layout.

5. From the Data Items tab, drag Revenue to columns to the left of % of Base as a peer.

You will format the values returned by the % of Base calculation.

6. In the layout report, right-click % of Base under <#Year#>, and then click Select Member Fact Cells.

7. In the Properties pane, under Data, click the Data Format property, and then click the ellipsis.

8. In the Format type list, click Percent, and then click OK.

genware
Highlight
Page 200: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-22 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

9. On the toolbar, click Run Report.

The results appear as follows:

The % of Base calculation shows the percentage that each Revenue row contributes to the total at the bottom of the column (All Products). However, consumers want to see the % of Base for the overall total for all years, in this case, 4,686,775,768.85. You can accomplish this by changing the tuple function in the % of Base calculation to include the Time member (all years).

10. Close IBM Cognos Viewer.

Task 2. Modify the % of base calculation and reuse it elsewhere in the report layout.

1. In the report layout, double-click % of Base.

2. Modify and validate the expression as follows:

[Revenue]/tuple ([Revenue],[Products],[Time])

The expression now takes each revenue value in the context of the report and divides it by the values found at the intersection of Revenue, Products (all products), and Time (all years). In other words, each revenue value is now being divided by the overall total 4,686,775,768.85.

Hints:

Available Components pane\Data Items tab: Time

3. Click OK to close the Calculated Measure Expression dialog box.

Page 201: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-23 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

4. From the Data Items tab, drag % of Base to the columns under <#Time#> to nest as a child.

When placing a calculation in another location in the layout, it automatically picks up the context of that location in the report at run time.

5. From the Data Items tab, drag Revenue under <#Time#> and to the left of <#% of Base#> as a peer.

The results appear as follows:

6. Repeat steps 6 to 8 from Task 1 to format the % of Base cells under

<#Time#> to appear as percentages.

7. On the toolbar, click Run Report.

The results appear as follows:

The % of Base calculation now shows the percentage that each revenue cell value contributed to the overall total of all products for all time. Notice that the second % of Base calculation that you placed in the report layout takes on the context of the columns and rows.

Page 202: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-24 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

8. Close IBM Cognos Viewer.

Results: Using simple arithmetic, as well as the tuple function, you created a Percent of Base calculation to illustrate how each revenue value contributes to the overall total of the report. You reused the Percent of Base calculation which automatically reflects the context of where it was positioned in the report. You also applied appropriate formatting to maintain consistency in your report.

genware
Sticky Note
now remeber tuple(revenue,poducts,time) where it would all meet? at the cornor so tht number similiarly we studies about the aggregate(member with in set()) and aggregate(member within detail()) detail refers to the members above it set menas all members in the context)
Page 203: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-25 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Sort Dimensional Data

Unsorted Sort by Label - AscendingSort by Label

Sort by Label - Descending

Mountaineering Equipment

Personal Accessories

Outdoor Protection

Golf Equipment

Camping Equipment

Personal Accessories

Outdoor Protection

Mountaineering Equipment

Golf Equipment

Camping Equipment

Camping Equipment

Golf Equipment

Mountaineering Equipment

Outdoor Protection

Personal Accessories

Sort by Value

17,671,847.80Husky Rope 100

Rope

Tents

Revenue

8,887,288.00Husky Rope 50

5,635.713.50Husky Rope 60

52,517,671.08Star Lite

28,721,600.42Star Dome

1,324,840.70Star Peg

2006

5,635.713.50Husky Rope 60

Rope

Tents

Revenue

8,887,288.00Husky Rope 50

17,671,847.80Husky Rope 100

1,324,840.70Star Peg

28,721,600.42Star Dome

52,517,671.08Star Lite

2006

Sort by Value - Ascending Sort by Value - Descending

By default, Report Studio retrieves items in the order defined in the data source.

With dimensional data, you can sort a set of members based on their label or caption, or by value of a member or measure you select. By default, when you select Sort by Label - Ascending or Descending, sets are sorted based on captions.

Before you can perform set sorting, you must create sets for the members in your report. For example, a set contains product lines, and you sort the product lines within the set in descending alphabetical order.

If you use dimensional data, you can sort members in the sets on the opposite axis based on the value of a member or measure that you select.

This type of sorting is performed in the query.

You cannot sort data items from different dimensions that are intermixed. For example, you cannot sort on Data_Item1_Dimension1, Data_Item1_Dimension2, Data_Item2_Dimension1. Also, you cannot apply set sorting and layout sorting at the same time. Sorting applied to an item will overwrite any previous sorting that was applied.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 204: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-26 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Rank Dimensional Data

12,014,445

9,900,091

5,113,701

27,301,149

34,907,705

Quantity

75,994,296.25

409,660,132.90

726,411,367.89

1,589,036,664.03

1,885,673,307.78

Revenue

35Outdoor Protection

44Mountaineering Equipment

53Golf Equipment

22Camping Equipment

11Personal Accessories

Quantity Sold Ranking

Revenue Ranking

Revenue

rank (numeric_expression [ASC|DESC] [tuple member_expression { , member_expression }] within set set_expression)

Use the rank function to determine the relative position of each member of the specified set based on the value of the numeric expression. The option ASC or DESC (default) assigns rank 1 to the member with the lowest or highest value.

In the example above, the Revenue Ranking column used the expression: rank ([Revenue]). The Quantity Sold Ranking column used the expression: rank ([Quantity]). The option of ASC or DESC was not declared, therefore, the default DESC was applied to the results.

In the diagram, we can see that Golf Equipment ranked third in revenue, but ranked fifth for quantity of items sold. If two or more rows have the same ranking, then there is a gap in the sequence of ranked values (also known as Olympic ranking). The for option defines the scope of the function. The at option defines the level of aggregation and can only be used in the context of relational data sources. Null values are ranked last. Additional Information: Rank can cause performance issues when you have a large set of members returned from an OLAP data source. Rank can only be processed locally when you access an OLAP data source.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 205: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-27 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 3Nest Dimensional Functions to Create a Dynamic bottomPercent Report

Page 206: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-28 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Demo 3: Nest Dimensional Functions to Create a Dynamic bottomPercent Report

Purpose: You must create a report so that users can identify the countries that are in the bottom 20% of planned revenue for a given year. The report should show revenue values, and show the planned revenue values separately. Users want to choose which countries they want to evaluate and which year to apply the evaluation. To achieve this, you will use the bottomPercent function that uses a nested tuple function. You will also use prompts to make the report dynamic. You will modify the report so that you can identify how the bottomPercent function behaves.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: List

Task 1. Create a dynamic report using nested dimensional functions.

1. Create a new list report, without saving the previous report.

2. On the Insertable Objects pane\Toolbox tab, drag a Query Calculation object to the report layout.

3. In the Name box type Selected Year, click Other expression, and then click OK.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 207: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-29 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

4. Create and validate the following expression:

[sales_and_marketing].[Time].[Time].[Year]->?Year?

Hints:

Available Components pane\Source tab: Time dimension\Time hierarchy\Year level

Validate using 2010

5. Click OK to close the Prompt dialog box.

6. Click OK to close the Data Item Expression dialog box.

7. From the Toolbox tab, drag a Query Calculation object to the report layout, to the right of Selected Year.

8. In the Name box type Selected Countries, click Set expression, from the Hierarchy drop-down list, click Retailers hierarchy and then click OK.

9. Create and validate the following expression:

set ([sales_and_marketing].[Retailers].[Retailers].[Retailer country]->?C?)

Hints:

Available Components pane\Source tab: Retailers dimension\Retailers hierarchy\Retailer country level

Validate using Australia

10. Click OK to close the Prompt dialog box.

11. Click OK to close the Set Expression dialog box.

12. In the report layout, click Selected Countries, and then click Cut.

You do not want this in your report layout at this time, but you want it to remain in the query.

Task 1, Step 9: If you do not select a hierarchy, an error will be displayed.

Page 208: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-30 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

13. From the Toolbox tab, drag a Query Calculation object to the report layout, to the right of Selected Year. (Drop when you see 3 vertical bars or the Query Calculation will not be available in the Expression Editor for later use. )

14. In the Name box type Bottom 20% Planned Revenue, click Set expression, and then click OK.

15. Create and validate the following expression:

bottomPercent ([Selected Countries], 20, tuple ([Selected Year],[Planned revenue]))

Within this expression, you have combined functions, reused items, and included prompts.

Hints:

Available Components pane\ Data Items tab: Selected Countries Available Components pane\ Data Items tab: Selected Year Available Components pane\ Source tab: Measures dimension\ Planned

revenue measure

16. Click OK to close the Set Expression dialog box.

genware
Highlight
Page 209: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-31 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

17. From the Source tab, drag the Revenue measure to the right of Bottom 20% Planned Revenue, and then on the toolbar, click Run Report.

A prompt is generated, and appears as follows:

For the Country prompt, there are more than 20 countries to choose from. At this point you will select all of them.

Page 210: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-32 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

18. Click Select all, in the Year list, click 2012, and then click OK.

The results appear as follows:

The report is filtered to show the countries that are in the bottom 20% for planned revenue for the year 2012. Notice that the report shows revenue values and not planned revenue values.

You will modify the report to show a summary value for revenues, and you will further examine how the bottomPercent function works.

19. Close IBM Cognos Viewer.

Task 2. Aggregate the Revenue column. 1. In the report layout, click the Revenue column.

2. On the toolbar, click Summarize, in the drop-down menu, click Automatic Summary, and then on the toolbar, click Run Report.

3. In the Retailer country list, click Brazil, and then Ctrl+click Canada, Mexico, and United States.

Page 211: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-33 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

4. In the Year list, click 2012, and then click OK.

The results appear as follows:

The report shows a summary value for Revenue. More importantly, the report is filtered to show the countries that were chosen in your prompt. If you compare this report to the report at the end of Task 1, you may ask why Mexico is now included. The results are based on how the bottomPercent function works. To help explain this, you will add a second query that shows us the planned revenue for these countries.

5. Close IBM Cognos Viewer.

Task 3. Add a block object to the report layout. You will now add a block object to improve the layout of the report, before adding another list report.

1. From the Toolbox tab, drag a Block object under the existing List report.

2. Click the block object in the report layout, in the Properties pane, under Positioning, click the Size & Overflow property, and then click the ellipsis.

3. In the Size & Overflow dialog box, in the Height box, type 30, and then click OK.

You have formatted the block object to a specific height for separating the objects in your report, and will now add a second list report.

Page 212: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-34 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 4. Investigate the bottomPercent function. 1. From the Toolbox tab, drag a List object under the block in the report layout,

and then in the bottom list report layout, click the Container Selector to select the list report.

For the remainder of this task, we will be working with the bottom list report.

2. In the Properties pane, under Data, click the Query property, and then in the list, click Query1.

This will allow you to use items from Query1 in this list.

3. From the Data Items tab, drag the Planned revenue data item to the list report.

4. Click <Planned revenue>, on the toolbar, click Summarize, and then in the drop-down menu, click Total.

5. With <Planned revenue> selected, on the toolbar click Sort, and then in the drop-down menu, click Ascending.

6. From the Data Items tab, drag Selected Countries to the left of the Planned revenue column.

This will reuse the query values supplied by the prompt in the first list report.

7. From the Data Items tab, drag Selected Year to the left of Selected Countries.

To be aware of what is happening during the bottomPercent calculation, you will include two columns to display the % of Total Planned Revenue , and a running total of these values.

8. From the Toolbox tab, drag a Query Calculation object to the report layout, to the right of the Planned revenue column.

9. In the Name box type % of Total Planned Revenue, click Calculated measure, and then click OK.

Page 213: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-35 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

10. Create and validate the following expression:

[Planned revenue]/ aggregate ([Planned revenue] within set [Selected Countries])

Hints:

Available Components pane\ Data Items tab: Planned revenue Available Components pane\ Data Items tab: Selected Countries

11. Click OK to close the Calculated Measure Expression dialog box.

12. Click the <% of Total Planned Revenue> cells, in the Properties pane, under Data, click the Data Format property, click the ellipsis, in the Format type list, click Percent, and then click OK.

13. With <% of Total Planned Revenue> selected, on the toolbar click

Right .

14. On the toolbar, click Summarize, and then in the drop-down menu, click Total.

15. In the report layout, click the <Total(% of Total Planned Revenue)> summary cell, and then in the Properties pane, under Data, ensure that the Data Format is Percent.

16. From the Toolbox tab, drag a Query Calculation, to the right of <% of Total Planned Revenue>, named Running Total of % Planned Revenue, click Other expression, and then click OK.

17. Create and validate the following expression:

running-total ([% of Total Planned Revenue])

Hints:

Available Components pane\ Data Items tab: % of Total Planned Revenue

18. Click OK to close the Data Item Expression dialog box.

Page 214: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-36 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

19. Click the <Running Total of % Planned Revenue> cells, in the Properties pane, under Data, click the Data Format property, and then click the ellipsis.

20. In the Format type list, click Percent, and then click OK.

21. On the toolbar, click Run Report.

22. In the Retailer country list, click Brazil, Ctrl+click Canada, Mexico and United States, in the Year list, click 2012, and then click OK.

The results appear as follows:

The bottom list report shows the total for planned revenue values for the four countries. These are the same four countries that you selected in the prompt. Also displayed is the percent of total planned revenues, and a running total.

For the top list report, the bottomPercent function works as follows:

The total planned revenue, for the selected countries from the prompt, is evaluated to be 477,326,244.24.

The planned revenue from each of the selected countries is evaluated from lowest to highest (Brazil, Mexico, Canada, United States).

The values from lowest to highest are summed, until a value that is 20% of the total is reached. 20% of 477,326,244.24 = 95,465,248.85.

Page 215: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-37 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Planned revenue for Brazil is 45,151,584.06. Since that member alone does not reach the bottom 20% threshold of 95,465,248.85, planned revenue for Mexico (61,848,335.71) is added to planned revenue for Brazil to equal 106,999,919.77. The value is evaluated as being higher than the 20% threshold. Notice that only a portion of the planned revenue for Mexico contributes to reaching the bottom 20% threshold. The evaluation ends and the countries that contribute to reaching the 20% threshold are shown in the report. Because the planned revenue measures for Canada or the United States do not contribute to reaching the 20% plateau, they are not shown in the report.

23. Close IBM Cognos Viewer.

Results: You created a report so that users can identify the Countries that are in the bottom 20% of planned revenue for a given year. You used the bottomPercent function, which included a nested tuple function, and you also used prompts to make the report dynamic. You identified how the bottomPercent function behaves.

Page 216: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-38 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Support for Multiple Hierarchies Per Dimension

Supported for PowerCubes and DMR

-5,810,635.5170,842,142.5465,031,507.03Personal Accessories

94,610.50612,309.66706,920.16Outdoor Protection

2,269,898.1722,859,849.9725,129,748.14Golf Equipment

19,656,444.46

48,024,982.91

Last Month

1,978,078.3721,634,522.83Mountaineering Equipment

5,914,301.4953,939,284.40Camping Equipment

VarianceCurrent MonthRevenue

Variance calculation based on two members from different hierarchies in the same dimension

You can reference multiple hierarchies from the same dimension in one query. For example, you can place members from one hierarchy on one edge of a crosstab, and members from another hierarchy from the same dimension on the other edge of the crosstab.

With respect to the time dimension from a PowerCube, you can create calculations based on members from different hierarchies of the time dimension. As seen in the slide example, you can subtract the Last Month member from the Current Month member to see the variance between the two.

genware
Highlight
genware
Highlight
genware
Highlight
Page 217: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-39 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 4Create a Variance Calculation with Members from Different Hierarchies of the Same Dimension

Page 218: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-40 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Demo 4: Create a Variance Calculation with Members from Different Hierarchies of the Same Dimension

Purpose: Consumers would like to see the revenue variance between the current month and the last month. These members are available in different hierarchies in the Time dimension. You will take advantage of support for multiple hierarchies per dimension to create the variance calculation.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create a variance calculation for two members from the same dimension but different hierarchies.

1. Add the following query items to a new crosstab:

Columns area: Time dimension\ Current Month hierarchy\ Members folder\

Current Month member Time dimension\ Last Month hierarchy\ Members folder\ Last

Month member Rows area:

Products dimension\ Products hierarchy\ Product line level Measures area:

Measures dimension\ Revenue measure

Page 219: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-41 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

2. From the Toolbox tab, drag a Query Calculation object named Variance, as a Calculated member to the Columns drop zone, as a peer of <#Last Month#>.

3. Create and validate the following expression:

[Current Month]-[Last Month]

Hints:

Available Components pane\ Data Items tab: Current Month, Last Month

In the Information pane a message is displayed about arithmetic calculations using members from different hierarchies. You are using members from different hierarchies in the same dimension, and will proceed, as it makes sense in this specific use case.

4. Click OK to close the Calculated Member Expression dialog box.

The report layout appears as follows:

Page 220: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-42 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. On the toolbar, click Run Report.

The results appear as follows:

The variance between the two months is displayed. You have successfully created a calculation between two members from different hierarchies in the same dimension.

6. Close IBM Cognos Viewer and Report Studio.

7. Log off of IBM Cognos Connection.

Results: By taking advantage of support for multiple hierarchies per dimension, you were able to create a variance calculation between the current month and last month.

Task 1, Step 7: Do not log off of IBM Cognos Connection if you are advancing to the next module today.

Page 221: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-43 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Common Errors in Expressions A common authoring error is to provide a dimensional

function with the wrong parameter type.

currentMember ([sales_and_marketing].[Products].[Products].[Products])

When constructing the syntax for dimensional functions, authors will often provide the wrong parameter type for satisfying the arguments of a function. An example is inserting a level when a hierarchy is required, or inserting a hierarchy when a member is required.

As a best practice, you should validate each new function added to check for errors. Otherwise, it may be difficult to locate the error later.

The common error we are showing in the slide is an example of breaking a coercion rule. The author supplied a level as the parameter for the currentMember function, when a hierarchy is required.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 222: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-44 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

What is Coercion?level member set

numeric measure numeric value

bottomCount ( set_expression , index_expression , numeric_expression )

Expression:

a set is expected

bottomCount (set ([Camping Equipment],[Personal Accessories],[Outdoor Protection], [Golf Equipment],[Mountaineering Equipment]), 3, tuple ([2006],[Quantity]))

bottomCount ([sales_and_marketing].[Products].[Products].[Product line], tuple ([2006],[Quantity]))

instead, a level can be used, following coercion rules

Coercion is the conversion of one dimensional data type to another. With coercion rules, you can build simpler expressions.

Coercion is sometimes referred to as automatic data type conversion or automatic casting. IBM Cognos supports the following types of coercion: coercion of an object of one dimensional type into another, such as a level into a member set coercion of a dimensional object into a numeric, date, time, or string value, such as a numeric measure into a

numeric value

There is a set of coercion rules defined in the Report Studio User Guide Chapter 11: Dimensional Reporting Style, Using Dimensional Calculations section, and Dimensional Coercion Rules subsection, included with the IBM Cognos version 10.1.0 product documentation.

genware
Highlight
genware
Highlight
Page 223: Multidimentional Authoring

CALCULATIONS AND DIMENSIONAL FUNCTIONS

© 2007, 2012, IBM Corporation 5-45 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Summary At the end of this module, you should be able to: use IBM Cognos BI dimensional functions to create

sets and tuples perform arithmetic operations in OLAP queries

identify coercion errors and rules

Page 224: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

5-46 ©2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 225: Multidimentional Authoring

6

© 2012 IBM Corporation

Functions for Navigating Dimensional Hierarchies

IBM Cognos BI

Page 226: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-2 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 227: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-3 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Objectives At the end of this module, you should be able to: navigate dimensional data using family functions

Participants should be familiar with basic concepts of reporting using the dimensional style and dimensional data sources. Suggested modules to reference: • Introduction to Dimensional Reporting Concepts • Introduction to Dimensional Data in Reports • Focus Your Dimensional Data • Calculations and Dimensional Functions

Page 228: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-4 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Time

2011 2012

2011Q 1

2011 Q 2

2011Q 3

2011Q 4

2012Q 1

2012Q 2

2012Q 3

2012Q 4

2011/Jan 20115/Feb 2011/Mar 2011/Oct 2011/Nov 2011/Dec

FirstChild 2011

Parent 2012Q 4

FirstSibling 2012 Q 4

Ancestor 2011/Dec 3 levels up

Cousins 2011/Jan, 2005 Q 4

Use Family Functions to Navigate Data

These types of functions let you navigate the structure vertically as well as horizontally.

Page 229: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-5 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Return Child Members

Golf Equipment

Outdoor Protection

Personal Accessories

Mountaineering Equipment

Camping Equipment

children([Products])

children(member)

This function returns the set of child members of a specified member.

genware
Highlight
genware
Highlight
genware
Highlight
Page 230: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-6 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Return Parent Member

Personal Accessoriesparent([Eyewear])

parent(member)

This function returns the parent member of a specified member.

Most OLAP data sources only provide one parent member

genware
Highlight
genware
Highlight
Page 231: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-7 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Return Descendantsdescendants(member|set_expression,level|distance [,{ self|before|beforewithmember|after}])

TrailChef Cup

TrailChef Cook Set

TrailChef Deluxe Cook Set

TrailChef Single Flame

TrailChef Double Flame

TrailChef Kettle

TrailChef Utensils

Tents

Star Lite

Star Dome

Star Gazer 2

Star Gazer 3

Star Gazer 6

Star Peg

Sleeping Bags

TrailChef Kitchen Kit

TrailChef Canteen

TrailChef Water Bag

Cooking Gear

descendants([sales_and_marketing].[Products]. [Products].[Product line],3,before)

This function returns the set of descendants, at a specified level or distance from the specified set of members.

You can modify the set of members returned by using the parameters self, before, beforewithmember, and after. The example above returns the set of members one and two levels below the level product line due to the parameters 3 and before.

The diagram shows a section of the hierarchy structure, and a section of the results of the expression used. The diagram does not represent the entire results returned, as it is too big to fit in this diagram.

genware
Highlight
genware
Highlight
Page 232: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-8 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 1Create a Crosstab Report and Show Descendants of the Products Hierarchy

Page 233: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-9 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 1: Create a Crosstab Report and Show Descendants of the Products Hierarchy

Purpose: You will explore the descendants function to determine the members returned when using different levels of detail in the expression. By creating a variety of reports based on the Products hierarchy, you can modify the output to display multiple intermediate levels.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Show a descendant level. 1. Add the following query items to a new crosstab:

Columns area: Time dimension\Time hierarchy\Year level

Measures area:

Measures dimension\Revenue measure

2. From the Toolbox tab, drag a Query Calculation object named Descendants

of Products, as a Set expression, Products hierarchy, to the Rows drop zone.

Page 234: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-10 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

3. Create and validate the following expression:

descendants ([Products],2)

By using 2, you specify that you want to retrieve the set of members that are two levels below the member (Products) specified in the expression.

Hints:

Available Components pane\Source tab: Products dimension\Products hierarchy\Members folder\Products member

4. Click OK to close the Set Expression dialog box.

5. On the toolbar, click Run Report.

A section of the report appears as follows:

The report shows members from two levels below the level of the Products member. These members are from the Product type level.

6. Close IBM Cognos Viewer.

Task 2. Show an intermediate level of descendants. 1. In the report layout, right-click <Descendants of Products>, and then click

Edit Set.

2. In the Set Definition dialog box, double-click Set Expression, and then in the Expression Definition box, modify and validate the expression as follows:

descendants ([Products],2,before)

This will return members from the levels between the levels specified in the first and second arguments. In this case, there is only one level: Product line.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 235: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-11 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

3. Click OK to close the Set Expression dialog box, and then click OK to close the Set Definition dialog box.

4. On the toolbar, click Run Report.

The results appear as follows:

The report shows members from the Product line level.

5. Close IBM Cognos Viewer.

Task 3. Show multiple intermediate levels. 1. In the layout report, right-click <Descendants of Products>, and then click

Edit Set.

2. In the Set Definition dialog box, double-click Set Expression, and then in the Expression Definition box, modify and validate the expression as follows:

descendants ([Products],3,before)

3. Click OK to close the Set Expression dialog box, and then click OK to close the Set Definition dialog box.

4. In the report layout, ensure that <Descendants of Products> is selected, in the Properties pane, under General, click the Level Indentation property, and then click the ellipsis.

5. In the Indentation type section, click the Based on the level in the hierarchy button to select it.

6. In the Indentation length box, type 15, in the Direction section, in the Start after the following level box, type 1, and then click OK.

genware
Highlight
Page 236: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-12 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

7. On the toolbar, click Run Report.

A section of the report appears as follows:

The report shows members from the Product type and Product line levels, indented according to the properties you changed.

8. Close IBM Cognos Viewer.

Task 4. Show multiple intermediate levels and the specified level.

1. In the report layout, right-click <Descendants of Products>, and then click Edit Set.

2. In the Set Definition dialog box, double-click Set Expression, and then in the Expression Definition box, modify and validate the expression as follows:

descendants ([Products],3,before self)

This will return members from the levels between the levels specified in the first and second arguments, and the members from the level specified in the second argument.

3. Click OK to close the Set Expression dialog box, and then click OK to close the Set Definition dialog box.

genware
Highlight
Page 237: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-13 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

4. On the toolbar, click Run Report.

A section of the report appears as follows:

The report shows members from the Product line, Product type, and Product name levels.

5. Close IBM Cognos Viewer.

Results: You explored the descendants function and determined the members returned when using different levels of detail in the expression. You created a variety of reports based on the Products hierarchy, and modified the output to display multiple intermediate levels.

Page 238: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-14 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Return Ancestor Members

ancestor (member, level|integer)

2012

2012Q 1

2012Q 2

2012Q 3

2012Q 4

2012/Jan 2012/Feb 2012/Mar 2012/Oct 2012/Nov 2012/Dec

Ancestor 2012/Dec Year level

With the ancestor function you can return the ancestor member from any level above the specified member.

In this function syntax:

member is the source member

level indicates from which level to retrieve the ancestor

integer is an alternative to specifying an explicit level (you can indicate how many levels to go above the specified member)

For example, ancestor ([2012/Dec],[sales_and_marketing].[Time].[Time].[Year]) would return [2012]. You could also use ancestor ([2012/Dec],2) to obtain the same result.

The ancestor function is useful in many scenarios. For example, with a staff dimension, you can use the ancestor function to quickly identify which Vice President a sales representative works for by bypassing the manager and director levels. The same applies for a product dimension in which you may want to know which product line a product belongs to by bypassing the product type level.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 239: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-15 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Return Cousin Members

member1

cousin(member1, member2)

2012

2012Q 1

2012Q 2

2012Q 3

2012Q 4

2012/Jan 2012/Feb 2012/Mar 2012/Oct 2012/Nov 2012/Dec

result

member2

In this function syntax, member1 is the source member, and member2 is the ancestor of the cousin you wish to retrieve.

For example, cousin ([2012/Jan],[2012 Q 4]) will return [2012/Oct].

The cousin function returns a member that is in the same relative position under a specified ancestor as the source member is under its ancestor.

member2 could be at any logical level above member1. For example, the cousin of Jan 2012 for the member 2011 would return Jan 2011.

Another way to explain the cousin function: finds the child of member2 with the same position of member1 under its parent.

Practical applications for the cousin function include finding relative periods in a time dimension or relative people or items in an organizational structure. For example, you may use the cousin function to find out who reports to a director in another part of the organization relative to another person's position. The cousin function can be used in combination with other functions. For example, you may want to find out the total revenue for the same relative month in another quarter. You could write the following calculation to find the total revenue for the first month of 2012 Q 4: aggregate ([Revenue] within set cousin ([2012/Jan],[2012 Q 4]))20122012.

genware
Highlight
genware
Highlight
genware
Highlight
Page 240: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-16 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Summary At the end of this module, you should be able to: navigate dimensional data using family functions

Page 241: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-17 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Workshop 1Determine the Product Line for a Product, Using the ancestor() Function

Page 242: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-18 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Determine the Product Line for a Product, Using the ancestor() Function

The marketing staff wants a report that returns the product line for a product, without having to know the product type information.

To do this, you must:

create a list report using the Sales and Marketing (cube) package

prompt the user to select a product

add a column to display the product line of the selected product

test your report by selecting Capri as the product to determine the product line it will return

Optional Challenge: After creating this report, find another expression using a different family function that will achieve the same output of displaying the product line of a specific product.

For more detailed information outlined as tasks, see the Task Table section.

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

One possible response to the optional challenge: parent (parent ([Capri]))

Page 243: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-19 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Task Table

Task 1: Create a list report with a prompt to select a product. Where to Work Hints

Report Studio Package: Public Folders\Samples\Cubes\Sales and Marketing (cube).

Toolbar Create a new list.

Toolbox tab\ Data Item tab

Drag a Query Calculation object named Selected Product to the list report.

Set Expression dialog box\Expression Definition box

Expression: [sales_and_marketing]. [Products].[Products]. [Product]->?Product?

Task 2: Add a column to display the product line, using the ancestor function.

Where to Work Hints

Toolbox tab Drag a Query Calculation object named Product Line of Selected Product to the end of the list report.

Set Expression dialog box\Expression Definition box

Expression: ancestor([sales_and_marketing].[Products].[Products].[Product] -> ?Selected Product?,[sales_and_marketing].[Products].[Products]. [Product line])

IBM Cognos Viewer

Run the report, using Capri as the product at the prompt.

If you need more information to complete a task, see the Step-by-Step Instructions section at the end of the Workshop.

Page 244: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-20 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Results

The results appear as follows:

Page 245: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-21 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Step-by-Step Instructions

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: List

Task 1. Create a list report with a prompt to select a product. 1. Create a list report, without saving the previous report.

2. From the Toolbox tab, drag a Query Calculation object named Selected Product, as a Set expression, Products hierarchy to the list report layout.

3. Create and validate the following expression:

[sales_and_marketing].[Products].[Products].[Product]->?Selected Product?

Hints:

Available Components pane\Source tab: Products dimension\Products hierarchy\Product level

Validate using Aloe Relief

4. Click OK to close the Prompt dialog box, and then click OK to close the Set Expression dialog box.

Page 246: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-22 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 2. Add a column to display the product line, using the ancestor function.

1. From the Toolbox tab, drag a Query Calculation object named Product Line of Selected Product, as a Set expression, Products hierarchy, to the right of Selected Product in the list report.

2. Create and validate the following expression:

ancestor([sales_and_marketing].[Products].[Products].[Product]-> ?Selected Product?, [sales_and_marketing].[Products].[Products]. [Product line])

Hints:

Available Components pane\Source tab: Products dimension\Products hierarchy\Product level

Available Components pane\Parameters tab: Product Available Components pane\Source tab: Products dimension\Products

hierarchy\Product line level

3. Click OK to close the Set Expression dialog box.

4. On the toolbar, click Run Report, from the prompt list, click Capri as the product, and then click OK.

The report shows the selected product and the corresponding product line level.

5. Close IBM Cognos Viewer.

Task 2, Step 2: You could also use the data item Selected Product instead of the first 2 hint bullets.

Page 247: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-23 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Workshop 2Create a Dynamic Crosstab Report with Combined Dimensional Functions

\

Page 248: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-24 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Workshop 2: Create a Dynamic Crosstab Report with Combined Dimensional Functions

The Sales department wants a report on planned revenues from different cities and countries by order method and by quarter. They want the report to be interactive so that they can narrow the focus to a selected order method and quarter. In the report, they want to see the planned revenue for each city and country for the selected order method and the combined planned revenue for all other methods not selected in the prompt.

To accomplish this, you must:

Create a crosstab report using the Sales and Marketing (cube) package, using Planned revenue as the measure.

Add a query calculation named Location to the rows. The calculation returns the descendants of the Region level starting at the Retailer site level. Include the Retailer site level and the previous level from the hierarchy.

Format rows to include indentation.

Add a query calculation named Selected Order Method on columns. The calculation returns an interactive list of order methods.

Create a prompt page that includes a value prompt. The value prompt will use the parameter that is generated by the Selected Order Method query calculation.

Add a second value prompt to the page and create a new parameter named Quarter. Use the Quarter level when creating the parameterized filter for the parameter, and create a new query.

Page 249: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-25 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Add a query calculation named All Other Order Methods on columns (beside Selected Order Method). This calculation returns the total planned revenue for order methods, except for those order methods that are selected in the first prompt.

Show the selected quarter from the prompt as a left-justified title on the report (Additional Challenge).

Run the report using Web and 2012 Q 4 at the prompts.

For more detailed information outlined as tasks, see the Task Table section.

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

Page 250: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-26 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Workshop 2: Task Table

Task 1: Create a crosstab report that includes the descendants of the Retailers hierarchy on rows.

Where to Work Hints

Report Studio Package: Sales and Marketing (cube)

Insertable Objects pane\ Toolbox tab

Set Expression dialog box\Expression Definition box

Measure: Planned revenue

Rows: Query Calculation object named Location.

Expression: descendants ([sales_and_marketing].[Retailers]. [Retailers].[Region], [sales_and_marketing]. [Retailers].[ Retailers].[Retailer site],self before)

Properties pane\Level Indentation property

Indentation length: 15 px

Indentation start level: 2

IBM Cognos Viewer Run the report.

Page 251: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-27 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 2: Add a prompt for Order Method. Where to Work Hints

Insertable Objects pane\ Toolbox tab

Set Expression dialog box\Expression Definition box

Columns: Query Calculation object named Selected Order Method.

Expression: [sales_and_marketing]. [Order method].[Order method].[Order method type]->?Order Method?

Page Explorer\Prompt Pages Insertable Objects pane\ Toolbox tab Prompt Wizard - Value Prompt dialog box

Create a prompt page and add a Page object.

Add a Value Prompt object to the page, using the existing Order Method parameter.

IBM Cognos Viewer Run the report, selecting Web in the prompt.

Task 3: Add a prompt for Quarter. Where to Work Hints

Page Explorer\Prompt Pages

Add the second Value Prompt object to the prompt page.

Insertable Objects pane\ Toolbox tab

Prompt Wizard - Value Prompt dialog box

Create a new parameter called Quarter.

Create a parameterized filter using the Quarter level as the package item.

IBM Cognos Viewer Run the report, selecting Web, and then 2012 Q 4 in the prompts.

Page 252: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-28 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 4: Create an expression that returns the total planned revenue for order methods for each location, except for the order methods that are chosen in the prompt.

Where to Work Hints

Page Explorer\Report Pages\Page1

Insertable Objects pane\ Toolbox tab

Columns: to the right of Selected Order Method, use a Query Calculation object named All Other Order Methods.

Expression: aggregate (currentMeasure within set except ([sales_ and_marketing]. [Order method].[Order method]. [Order method type], [Selected Order Method]))

IBM Cognos Viewer Run the report, selecting Web, and then 2012 Q 4 in the prompts.

Page 253: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-29 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 5: Show the chosen quarter from the second prompt, as a title on the report (Additional Challenge).

Where to Work Hints

Text Item Properties pane

Change the Source Type property of the report title to Report Expression.

Report Expression dialog box\Available Components pane\ Parameters tab\ Expression Definition box

Set the Report Expression property using the following expression: ParamDisplayValue ('Quarter')

Use the Quarter parameter.

Left-justify the title.

Run the report, selecting Web, and then 2012 Q 4 in the prompts.

IBM Cognos Viewer Close IBM Cognos Viewer and Report Studio without saving the report.

Close IBM Cognos Connection.

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

Page 254: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-30 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Workshop 2: Workshop Results

At the end of Task 5, after running the report, and selecting Web in the first prompt, and 2012 Q 4 in the second prompt, the first page of the report appears as follows:

Page 255: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-31 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Workshop 2: Step-by-Step Instructions

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create a crosstab report that includes the descendants of the Retailers hierarchy on rows.

1. Add the following query item in to a new crosstab:

Measures area:

Measures dimension\Planned revenue measure

2. From the Toolbox tab, drag a Query Calculation object named Location, as a Set expression, Retailers hierarchy, to the Rows drop zone.

3. Create and validate the following expression:

descendants ([sales_and_marketing].[Retailers].[Retailers].[Region], [sales_and_marketing].[Retailers].[Retailers].[Retailer site],self before)

Hints:

Available Components pane\Source tab: Retailers dimension\Retailers hierarchy\Region level

Available Components pane\Source tab: Retailers dimension\Retailers hierarchy\Retailer site level

4. Click OK to close the Set Expression dialog box.

Page 256: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-32 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. In the report layout, click <Location>, in the Properties pane, under General, click the Level Indentation property, and then click the ellipsis.

6. In the Indentation type section, click the Based on the level in the hierarchy button to select it, and then in the Indentation length box, type 15.

7. In the Start after the following level box, type 2, and then click OK.

8. On the toolbar, click Run Report.

A section of the report appears as follows:

9. Close IBM Cognos Viewer.

Task 2. Add a prompt for Order Method. 1. From the Toolbox tab, drag a Query Calculation object named Selected

Order Method, as a Set expression, Order method hierarchy, to the Columns drop zone.

2. Create and validate the following expression:

[sales_and_marketing].[Order method].[Order method].[Order method type]->?Order Method?

Hints:

Available Components pane\Source tab: Order method dimension\Order method hierarchy\Order method type level

Validate using Web

Page 257: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-33 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

3. Click OK to close the Set Expression dialog box.

4. On the Explorer bar, point to the Page Explorer, and then click Prompt Pages.

5. On the Insertable Objects pane, drag a Page object to the Prompt Pages pane, and then double-click Prompt Page1.

6. Toolbox tab, drag a Value Prompt object to the prompt page of the report.

7. In the Prompt Wizard - Value Prompt dialog box, click Use existing parameter, in the list, click Order Method, and then click Next.

8. Accept the default selection to create a new query, and then click Finish.

9. On the toolbar click Run Report, at the prompt, click Web, and then click Finish.

A section of the report appears as follows:

10. Close IBM Cognos Viewer.

Page 258: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-34 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Add a prompt for Quarter. 1. From the Toolbox tab, drag a Value Prompt object to the prompt page to the

right of the existing Value Prompt control.

2. In the Prompt Wizard - Value Prompt dialog box, in the Create a new parameter box, type Quarter, and then click Next.

3. Ensure the Create a parameterized filter check box is selected, and then to the right of the Package item box, click the ellipsis.

4. In the Choose Package Item dialog box, expand the Time dimension\Time hierarchy, click the Quarter level, and then click OK.

5. Click Next, accept the default selection, click Next, accept the default selections, and then click Finish.

6. On the toolbar, click Run Report, at the first prompt click Web, at the second prompt from the Quarter list, click 2012 Q 4, and then click Finish.

A section of the report appears as follows:

7. Close IBM Cognos Viewer.

Page 259: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-35 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 4. Create an expression that returns the total gross profit for order methods for each location, except for the order methods that are chosen in the prompt.

1. On the Explorer bar, point to Page Explorer, and then under Report Pages, click Page1.

2. From the Toolbox tab, drag a Query Calculation object named All Other Order Methods, as a Calculated Member, Order method hierarchy, to the columns to the right of <Selected Order Method>, as a peer.

3. Create and validate the following expression:

aggregate (currentMeasure within set except ([sales_and_marketing]. [Order method].[Order method].[Order method type],[Selected Order Method]))

Hints:

Available Components pane\Source tab: Order method dimension\Order method hierarchy\Order method type level

Available Components pane\Data Items tab: Selected Order Method

Validate using 2012 Q 4

4. Click OK to close the Calculated Member Expression dialog box.

Page 260: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-36 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. On the toolbar, click Run Report, at the first prompt click Web, at the second prompt from the Quarter list, click 2012 Q 4, and then click Finish.

A section of the report appears as follows:

6. Close IBM Cognos Viewer.

Task 5. Show the chosen quarter from the second prompt, as a title on the report (Additional Challenge).

1. In the layout report header, click the header Text Item object (which currently states Double-click to edit text).

2. In the Properties pane, under Text Source, click the Source Type property, and then in the list, click Report Expression.

3. In the Properties pane, under the Text Source, click the Report Expression property, and then click the ellipsis.

4. On the Available Components pane\Parameters tab, drag Quarter to the Expression Definition box.

The expression appears as follows:

ParamDisplayValue('Quarter')

Page 261: Multidimentional Authoring

FUNCTIONS FOR NAVIGATING DIMENSIONAL HIERARCHIES

© 2007, 2012, IBM Corporation 6-37 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

5. Validate the expression to ensure there are no errors, and then click OK to close the Report Expression dialog box.

6. In the Properties pane, click Select Ancestor , click Block to select the

block of the title text, and then on the toolbar, click Left to left align the title.

7. On the toolbar, click Run Report, at the first prompt click Web, at the second prompt from the Quarter list, click 2012 Q 4, and then click Finish.

Refer to the Workshop Results section for an example of the report.

8. Close IBM Cognos Viewer, and then close Report Studio without saving the report.

9. Log off of IBM Cognos Connection.

Task 5, step 9: Do not log off of IBM Cognos Connection if you are advancing to the next module today.

Page 262: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

6-38 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 263: Multidimentional Authoring

7

© 2012 IBM Corporation

Relative Functions

IBM Cognos BI

Page 264: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-2 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 265: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-3 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Objectives At the end of this module, you should be able to: navigate dimensional data using relative functions

navigate dimensional data using relative time functions

Custom Courses: Participants should be familiar with basic concepts of reporting using the dimensional style and dimensional data sources. Suggested modules to reference: Introduction to Dimensional Reporting Concepts Introduction to Dimensional Data in Reports Focus Your Dimensional Data Calculations and Dimensional Functions

Page 266: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-4 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Use Functions to Navigate Data

Report Studio authors have access to several functions that allow them to navigate dimensional structures. These functions fall into several categories: family (such as parent, children, siblings, cousin)

relative (such as currentMember, nextMember, prevMember, lag) relative time (such as closingPeriod, parallelPeriod,

periodsToDate)

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 267: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-5 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Dimensional Structures (Review)Time dimension

(with Year, Quarter, and Month levels)Time

2012 2013

2012Q 1

2013Q 2

2013Q 3

2013Q 4

2013Q 1

2013Q 2

2013Q 3

2013Q 4

2012/Jan 2012/Feb 2012/Mar 2012/Oct 2012/Nov 2012/Dec

Page 268: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-6 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Time

2011 2012

2011Q 1

2011Q 2

2011Q 3

2011Q 4

2012Q 1

2012Q 2

2012Q 3

2012Q 4

2011/Jan 2011/Feb 2011/Mar 2011/Oct 2011/Nov 2011/Dec

prevMember2011/Feb

nextMember2011/Feb

lead2012 Q 2 two

members forward

Use Relative Functions to Navigate Datalead(member, index_expression)

lag(member, index_expression)

prevMember(member)

nextMember(member)

lag2012 Q 2

one member backward

These types of functions let you retrieve a member by referring to its horizontal position relative to another member.

The lag function lets you navigate backwards to relative members. For example: lag([2013 Q 2],1) returns the member [2013 Q 1].

The lead function also lets you navigate forward to relative members. For example: lead([2013 Q 2],2) returns the member [2013 Q 4].

Lag and lead functions work horizontally, not vertically. You cannot use these functions to navigate to ancestors or descendants.

With the lead and lag functions, you can use negative index values that will cause the functions to have the reverse effect. For example, lead([2013 Q 2], -1) would actually return [2013 Q 1] the same as the lag function with the syntax lag([2013 Q 2], 1). If the lag function uses a negative 1, lag([2013 Q 2], -1), then it would actually return [2013 Q 3].

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 269: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-7 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 1Use Family and Relative Dimensional Functions to Focus Reports

Page 270: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-8 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Demo 1: Use Family and Relative Dimensional Functions to Focus Reports

Purpose: Using family and relative dimensional functions, you will author a report that lets consumers select a specific month for which to view the return values across product lines. You will also compare the results to the previous month, and to the same month from the previous year.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Examine the data structure in the Years hierarchy. You will use the technique shown in this task to view the data structure in the Time hierarchy. This technique is useful in helping to understand the structure of the data and provides confidence when navigating the structure with dimensional functions.

1. In Report Studio, using the Sales and Marketing (cube) package, create a new crosstab report.

2. From the Source tab, expand the Time dimension, and then drag the Time hierarchy to the Rows drop zone.

3. In the Insert Hierarchy dialog box, click All members, and then click OK.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 271: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-9 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

4. In the crosstab, click <#Time#>, in the Properties pane, under General, click the Level Indentation property, and then click the ellipsis.

5. In the Level Indentation dialog box, in the Indentation type section, click the Based on the level in the hierarchy button to select it, in the Indentation length box, type 15, and then click OK.

6. On the toolbar, click Run Report.

A section of the report appears as follows:

The report displays the Time hierarchy, indenting each level fifteen pixels from the parent level. You can page through the report to ensure the data is structured in a logical order. In this case it is; therefore, you can safely apply family and relative functions to navigate the data.

If the data source was a dimensionally modeled relational (DMR) source, the data would likely not be in a logical structure as seen above, and therefore could not be navigated with predictability using the dimensional functions.

7. Close IBM Cognos Viewer.

Task 1, step 6: You can write the same report using the GO Data Warehouse package (a DMR source) to illustrate that the lowest level values are not sorted. In the case of GO Data Warehouse, the day dates are not sorted logically and therefore are not candidates for navigating with dimensional functions. The results would not be predicable.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Sticky Note
we are just trying to make sure that the dates are sorted correct
genware
Highlight
Page 272: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-10 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 2. Create a crosstab report that prompts the user for a month.

1. Add the following query items to a new crosstab:

Rows area: Products dimension\Products hierarchy\Product line level

Measures area:

Measures dimension\Returns measure

2. From the Toolbox tab, drag a Query Calculation object named Selected Month, as a Set expression of the Time hierarchy, to the Columns drop zone.

3. Create and validate the following expression:

[sales_and_marketing].[Time].[Time].[Month]->?Selected Month?

Hints:

Available Components pane\Source tab: Time dimension\Time hierarchy\Month level

Validate using any mounth in the prompt

4. Click OK to close the Prompt dialog box.

The expression has no errors.

5. Click OK to close the Set Expression dialog box.

The results appear as follows:

Page 273: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-11 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Test the crosstab report. 1. On the toolbar, click Run Report.

A generic prompt page appears requiring the selection of a month.

2. Click 2012/Dec, and then click OK.

The results appear as follows:

The report appears displaying only one column for the month that was selected.

3. Close IBM Cognos Viewer.

Task 4. Create a calculation to show values for the previous month.

1. From the Toolbox tab, drag a Query Calculation object named Previous Month, as a Set expression of the Time hierarchy, to the right of <Selected Month>, as a peer.

2. Create and validate the following expression:

prevMember ([Selected Month])

Hints:

prevMember: You can type this in the expression, or you can add this function using the Functions tab under Available Components which would also provide expected syntax. This particular function expects a member as a parameter.

Available Components pane\Data Items tab: Selected Month

Page 274: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-12 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

3. Click OK to close the Set Expression dialog box.

The results appear as follows:

Task 5. Create a calculation to show values for the month from the previous year.

1. From the Toolbox tab, drag a Query Calculation object named Previous Year, as a Set expression of the Time hierarchy to the right of Previous Month, as a peer.

2. In the Expression Definition box, create the expression as follows:

cousin ([Selected Month], lag (ancestor ([Selected Month], [sales_and_marketing].[Time].[Time].[Year]),1))

This expression retrieves the cousin of the selected month for the previous year. To obtain the previous year, use the ancestor function to obtain the current year, and then use the lag function to go back one year. This could have also been accomplished by using the prevMember function: prevMember(ancestor([Selected Month])

Hints:

Available Components pane\Data Items tab: Selected Month Available Components pane\Source tab: Time dimension\Time

hierarchy\Year level

3. Click OK to close the Set Expression dialog box.

The results appear as follows:

Task 5, step 2: Instead of using the cousin function, you could have used the parallelPeriod function. They basically do the same thing, but parallelPeriod is considered more closely related to the time series and is a little more complex. In the interest of showing a family function, you used the cousin function. The end result is the same.

genware
Highlight
Page 275: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-13 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 6. Test the finished crosstab report. 1. On the toolbar, click Run Report.

2. In the prompt, click 2012/Dec, and then click OK.

The results appear as follows:

The report displays the selected month followed by the previous month and the same month from the previous year.

3. Close IBM Cognos Viewer.

Results: Using family and relative dimensional functions, you quickly created reports to compare different time periods.

Page 276: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-14 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Time

2012 2013

2012Q 1

2012Q 2

2012Q 3

2012Q 4

2013Q 1

2013Q 2

2013Q 3

2013Q 4

2012/Jan 2012/Feb 2012/Mar 2012/Oct 2012/Nov 2012/Dec

closingPeriodmonth level

2012

openingPeriodmonth level

2012

periodsToDate2013 Q 3

parallelPeriod2013 Q 4 prior year

Use Relative Time Functions to Navigate Data (Overview)

These types of functions are typically used on time dimensions but are not limited to them.

Although relative time functions are typically used on time dimensions, they can also be used on other dimensions. For example, you could use the closingPeriod function to find the latest product added to a particular product line. The syntax would look similar to this: closingPeriod([sales_and_marketing].[Products].[Products].[Product],[Eyewear])

In the Sales and Marketing PowerCube, this expression would return Retro, which is the last Eyewear product added to the data for the Eyewear product line.

genware
Highlight
genware
Highlight
genware
Highlight
Page 277: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-15 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

The closingPeriod Function

Time

2012 2013

2012Q 1

2012Q 2

2012Q 3

2012Q 4

2013Q 1

2013Q 2

2013Q 3

2013Q 4

2012/Jan 2012/Feb 2012/Mar 2012/Oct 2012/Nov 2012/Dec

closingPeriod ([sales_and_marketing].[Time].[Time].[Quarter])

closingPeriod(level [,member])

closingPeriod ([sales_and_marketing].[Time].[Time].[Quarter],[2012])

When you use the closingPeriod function without specifying a member, the function returns the last member of the specified level for all data. It is not restricted to any branch in the data structure.

If you specify a member in the closingPeriod function, it returns that level's last member in that member's data branch.

In the example of syntax shown in the diagram [, member] is optional, and does not represent a hierarchy.

The closingPeriod ([sales_and_marketing].[Time].[Time].[Quarter],[2012]) expression specifies the [2012] member, which restricts the member returned to the last member in the 2012 branch of the data structure.

genware
Highlight
genware
Highlight
Page 278: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-16 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

The periodsToDate Function

Time

2012 2013

2012Q 1

2012Q 2

2012Q 3

2012Q 4

2013Q 1

2013Q 2

2013Q 3

2013Q 4

2012/Jan 2012/Feb 2012/Mar 2012/Oct 2012/Nov 2012/Dec

periodsToDate([sales_and_marketing].[Time].[Time].[Time],[2013 Q 2])

periodsToDate([sales_and_marketing].[Time].[Time].[Year],[2013 Q 2])

periodsToDate(level, member)

The members returned by this function depend on the level specified.

In the example above, if the Year level is specified, then only quarters, including the specified quarter, for the year the specified quarter belongs to are returned.

If the Time level is used for the level argument, then all quarters in the data prior to and including the quarter specified are returned.

The Time member in the hierarchy structure has the same name as the level. In the periodsToDate([sales_and_marketing].[Time].[Time].[Time],[2013 Q 2]) expression, the Time reference is to the level, not the member.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 279: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-17 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 2Use Relative Time Dimensional Functions to Focus Reports

Page 280: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-18 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Demo 2: Use Relative Time Dimensional Functions to Focus Reports

Purpose: Staff want to view the latest sales by product line for individual retailers. They also want to see the sales for the individual retailers for all the quarters of the year, including the latest quarter, 2013 Q 3.

You will create a dashboard-style report using a Select & Search prompt and relative time dimensional functions to achieve the desired outcome.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Chart

Task 1. Create a gauge chart and a prompt page. IBM Cognos BI now has two charting options. The new charting styles options are set as the default. You will make use of these new styles to add charts to your reports.

1. In Report Studio, from the File menu, click New, click No to saving the report, and then double-click Chart.

2. In the Insert Chart dialog box, in the Chart group pane, click Gauge, and then click OK.

genware
Highlight
genware
Highlight
Page 281: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-19 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

3. Add the following query items to the new gauge chart:

Default measure (y-axis): Measures dimension\Revenue measure Gauge Axes: Products dimension\Products hierarchy\Product line level Categories (gauges): Retailers dimension\Retailers hierarchy\Retailer

name level

When you run the report, you only want to allow users to select one retailer at a time. Because the list is long, you will use a Select & Search prompt to allow users to quickly find the retailer for which they want to view data.

4. On the Explorer bar, point to Page Explorer , and then click Prompt Pages.

5. From the Toolbox tab, drag a Page object to the Prompt Pages pane, and then in the Prompt Pages pane, double-click Prompt Page1.

6. From the Toolbox tab, drag a Select & Search Prompt object to the prompt page.

The Prompt Wizard dialog appears.

7. In the Create a new parameter box, type Retailer, and then click Next.

8. Beside the Package item box, click the ellipsis, expand the Retailers dimension\Retailers hierarchy, select Retailer name level, and then click OK.

9. Click Next, accept the default to create a new query, and then click Finish.

10. On the toolbar, click Run Report.

11. In the Keywords box, type ex, and then click Search.

Page 282: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-20 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

12. In the Choice list, click Extreme Outdoors, and then click Finish.

The results appear as follows:

Results are returned for Extreme Outdoors. The values are for all years. You want to limit this gauge chart to the current month, July 2013.

13. Close IBM Cognos Viewer.

Page 283: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-21 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 2. Create a calculation to return data for the latest month found in the data.

The data source has data only up to July 2013, but includes all months in 2013. You will create an expression that will determine the last month of data in the data source, so that valid results are returned when you run the report.

1. On the Explorer bar, point to Page Explorer, and then click Page1.

2. From the Toolbox tab, drag a Query Calculation object named Latest Month, as a Set expression of the Time hierarchy, below <#Retailer name#> in the Categories (gauges) drop zone.

3. Create and validate the following expression:

item (tail (filter ([sales_and_marketing].[Time].[Time].[Month], currentMeasure is not null)),0)

Hints:

Available Components pane\Source tab: Time dimension\Time hierarchy\Month level

Available Components pane\Source tab: Time dimension\Time hierarchy

Validate using 4 Your Eyes

4. Click OK to close the Set Expression dialog box.

Task 2, step 3: This expression works as follows: -Access month data: members: [sales_and_marketing].[Time].[Time]. [Month] -Get the value for the latest year being evaluated and filter it if it has data: filter ([sales_and_marketing].[Time].[Time]. [Month]), currentMeasure is not null) -This returns a set of months that has data. Get the last set of month members: tail (filter ([sales_and_marketing].[Time].[Time]. [Month]), currentMeasure is not null)) -Get the last month member from the set of members returned by the tail function: item (tail (filter ([sales_and_marketing].[Time].[Time]. [Month]), currentMeasure is not null)),0) This expression could be re-used to determine latest quarter parent([Latest Month], or latest year (ancestor([Latest month],[sales_and_marketing].[Time].[Time].[Year]).

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 284: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-22 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. On the toolbar, click Run Report.

6. In the Keywords box, type ex, and then click Search.

7. In the Choice list, click Extreme Outdoors, and then click Finish.

The results appear as follows:

The report now shows values for the last month found in the cube: July 2013.

8. Close IBM Cognos Viewer.

You could have used a closingPeriod calculation in this demo, but you must know your data well and ensure that the latest month in the data is not a future month. In some cases, the data may contain future months for data such as sales targets and budget forecasts. This data source has data entered up to July 2013, but includes all the months of the year, so you will have to ensure that your final expression will accommodate this. If you used the closingPeriod function, you would have to know the final month of data available to use the function as follows: closingPeriod([sales_and_marketing].[Time].[Time].[Month], [2013/Jul]) Using the expression for Latest Month in step 3 will determine what your latest month of data will be, without you knowing what the last month of data actually is. Additional Information: If the data source defines a Current Month level, this level could be used to retrieve data for the latest month. This cube has a Current Month level, but if that was used, you would not be able to use other relative periods, because the Current Month level is isolated as a single level in its own hierarchy. Therefore, you could not apply functions such as parallelPeriod and periodsToDate, because there is no structure to navigate. That structure is in the Time hierarchy.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 285: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-23 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Create a chart to show the sales of a retailer over the quarters.

You will now create a complimentary chart that shows the sales for a retailer for all quarters in the year, including the latest quarter, 2013 Q 3.

1. From the Toolbox tab, drag a Chart object to the right of the gauge chart on the report page.

2. In the Chart type pane on the right, click Clustered Column with 3-D

Effects , and then click OK.

You will associate this new chart with Query1 and will reuse some of the existing query items.

3. On the layout report, click the column chart, and then in the Properties pane, under Data, change the Query property to Query1.

4. Populate the column chart, using the following items from the Data Items tab, from Query1:

Default measure (y-axis): Revenue Series (primary axis): Product line

5. From the Toolbox tab, drag a Query Calculation object named Year-to-Period, as a Set expression of the Time hierarchy to the Categories (x-axis) drop zone.

Page 286: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-24 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

6. Create and validate the following expression:

periodsToDate ([sales_and_marketing].[Time].[Time].[Year], parent ([Latest Month]))

The data source includes all months in 2013, but has data up to July 2013 only, therefore you will specify this in the expression, so that valid results are returned.

Hints:

Available Components pane\Source tab: Time dimension\Time hierarchy\Year level

Available Components pane\Data Items tab: Latest Month

You need to add the level above Quarter (which is Year), because the function requires this level to retrieve its descendants, which are the siblings to the [Latest Month] member that will be specified in the second parameter.

In order to obtain the latest quarter information, you will use the Latest Month calculation in conjunction with the parent function.

7. Click OK to close the Set Expression dialog box.

Task 3, step 6: You could also use the closingPeriod function on the Quarter level to obtain the latest quarter, but you will use the parent function on the Latest Month calculation, because Latest Month is the anchor for the report. This guarantees that you are using the parent of the latest month in the data. It is possible that there may be pre-populated quarter members in the data with no months defined beneath them. If this were the case, you would not get back the expected results.

genware
Highlight
Page 287: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-25 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 4. Test the final report. 1. On the toolbar, click Run Report.

2. In the Keywords box, type ex, and then click Search.

3. In the Choice list, click Extreme Outdoors, and then click Finish.

The results appear as follows:

The report now displays a gauge chart that shows the sales of a retailer in the latest month as well as a bar graph that shows the sales of the quarters of the year. Because the latest month with data in the cube is July 2013, the chart only displays the first, second, and third quarters for 2013. When reviewing the data for the third quarter, you should consider that only one month of data (July) is available for reporting, and therefore the quarter figures reflect this.

4. Close IBM Cognos Viewer.

Results: Using relative time dimensional functions, you obtained the latest month in the data and generated a dashboard-style report. The report showed sales of a retailer for the latest month, July, and the quarters within this year including the latest quarter, 2013 Q 3.

genware
Highlight
genware
Highlight
Page 288: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-26 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

The parallelPeriod Function

Time

2012 2013

2012Q 1

2012Q 2

2012Q 3

2012Q 4

2013Q 1

2013Q 2

2013Q 3

2013Q 4

2012/Jan 2012/Feb 2012/Mar 2012/Oct 2012/Nov 2012/Dec

parallelPeriod([sales_and_marketing].[Time].[Time].[Quarter],-3,[2012/Feb])

parallelPeriod([sales_and_marketing].[Time].[Time].[Year],1,[2013 Q 4])

parallelPeriod(level [, integer_expression [, member] ])

The parallelPeriod function can use any logical level above the specified member. Depending on the level you choose, a different parallel period is returned.

For example, in the diagram, if the expression parallelPeriod ([sales_and_marketing]. [Time].[Time].[Quarter], -3,[2012/Feb]) is changed to use the year level, parallelPeriod ([sales_and_marketing].[Time].[Time].[Year], -3,[2012/Feb]), then the expression returns 2009/Feb. The -3 portion of the expression moves us three years forward from the year the specified member belongs to. Feb 2009 is in the same relative position in 2009 as 2012/Feb is in 2012.

You can use positive and negative integer_expression values to move backwards and forwards in the data structure.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 289: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-27 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 3Create a Periods-to-Date Report and Compare to the Previous Year

Page 290: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-28 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Demo 3: Create a Periods-to-Date Report and Compare to the Previous Year

Purpose: Consumers want to select a particular quarter. They want to compare the revenue and quantity sold for all product lines in this quarter to the same quarter for the previous year. They also want to see the total for periods, up to and including the quarter selected.

You will use relative time dimensional functions and the tuple function to author this report.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create a crosstab report with a prompt for the quarter.

1. Add the following query items to a new crosstab:

Rows area: Products dimension\Products hierarchy\Product line level

Measures area:

Measures dimension\Revenue measure

2. From the Toolbox tab, drag a Query Calculation object named Selected Quarter, as a Set expression of the Time hierarchy, to the Columns drop zone.

Page 291: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-29 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

3. Create and validate the following expression:

[sales_and_marketing].[Time].[Time].[Quarter]->?Quarter?

Hints:

Available Components pane\Source tab: Time dimension\Time hierarchy\Quarter level

Validate using 2010 Q 1

4. Click OK to close the Prompt dialog box, and then click OK to close the Set Expression dialog box.

The results appear as follows:

Task 2. Create a calculation to show the previous year's quarter.

1. From the Toolbox tab, drag a Query Calculation object named Selected Quarter for Previous Year, as a Set expression of the Time hierarchy, to the right of <Selected Quarter>, as a peer.

2. Create and validate the following expression:

parallelPeriod([sales_and_marketing].[Time].[Time].[Year],1,[Selected Quarter])

Hints:

Available Components pane\Source tab: Time dimension\Time hierarchy\Year level

Available Components pane\Data Items tab: Selected Quarter

3. Click OK to close the Set Expression dialog box.

genware
Highlight
Page 292: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-30 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Create a prompt page and test the report. You will create a prompt page that allows a single selection.

1. On the Explorer bar, point to Page Explorer, click Prompt Pages, and then From the Toolbox tab, drag a Page object to the Prompt Pages pane.

2. In the Prompt Pages pane, double-click Prompt Page1.

3. From the Toolbox tab, drag a Value Prompt object to the prompt page.

4. Click Use existing parameter, and then in the list, click Quarter.

5. Click Next, and then click Finish.

6. On the toolbar, click Run Report.

7. In the prompt, click 2013 Q 2, and then click Finish.

The results appear as follows:

You see revenue values for the selected quarter, as well as for the same quarter from the previous year.

8. Close IBM Cognos Viewer.

Page 293: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-31 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 4. Create tuples to show the quantities sold for the quarters.

1. On the Explorer bar, point to Page Explorer, and then click Page1.

2. From the Toolbox tab, drag a Query Calculation object named Quantity Sold for Selected Quarter, as a Set expression of the Time hierarchy, to the right of <Selected Quarter>, as a peer.

3. Create and validate the following expression:

tuple ([Selected Quarter],[Quantity])

Hints:

Available Components pane\Data Items tab: Selected Quarter Available Components pane\Source tab: Measures dimension\Quantity

measure

4. Click OK to close the Set Expression dialog box.

5. From the Toolbox tab, drag a Query Calculation object named Quantity Sold for Selected Quarter Previous Year, as a Set expression of the Time hierarchy, to the right of <Selected Quarter for Previous Year>, as a peer.

6. Create and validate the following expression: tuple ([Selected Quarter for Previous Year],[Quantity]) Hints: Available Components pane\Data Items tab: Selected Quarter for Previous

Year Available Components pane\Source tab: Measures dimension\Quantity

measure

Page 294: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-32 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

7. Click OK to close the Set Expression dialog box.

8. On the toolbar, click Run Report, at the prompt, click 2013 Q 2, and then click Finish.

The results appear as follows:

9. Close IBM Cognos Viewer.

Task 5. Create more appropriate labels for the tuple calculations.

1. On the toolbar, click Unlock (currently locked) .

2. In the crosstab, click the <Quantity Sold for Selected Quarter> column header.

3. In the Properties pane, under Text Source, make the following changes:

Source Type property: Report Expression

Report Expression property: [Query1].[Selected Quarter]

4. From the Toolbox tab, drag a Text Item object to the right of the second column header in the crosstab, after <%[Query1].[Se…%>.

Page 295: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-33 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

5. In the Text box, press the spacebar, type Quantity Sold, and then click OK.

6. Repeat steps 2 to 5 to change the <Quantity Sold for Selected Quarter Previous Year> column header:

Report Expression property: Selected Quarter for Previous Year

Ensure that the Source Type property is Report Expression.

7. On the toolbar, click Lock (currently unlocked) to lock the report.

8. On the toolbar, click Run Report, in the prompt, click 2013 Q 2, and then click Finish.

The results appear as follows:

The tuple calculation column headers now display more intuitive labels.

9. Close IBM Cognos Viewer.

Task 6. Create a calculation to show year-to-period totals. You will now create a calculation to show us the total values for the year for all quarters including the selected quarter.

1. From the Toolbox tab, drag a Query Calculation object named Year-to-Period, as a Set expression of the Time hierarchy, to the right of the second column, as a peer.

Page 296: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-34 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

2. Create and validate the following expression:

periodsToDate ([sales_and_marketing].[Time].[Time].[Year],[Selected Quarter])

Hints:

Available Components pane\Source tab: Time dimension\Time hierarchy\Year level

Available Components pane\Data Items tab: Selected Quarter

3. Click OK to close the Set Expression dialog box.

4. On the toolbar, click Run Report, in the prompt, click 2013 Q 2, and then click Finish.

A section of the report appears as follows:

The report returns Q 1 and Q 2 for 2013 as expected. However, you want the report to only display the totals for these quarters, rather than for each quarter individually.

5. Close IBM Cognos Viewer, in the report layout, click <Year-to-Period>, and then from the toolbar, click Cut.

This removes the calculation from the report layout, but keeps it in the query. You will use the Year-to-Period expression in the next calculation.

6. From the Toolbox tab, drag a Query Calculation object named Year-to-Period Totals, as a Calculated member, to the right of the second column, as a peer.

Page 297: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-35 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

7. Create and validate the following expression: aggregate (currentMeasure within set[Year-to-Period]) Hints: Available Components pane\Data Items tab: Year-to-Period

8. Click OK to close the Calculated Member Expression dialog box.

Task 7. Create a calculation to show the previous year-to-period totals.

1. From the Toolbox tab, drag a Query Calculation object named Previous Year-to-Period, as a Set expression of the Time hierarchy, to the right of the last column, as a peer.

2. Create and validate the following expression: periodsToDate ([sales_and_marketing].[Time].[Time].[Year],[Selected Quarter for Previous Year]) Hints: Available Components pane\Source tab: Time dimension\Time

hierarchy\Year level Available Components pane\Data Items tab: Selected Quarter for Previous

Year

3. Click OK to close the Set Expression dialog box.

4. Cut <Previous Year-to-Period> from the report layout.

5. From the Toolbox tab, drag a Query Calculation object named Previous Year-to-Period Totals, as a Calculated member, to the right of the last column, as a peer.

Page 298: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-36 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

6. Create and validate the following expression:

aggregate (currentMeasure within set[Previous Year-to-Period])

Hints:

Available Components pane\Data Items tab: Previous Year-to-Period

7. Click OK to close the Calculated Member Expression dialog box.

8. On the toolbar, click Run Report.

9. In the prompt, select 2013 Q 2, and then click Finish.

The results appear as follows:

The report now shows the cumulative total for revenue from the beginning of the year to the selected quarter for both the current year and the previous year.

10. Close IBM Cognos Viewer.

Results: Using relative time dimensional functions and the tuple function, you created a report that allows consumers to compare revenue and quantity sold values for all product lines for specific time periods.

Page 299: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-37 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

The lastPeriods Function

2013/Mar

2013/Feb

2013/Jan

2012/Dec

2012/Nov

2012/Oct

lastPeriods(integer_expression, member)

lastPeriods(6,[2013/Mar])

Another common relative time function is the lastPeriods function, which returns a specified number (integer_expression) of members as a set from the same level as the member (including the specified member).

The example in the diagram returns the last six months including March 2013 (the specified member).

genware
Highlight
genware
Highlight
genware
Highlight
Page 300: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-38 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 4Create a Report that Spans the Past Six Months Based on a Selected Month

Page 301: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-39 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 4: Create a Report that Spans the Past Six Months Based on a Selected Month

Purpose: Consumers want to select a particular month and see the revenue generated for all product lines over the previous six months including the selected month. They also want to see the total values for the months.

You will use the lastPeriods dimensional function to author this report.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create a crosstab report with a prompt for the quarter.

1. Add the following query items to a new crosstab:

Rows area: Products dimension\Products hierarchy\Product line level

Measures area:

Measures dimension\Revenue measure

2. From the Toolbox tab, drag a Query Calculation object named Selected Month, as a Set expression of the Time hierarchy, to the Columns drop zone.

Page 302: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-40 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

3. Create and validate the following expression:

[sales_and_marketing].[Time].[Time].[Month]->?Month?

Hints:

Available Components pane\Source tab: Time dimension\Time hierarchy\Month level

Validate using 2010/Apr

4. Click OK to close the Set Expression dialog box.

The results appear as follows:

Task 2. Create a calculation to show the last six months from the selected month.

1. From the Toolbox tab, drag a Query Calculation object named Selected Six Months, as a Set expression of the Time hierarchy, to the right of <Selected Month>, as a peer.

2. Create and validate the following expression:

lastPeriods (6,[Selected Month])

Hints:

Available Components pane\Data Items tab: Selected Month

3. Click OK to close the Set Expression dialog box.

Page 303: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-41 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

4. Cut <Selected Month> from the report because it is not required in the layout.

5. On the report layout, click one of the <Selected Six Months> column

headers, on the toolbar, click Summarize , and then in the drop-down menu, click Automatic Summary.

6. On the toolbar, click Run Report, in the prompt list, click 2013/Mar, and then click OK.

The results appear as follows:

The report returns the selected month, 2013/Mar, and the prior five months, and provides a total revenue value for each product line.

7. Close IBM Cognos Viewer.

Results: Using the lastPeriods dimensional function you provided consumers with a report that allows them to select a month. The report displays revenue values for the last six months, including the selected month.

Page 304: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-42 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Summary At the end of this module, you should be able to: navigate dimensional data using relative functions

navigate dimensional data using relative time functions

Page 305: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-43 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Workshop 1Create a Dashboard Report to Compare Various Time Periods

Page 306: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-44 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Create a Dashboard Report to Compare Various Time Periods

Senior management wants a dashboard report that shows retailer sales for the latest month around the globe, and revenue values for product lines during specific time periods. They have submitted the following requirements for the report that will include a map report and a column chart centered on the final report:

Map chart:

display the retailer countries and revenue for latest month

display tooltips

no legend required

Column chart:

Type: Column with 3-D visual effect

Revenue values for each product line for the following time periods:

latest month (July 2013)

parallel month last quarter

same month previous year

same month two years ago

total for months in the latest quarter

total for the previous quarter

Page 307: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-45 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

To accomplish this, you must do the following:

create the requested dashboard report using the Sales and Marketing (cube) package

use charts and dimensional functions

enable tooltips on the charts so that when consumers pause their pointers over an item, they can view more information

center the report objects on the page and ensure they are formatted to appear in an appropriate size

For more detailed information outlined as tasks, see the Task Table section.

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

Page 308: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-46 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Task Table

Task 1: Create a map report. Where to Work Hints

Report Studio\ File menu

Package: Sales and Marketing (cube)

Create a new report, choose Map, and accept the default settings.

Source tab\report layout Add the Retailer country level to the Location drop zone.

Properties pane Show the tooltips and hide the legend for the map.

Toolbar Change the page alignment to the top center.

Task 2: Add a column chart to the report and add a calculation that returns the latest month.

Where to Work Hints

Toolbox tab\report layout

Properties pane

Add a Block item below the map.

Add a Column with 3-D visual Effect chart below the block item and associate the new chart with Query1.

Source tab\report layout\column chart Set Expression dialog box\Expression Definition box

Default measure (y-axis): Revenue measure

Series: Product line level

Categories (x-axis): Query Calculation named Latest Month with the following expression: item (tail (filter ([sales_and_marketing].[Time].[Time]. [Month], currentMeasure is not null)),0)

Properties pane Show the tooltips for the chart.

Page 309: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-47 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 3: Display the revenue and latest month data in the map object. Where to Work Hints

Source tab\report layout\map

Color drop zone: Data Item: Latest Month

Default drop zone: Data Item: Revenue

Task 4: Create calculations to compare the latest month to other periods. Where to Work Hints

Toolbox tab\report layout\column chart

Set Expression dialog box\Expression Definition box

Drag a Query Calculation named Same Month Previous Quarter to the right of Latest Month, with the following expression: parallelPeriod ([sales_and_marketing]. [Time].[Time].[Quarter],1,[Latest Month])

Toolbox tab\report layout\ column chart

Set Expression dialog box\Expression Definition box

Drag a Query Calculation named Same Month Previous Year to the right of Same Month Previous Quarter, with the following expression: parallelPeriod ([sales_and_marketing]. [Time].[Time].[Year],1,[Latest Month])

Toolbox tab\report layout\ column chart

Set Expression dialog box\Expression Definition box

Drag a Query Calculation named Same Month 2 Years Ago to the right of Same Month Previous Year, with the following expression: parallelPeriod ([sales_and_marketing]. [Time].[Time]. [Year],2,[Latest Month])

Page 310: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-48 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 5: Create a calculation called Quarter-to-Period to show revenue totals.

Where to Work Hints

Toolbox tab\report layout\ column chart

Calculated Member Expression dialog box\Expression Definition box

Drag a Query Calculation named Quarter-to-Period to the right of Same Month 2 Years Ago, with the following expression: aggregate (currentMeasure within set periodsToDate ([sales_and_marketing].[Time].[Time].[Quarter], [Latest Month]))

Task 6: Create a calculation to return the revenue totals for the previous quarter.

Where to Work Hints

Toolbox tab\report layout\ column chart

Set Expression dialog box\Expression Definition box

Drag a Query Calculation named Total Previous Quarter to the right of Quarter-to-Period, with the following expression: prevMember (parent ([Latest Month]))

Task 7: Format the chart and test the report. Where to Work Hints

Report layout\Properties pane\ column chart

Change the Size & Overflow property for the chart to have a width of 10 inches.

IBM Cognos Viewer On the toolbar, click Run Report to view the results.

If you need more information to complete a task, see the Step-by-Step Instructions section at the end of the Workshop.

Page 311: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-49 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Workshop Results

The report results appear as shown below:

Page 312: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-50 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Step-by-Step Instructions

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Map

Task 1. Create a map report. 1. In Report Studio, from the File menu, click New, click No to saving the

report, and then double-click Map.

2. Click OK to accept the Choose Map default settings.

3. Add the following query item to the new map:

Location: Retailers dimension\Retailers hierarchy\Retailer country level

4. Click the map background to select it.

5. In the Properties pane, ensure the following properties have been set:

Chart Labels: Tooltips property\Show Chart Annotations: Legend property\Hide

6. Click the report page to select the Page Body, on the toolbar, click

Center , and then click Top .

Task 2. Add a column chart to the report and add a calculation that returns the latest month.

1. From the Toolbox tab, drag a Block object to the right of the map, and then drag a Chart object below the block object.

2. In the Chart type pane, click Clustered Column with 3-D Effects, and then click OK.

You will associate this new chart with Query1.

Page 313: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-51 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

3. On the report layout, click the column chart background, and then in the Properties pane, under Data, change the Query property to Query1.

4. Add the following query items to the column chart:

Series (primary axis): Products dimension\Products hierarchy\Product line level

Default measure (y-axis): Measures dimension\Revenue measure

5. From the Toolbox tab, drag a Query Calculation named Latest Month, as a Set expression of the Time hierarchy, to the Categories (x-axis) drop zone.

6. Create and validate the following expression:

item (tail (filter ([sales_and_marketing].[Time].[Time].[Month], currentMeasure is not null)),0)

Hints:

Available Components pane\Source tab: Time dimension\Time hierarchy\Month level

You have dynamically determined the latest month with data, which in this data source is July 2013.

7. Click OK to close the Set Expression dialog box.

8. Click the column chart background, and then in the Properties pane, under General, ensure that the Tooltips property is Absolute.

Task 3. Display the revenue and latest month data in the map object.

1. From the Data Items tab, drag Latest Month to the Color drop zone on the map report layout.

2. From the Data Items tab, drag Revenue to the Default drop zone on the map report layout.

Page 314: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-52 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 4. Create calculations to compare the latest month to other periods.

1. From the Toolbox tab, drag a Query Calculation object named Same Month Previous Quarter, as a Set expression of the Time hierarchy, to Categories (x-axis) to the right of <#Latest Month#> on the column chart.

2. Create and validate the following expression:

parallelPeriod ([sales_and_marketing].[Time].[Time].[Quarter],1, [Latest Month])

Hints:

Available Components pane\Source tab: Time dimension\Time hierarchy\Quarter level

Available Components pane\Data Items tab: Latest Month

3. Click OK to close the Set Expression dialog box.

4. From the Toolbox tab, drag a Query Calculation object named Same Month Previous Year, as a Set expression of the Time hierarchy, to the Categories (x-axis) drop zone, to the right of <#Same Month Previous Quarter#> on the column chart.

5. Create and validate the following expression:

parallelPeriod ([sales_and_marketing].[Time].[Time].[Year],1,[Latest Month])

Hints:

Available Components pane\Source tab: Time dimension\Time hierarchy\Year level

Available Components pane\Data Items tab: Latest Month

6. Click OK to close the Set Expression dialog box.

Page 315: Multidimentional Authoring

R E L A T I V E F U N C T I O N S

© 2007, 2012, IBM Corporation 7-53 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

7. From the Toolbox tab, drag a Query Calculation object named Same Month 2 Years Ago, as a Set expression of the Time hierarchy, to the Categories (x-axis) drop zone, to the right of <#Same Month Previous Year #> on the column chart.

8. Create and validate the following expression:

parallelPeriod ([sales_and_marketing].[Time].[Time].[Year],2,[Latest Month])

In the expression, you will use 2 to go back two years.

Hints:

Available Components pane\Source tab: Time dimension\Time hierarchy\Year level

Available Components pane\Data Items tab: Latest Month

9. Click OK to close the Set Expression dialog box.

Task 5. Create a calculation called Quarter-to-Period to show revenue totals.

1. From the Toolbox tab, drag a Query Calculation object named Quarter-to-Period, as a Calculated member of the Time hierarchy, to Categories (x-axis) to the right of <#Same Month 2 Years Ago#> on the column chart.

2. Create and validate the following expression: aggregate (currentMeasure within set periodsToDate([sales_and_ marketing].[Time].[Time].[Quarter],[Latest Month])) Hints: Available Components pane\Source tab: Time dimension\Time

hierarchy\Quarter level Available Components pane\Data Items tab: Latest Month

3. Click OK to close the Calculated Member Expression dialog box.

Page 316: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

7-54 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 6. Create a calculation to return the revenue totals for the previous quarter.

1. From the Toolbox tab, drag a Query Calculation object named Total Previous Quarter, as a Set Expression of the Time hierarchy, to the right of <#Quarter-to-Period#> on the column chart.

2. Create and validate the following expression:

prevMember (parent ([Latest Month]))

Hints:

Available Components pane\Data Items tab: Latest Month

3. Click OK to close the Set Expression dialog box.

Task 7. Format the chart and test the report. 1. Click the column chart background, in the Properties pane, under

Positioning, click the box next to the Size & Overflow property, and then click the ellipsis.

2. In the Width box, type 10, in the list, click in, and then click OK.

You have changed this setting to be 10 inches.

3. On the toolbar, click Run Report to view the results.

4. Ensure that when you hover the mouse pointer over a country with data, that a tooltip appears to provide further information.

5. Close IBM Cognos Viewer and Report Studio.

6. Log off of IBM Cognos Connection.

Task 7, step 6: Do not log off of IBM Cognos Connection if you are advancing to the next module today.

Page 317: Multidimentional Authoring

8

© 2012 IBM Corporation

Advanced Drilling Techniquesand Member Sets

IBM Cognos BI

Page 318: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-2 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 319: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-3 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Objectives At the end of this module, you should be able to: understand default drill-up and drill-down

functionality identify cases when you need to override default

drilling behavior

configure advanced drilling behavior to support sophisticated use cases define member sets to support advanced drilling define member sets to support functions

Participants should be familiar with basic concepts of reporting using the dimensional style and dimensional data sources. Other modules from this course that may be useful to reference are: • Introduction to Dimensional Concepts • Introduction to Dimensional Data in Reports • Dimensional Report Context • Focus Your Dimensional Data • Calculations and Dimensional Functions

Page 320: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-4 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

What is Drilling?

Drilling lets you navigate the dimensional hierarchy up to higher-level summary

information down to lower-level detail

information

Retailers

Region

Retailer Country

Retailer Name

Retailer Site

Drilling is not on by default, but can be enabled for each report by the report author.

When drilling, the edge expressions are replaced:

drill-down: replacing the expression with children(MemberDrilled)

drill-up: replacing the expression with level(parent(MemberDrilled))

If your edge expression is complex and you do not want it replaced, you will need to configure advanced drilling behavior.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 321: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-5 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Default Drill Up and Down Behavior

[sales_and_marketing].[Products].[Products].[Product line]

Personal Accessories

Outdoor Protection

Mountaineering Equipment

Golf Equipment

Camping Equipment

Drill Down

children([Golf Equipment])

(New expression created)

and so on

Putters

Irons

When you drill down or up from the "home" position, the current expression for the drilled item is replaced.

Depending on where you are in the hierarchy, drilling down may replace the original expression with children([DrilledMember]).

Drilling up may replace the original expression with children (of the grandparent of [Drilled Member]) or if you have drilled past the leaf level and isolated a member, children(of the parent of [Drilled Member]).

For example, if you drilled down on Irons and then Hailstorm Steel Irons, Hailstorm Steel Irons would be isolated because it is the lowest level. If you then drilled up on Hailstorm Steel Irons, you would drill up to the children of Irons, the parent of Hailstorm Steel Irons, not the children of the grandparent, which would be Golf Equipment.

genware
Highlight
genware
Highlight
genware
Highlight
Page 322: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-6 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Members within Same Hierarchy

Camping Equipment is from the Product line level

Cooking Gear is from the Product type level

Drill Up Only

Cooking Gear

Camping Equipment

Drill Up or Down

Product Line level

Product Type level

Members from Different Levels of the Same Hierarchy

When two or more members from different levels in the same hierarchy are placed in a report, users by default can drill both up and down on the lowest level of detail. However, users can only drill up on members from the higher levels.

In general, you can only drill up on higher level members because drilling down on them can make lower level members ambiguous.

By default, when there are two members from different levels of the same hierarchy on a report, drilling on one of the members will also drill on the other member. For example, if you were to drill down on Cooking Gear, Camping Equipment would also be replaced with its child member.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 323: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-7 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Members from the same hierarchy drill together because all members from a single hierarchy on a report will be implicitly defined as part of the same member set. We will discuss how to explicitly define member sets later in this module.

However, if you place two members from different levels and from different branches in the same hierarchy, then drilling on one does not directly affect the other because there is no logical connection between them in the hierarchy.

genware
Highlight
genware
Highlight
Page 324: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-8 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 1Examine Default Drilling Behavior

Page 325: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-9 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 1: Examine Default Drilling Behavior

Purpose: In order to examine how and why to apply advanced drilling techniques, it is critical to understand the default drilling behavior. In this demonstration, you will create a simple crosstab report and drill up and down within multiple dimensions. You will also examine how default drilling behavior is affected when there are members from multiple levels of the same hierarchy on the report.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create a basic crosstab report with drilling enabled. 1. Add the following query items to a new crosstab:

Columns area: Time dimension\Time hierarchy\Year level

Rows area: Retailers dimension\Retailers hierarchy\Retailers level

Measures area: Measures dimension\Revenue measure

Page 326: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-10 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

2. From the Data menu, click Drill Behavior.

3. In the Drill Behavior dialog box, on the Basic tab click the Allow drill-up and drill-down check box to select it.

4. Click OK, and then on the toolbar, click Run Report.

The report appears as follows:

Notice that Retailers and the years are all underlined. This hyperlink formatting is one indication that drilling has been enabled.

Keep IBM Cognos Viewer open for the next task.

Task 2. Explore default drill-down and drill-up behavior. 1. In IBM Cognos Viewer, click Retailers.

The report drills down to a lower level of detail and appears as follows:

Retailers is the root member for the Retailers hierarchy, and drilling down returns the next level in the hierarchy: Region. By default, drilling down changes the report by replacing the item drilled on with its children. Where the initial report displayed the Retailers root member, the drilled report displays children ([Retailers]), or the Region level members.

Page 327: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-11 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

2. Right-click Asia Pacific and select Drill Down.

The report appears as follows:

Drilling down in the Retailers hierarchy from the Region level produces the next lowest level: Retailer country. Once again, the default drill-down behavior has replaced the columns with the new expression children ([Asia Pacific]) resulting in a list of countries within the Asia Pacific region.

3. On the report, click the measure intersection for Japan and 2010 labeled 75,781,108.33.

4. On the IBM Cognos Viewer toolbar, click Drill Down .

A section of the report appears as follows:

Drilling down on the intersection of Japan and 2010 changes the expression for both the rows and the columns of the report. In the rows, Japan has been replaced by its children at the Retailer name level. In the columns, 2010 has been replaced with its children at the Quarter level.

Page 328: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-12 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. Right-click any row edge in the report and click Drill Up.

The report appears as follows:

Since you drilled up on the rows only, the columns remain populated with the Quarter level. In the rows, the Retailer name level has been replaced with the level above it in the hierarchy, in this case Retailer country.

6. Close IBM Cognos Viewer.

Task 3. Examine default drill functionality on members within the same hierarchy.

1. From the Source tab\Retailers dimension\Retailers hierarchy, drag the Region level below <#Retailers#> in the Rows drop zone, as a peer of <#Retailers#> on the report layout.

Page 329: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-13 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

2. On the toolbar, click Run Report.

The report appears as follows:

Drilling is enabled for all the members of the Region level, but it is unavailable for the Retailers root member. By default, when there are members from the same hierarchy on a report, only the lowest level will have drill down enabled.

3. Click Southern Europe to drill down.

The report appears as follows:

As expected, the report has drilled down from Region to the Retailer country level. The Southern Europe member has been replaced with its children: Austria, Italy, and Spain.

Notice also that Retailers has been replaced with its child Southern Europe. Because the two members from the initial report are from the same dimensional hierarchy, by default they will drill together. By clicking Southern Europe, you drilled from Retailers to Region in the top half of the report and from Region to Retailer country in the second half of the report.

genware
Highlight
genware
Highlight
Page 330: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-14 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

4. Click Spain to drill down.

A section of the report appears as follows:

The Retailer country member Spain has been replaced by its children at the Retailer name level. In addition, because they are in the same hierarchy, the Region member Southern Europe has been replaced by its child Spain.

5. Close IBM Cognos Viewer.

Results: You have investigated how default drilling behavior allows us to replace a member on a report with its children, and how drilling up provides us with the parent level within a hierarchy. You have seen that members in different dimensions react to drilling independently, while members within the same dimension will drill together.

genware
Highlight
Page 331: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-15 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Cases for Overriding Default

Preserving some members within a hierarchy when drilling Allowing members from the same hierarchy to drill

independently Preserving part or all of a complex edge expression

sorted members calculations, such Top 3

combined calculations, such as percent of total

These are some of the business cases for needing to override default drilling behavior. Many of these business cases require both configuration of the Advanced Drilling Configuration tab and the creation of explicit member sets

genware
Highlight
genware
Highlight
genware
Highlight
Page 332: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-16 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 2Configure Advanced Drill Behavior

Page 333: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-17 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 2: Configure Advanced Drill Behavior

Purpose: You need to create a report that shows both the summary data for product lines as well as the more detailed data for each product type. You want users to be able to drill down or up on product types, but the product line members should remain on the report, unchanged by drilling. Since in default drilling behavior, members within the same hierarchy drill down together, you will accomplish the desired report by configuring the advanced drill behavior.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create a basic crosstab report and examine default drilling behavior.

1. Add the following query item to a new crosstab:

Rows area: Products dimension\Products hierarchy\Product line level

2. From the Source tab, drag the Product type level to the Rows drop zone to the right of <#Product line#>, to nest as a child.

3. From the Source tab, click View Members Tree , expand the Time folder\Time root node\2012 member, and then drag the 2012 Q 1, 2012 Q 2, 2012 Q 3, and 2012 Q 4 members to the Columns drop zone.

Page 334: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-18 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

4. From the Source tab, from the Measures dimension, drag the Revenue measure to the Measures drop zone.

5. From the Data menu, click Drill Behavior.

6. In the Drill Behavior dialog box, on the Basic tab click the Allow drill-up and drill-down check box to select it, and then click OK.

7. On the toolbar, click Run Report.

A section of the report appears as follows:

Page 335: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-19 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

8. Click Lanterns to drill down.

A section of the report appears as follows:

Notice that, in keeping with default behavior, the product line Camping Equipment is replaced with Lanterns and the other Product lines have been removed from the report. This is not the behavior you want, so you will configure advanced drilling options.

9. Close IBM Cognos Viewer.

Task 2. Configure advanced drilling options. 1. From the Data menu, click Drill Behavior.

2. Click the Advanced tab, and then click Product line to select it.

3. In the Drill-up behavior drop-down list, click Preserve.

4. In the Drill-down behavior drop-down list, click Preserve, and then click OK.

Page 336: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-20 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. On the toolbar, click Run Report.

A section of the report appears as follows:

When the user drills on the product type members, the action that will be performed on the product line is to always preserve the set. Therefore, no matter where you drill within the product hierarchy, the five product lines will remain on the report.

Keep IBM Cognos Viewer open for the next task.

Page 337: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-21 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Test the drill behavior of the report. 1. Click Binoculars to drill down.

A section of the report appears as follows:

You can see that while the expression for Binoculars was replaced with the children of binoculars, the expression for the Product line set remained the same, and all five product lines are still visible.

Page 338: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-22 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

2. Right-click Seeker 35 and then click Drill Up.

A section of the report appears as follows:

There is no change to the product line level, since you defined its advanced drill behavior to preserve the expression on drilling up. The list of binoculars products, on the other hand, still has the default drill-up behavior and returns the list of product types again.

3. Close IBM Cognos Viewer.

Results: You have successfully created a report in which the higher level of data for product lines is preserved while the user is allowed to drill up and down on for more detail at the lower level. To accomplish this, you configured the advanced drill behavior of Product line to preserve the expression on both drill up and drill down. You kept the Product type level with the default drill behavior, and so its expression was replaced during any drill-up or drill-down actions.

Page 339: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-23 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Define Member Set Structures

Member set structures define a structure for data items in a query. You can define member set structures to: enable advanced drill-up and drill-down behaviors

bind report expressionsMember set structures must have unique names to

prevent naming conflicts.

Member set structures group data items that are logically related for various actions, such as drill actions.

They can be defined as a flat list or, as a tree structure, where member sets that are in the same parent chain are considered related.

Once member set structures are created, they should be given unique names to prevent conflicts with the data items on which they are based.

genware
Highlight
Page 340: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-24 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

When Explicit Member Sets are Needed

Advanced drill behaviors:

independent drill up and down on multiple levels of the same hierarchy preserving expression functions, such as sort order

binding previously independent report expressions so that drilling up or down affects all items

Apply a single function to multiple members or sets.

Member Set Considerations:

Member set structures must have unique names in the query.

Member set structures must be manually maintained.

If a data item name changes or a data item is deleted or replaced with a new one with the same name, a member set structure based on that data item will be affected and must be recreated.

If a member set structure is referenced in a calculation and the member set structure name is subsequently changed, the calculation must be updated manually.

genware
Highlight
Page 341: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-25 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Independent Drill Up and Down

Cooking Gear

Camping Equipment Enable independent drill up and down behavior on multiple levels from one hierarchy

Drill Up Only

Cooking Gear

Camping EquipmentDrill Up or Down

Default Behavior

Advanced Drill with Explicit Member Sets

All levels in the same hierarchy

drill up and down together

Member set structures determine the set of items that are affected when drilling up and down on a particular data item.

The majority of advanced drill scenarios require member set structures.

In the slide example, member set structures override the default drill-up and drill-down behavior for the Camping Equipment and Cooking Gear data items. These data items are treated as independent objects and not as members from the same hierarchy.

Page 342: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-26 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 3Enable Independent Drilling on Members of the Same Hierarchy

Page 343: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-27 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 3: Enabling Independent Drilling on Members of the Same Hierarchy

Purpose: You want to create a report that shows revenue and profit margin measures for the last three months in 2012. You want the report to show both the high level summary information for retailer regions and the low level details for each retailer name. You want your users to drill independently on the two sections of the crosstab to examine different levels of summary and detail data in the same report. To accomplish this goal, you must override the default member set structure, create new member sets, and define the drilling behavior for those sets.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create a crosstab report with two sections. 1. Create a new crosstab report without saving the previous report.

2. From the Source tab (members tree), expand the Time folder\Time root node\2012 member\2012 Q 4 member.

3. Click the member 2012/Oct, Ctrl+click 2012/Nov and 2012/Dec, and then drag them to the Columns drop zone.

4. From the Source tab, from the Measures dimension, drag Revenue and Planned revenue to the Columns drop zone below each month.

This demo is designed to isolate the effect of creating explicit member sets. By specifying the two member sets for Region and Retailer name, the default link between them is broken and the levels will no longer drill together simultaneously. Because all explicit member sets require Advanced Drilling to be configured, you must do that task as well, but it should be noted that when setting the behavior to Replace Expression, you are requesting the default drilling behavior.

genware
Highlight
genware
Highlight
Page 344: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-28 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. From the Source tab (metadata tree view), expand the Retailers dimension\Retailers hierarchy, and then drag the Region level to the Rows drop zone.

6. From the Source tab, drag the Retailer name level to the Rows drop zone below <#Region#> as a peer.

To create a visual clue that there are two sections of the report, you will add text boxes to label the sections.

7. From the Toolbox tab, drag a Text Item to the Rows drop zone above <#Region#>, in the Text dialog box type Summary Data, and then click OK.

8. From the Toolbox tab, drag a second Text Item to the Rows drop zone between <#Region#> and <#Retailer name#>, in the Text dialog box type Detail Data, and then click OK.

9. Click the Summary Data text box, Ctrl+click the Detail Data text box, in the Properties pane, in the Font & Text section, click Font, and then click the ellipsis.

10. Change the font to 10pt, Bold and Navy.

Task 2. Create member sets and configure drill behavior. By default, since Region and Retailer name are in the same hierarchy, drilling on one section of the report will automatically drill on the other. To change this behavior, you will create distinct member sets for the two levels.

1. On the Explorer bar, point to Query Explorer, and then under Queries, click Query1.

2. In the Properties pane, under Data, click the Define Member Sets drop-down box and click Yes.

A Member Sets tab appears at the bottom of the Query Explorer.

genware
Highlight
Page 345: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-29 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

3. Click the Member Sets tab.

4. From the Source tab, drag Region to the work area.

You need to rename the member set so that it has a name distinct from the Region level.

5. In the Properties pane, under Miscellaneous, click the Name property, click after Region, press the space bar, type MS after Region, and then press Enter.

6. From the Source tab, drag Retailer name to the work area below Region MS, and rename it using the same method as step 5.

Your member set definition should appear as follows:

7. From the Data menu, click Drill Behavior, and then on the Basic tab click the

Allow drill-up and drill-down check box to select it.

8. Click the Advanced tab, in the Data items pane click Region, and then click Replace Expression for both the Drill-up behavior and Drill-down behavior drop-down lists.

9. In the Data items pane click Retailer name, and then click Replace Expression for both the Drill-up behavior and Drill-down behavior drop-down lists.

All explicitly defined member sets must have drill behavior manually defined. By selecting Replace Expression, you are requesting default drilling behavior.

10. Click OK to close the Drill Behavior dialog box.

genware
Highlight
Page 346: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-30 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Test the report and drilling behavior. 1. On the toolbar, click Run Report.

A section of the report appears as follows:

Both the Regions and the Retailer names have been underlined since drill up and drill down have been explicitly defined for each of them.

Page 347: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-31 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

2. Right-click Americas, and then click Drill Up.

IBM Cognos drills up from Americas to show the root member of the Retailer hierarchy, Retailers.

A section of the report appears as follows:

The summary data section has drilled up to the Retailers root member, but the detail data section remained at the Retailer name level. By explicitly defining two separate member sets, the two levels drill independently.

genware
Highlight
Page 348: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-32 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

3. Click VIP Department Stores to drill down on that retailer.

A section of the report appears as follows:

Once again, IBM Cognos has drilled down from VIP Department Stores to show the data at the Retailer site level, but the summary data section remains at Retailers. The two sections now drill independently.

4. Close IBM Cognos Viewer.

Results: You have created a report that shows both summary level data and detail data. Using explicitly defined member sets and advanced drilling options, you have allowed the user to drill independently up and down on the different areas of the report.

Page 349: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-33 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Bind Report Expressions

children([Products])

order([Products Set], tuple([Revenue], [2012]), desc)Sorted Products Expression

Product Set Expression

based on By default, when you drill down,

the underlying expression is replaced, removing the

desired order

children([DrilledMember])Default Drilled Expression

Member set structures can bind report expressions.

By binding report expressions, all items are affected when a user drills up or down on one data item.

When you drill down on Sorted Products, by default the expression is replaced with the children of the member drilled upon. Instead, you want to preserve the expression but replace the underlying Product Set expression. By doing this, you are sorting the children of the next level down from Products.

genware
Highlight
genware
Highlight
genware
Highlight
Page 350: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-34 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Bind Report Expressions (cont'd)

children([Products])

order([Product Set], tuple([Revenue], [2012]), desc)

Sorted Products Expression

Product Set Expression

children([Camping Equipment])

order([Product Set], tuple([Revenue], [2012]), desc)

Sorted Products Expression

Product Set Expression

Drill Down on

Camping Equipment Preserve Expression

Replace Expression

By default, when you drill down on Ordered Product Set, the expression is replaced, removing the order function and replacing it with the children function.

Instead you want to preserve the Ordered Product Set expression; you can do this in advanced drill behavior configuration.

Explicit member sets are also needed so that drilling down on Ordered Product Set is bound to the Product Set expression. When ordered product set is drilled down, its expression is preserved, but its nested set - the Product Set within it - drills down to children([Product Set]).

Point out that the Product Set expression changed from children([Products]) to children ([Camping Equipment]). The Sorted Products expression syntax is preserved by now sorts on the children of Camping Equipment instead of Products. The Preserve and Replace Expression labels are the actual setting names in the advanced drill up and down behavior configuration.

genware
Highlight
Page 351: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-35 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 4Preserve Order When Drilling Up or Down

Page 352: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-36 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Demo 4: Preserve Order When Drilling Up or Down

Purpose: Report consumers want a report for product revenue that is sorted in descending order for the latest year in the data. When they drill up or down on the product items, they want the sort order maintained.

You will use dimensional expressions and member set structures to create a report that preserves its sort order when drilling up or down.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create a crosstab report. 1. Add the following query items to a new crosstab:

Columns area: Time dimension\Time hierarchy\Year level

Rows area: Products dimension\Products hierarchy\Product line level

Measures area: Measures dimension\Revenue measure

Page 353: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-37 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

2. On the toolbar, click Run Report.

The report appears as follows:

By default, the product lines appear in the report in the order specified by the cube. You will sort the product lines by revenue in 2012.

3. Close IBM Cognos Viewer.

Task 2. Sort the crosstab report using dimensional functions. 1. In the report layout, click <#Product line#>, and on the toolbar click Delete.

2. From the Toolbox tab, drag a Query Calculation object named Products Set, as a Set Expression of the Products hierarchy, to the Rows drop zone.

3. Create and validate the following expression:

children ([Products])

Hints:

Available Components pane\Source tab (members tree view): Products root node

4. Click OK to close the Set Expression dialog box.

5. In the report layout, click <Products Set>, and from the toolbar, click Cut.

This action removes Products Set from the report layout but keeps it in the query. You need to keep this item in the query as the next expression you create, Sorted Products, references it. You will add a Sorted Products Query Calculation to the report to order product data by revenue for 2012.

Task 2, step 3: In dimensional reporting, there are many ways to achieve the same results. In this demo, we are using children ([Products]), however the Products Set expression could instead have referenced the Product line level, since a level is also considered as a member set.

Page 354: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-38 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

6. From the Toolbox tab, drag a Query Calculation object named Sorted Products, as a Set Expression of the Products hierarchy, to the Rows drop zone.

7. Create and Validate the following expression:

order([Products Set], tuple([Revenue], [2012]), desc)

Hints:

Available Components pane\Data items tab: Products Set Available Components pane\Data items tab: Revenue

Available Components pane\Source tab (members tree view)\Time folder\Time root node\2012 member

The desc syntax indicates that items will be sorted in descending order. The tuple function identifies an intersection within the cube. In the expression above, the tuple evaluates the Revenue measure value for the combination of each Products Set member and the year 2012. The tuple function allows us to specify which year column to use for sorting. Without this reference, the default or root member of the Years dimension is used (in this case Years, which represents a roll up of all years).

8. Click OK to close the Set Expression dialog box.

9. On the toolbar, click Run Report.

The report appears as shown below:

The product lines now appear in descending order by their revenue in 2012.

10. Close IBM Cognos Viewer.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 355: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-39 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Create member set structures and configure advanced drill behavior.

You will use member set structures to bind the Sorted Products and Products Set data items together. This way, when you drill down on Sorted Products you can change the underlying Products Set expression. You will use two drill behavior settings: Replace Expression (for Products Set) and Preserve (for Sorted Products). By combining the member set structure and advanced drill behavior configuration, you can maintain the sort order on revenue for 2012 when drilling down on Sorted Products.

1. On the Explorer bar, point to Query Explorer, under Queries click Query1, and then in the Properties pane, under Data, change the Define Member Sets property to Yes.

2. At the bottom of the query work area, click the Member Sets tab, and then from the Source tab, drag Products Set to the Member Sets work area.

3. From the Source tab, drag Sorted Products on top of the Products Set member set to nest it.

4. Rename each member set by appending the member set Name property with MS.

The member set structure appears as shown below:

The underlying data items (Products Set and Sorted Products) are now bound together. You can now configure advanced drill behaviors for the underlying data items.

genware
Highlight
genware
Highlight
genware
Highlight
genware
Highlight
Page 356: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-40 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. From the Data menu, click Drill Behavior, and then on the Basic tab click the Allow drill-up and drill-down check box to select it.

6. Click the Advanced tab, and then in the Data items pane, click Products Set.

7. Change the Drill-up behavior and Drill-down behavior to Replace Expression.

The drill-up and drill-down behavior settings appear as shown below:

8. In the Data items pane, click Sorted Products, and then change the Drill-up

behavior and Drill-down behavior to Preserve.

Now when you drill up or down, the Sorted Products expression is not changed and the order function remains in place while the Products Set expression changes and is replaced by the children of the selected member.

9. Click OK to close the Drill Behavior dialog box.

genware
Highlight
Page 357: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-41 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 4. Test the report. 1. On the toolbar, click Run Report.

The report appears as follows:

The product lines are sorted by revenue for 2012.

2. Drill down on Camping Equipment.

The report appears as follows:

The children of Camping Equipment (at the Product type level) are still sorted by revenue for 2012.

Page 358: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-42 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

3. Drill down on Tents.

The report appears as follows:

The children of Tents (at the Product name level) are still sorted by revenue for 2012.

4. Drill down on Star Dome.

The report appears as follows:

Because Star Dome is at the Product name level, the lowest level in the hierarchy, drilling down returns the single member alone, and drilling down further is disabled.

5. Close IBM Cognos Viewer.

Results: Using dimensional expressions in conjunction with member set structures, you created a report that preserves the sort order when drilling up or down.

Page 359: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-43 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Synchronized Drill Up and Down with Multiple Queries

Drilling down onthe chart is reflectedin the crosstab

Although synchronized drill up and down behavior between containers can be achieved through using one query and member sets, while effective, this method takes some time to set up. It also makes applying different filters for each container a little more difficult.

With dimensional data sources, you can link groups of data items from different queries in a report, so that when you drill up or down on one query, data items in the other query simultaneously also drill up or down. The linked items must be based on the same item in each query for expected behavior.

genware
Highlight
genware
Highlight
genware
Highlight
Page 360: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-44 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 5Synchronized Drill Up and Drill Down Behavior

Page 361: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-45 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 5: Synchronized Drill Up and Down Behavior

Purpose: Consumers would like a report that synchronizes the drill up and drill down behavior on a dashboard-style report. In order to achieve this, you will use the Data Items linking feature.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report Type: Chart

Task 1. Create a report with a chart and a crosstab. 1. From the File menu, click New, click No to saving the report, and then

double-click Chart.

2. In the Insert Chart dialog box, in the right pane, click Clustered Column

with 3-D Effects , and then click OK.

3. Add the following query items to the new chart:

Default measure (y-axis) drop zone: Measures dimension \Revenue

Series (primary axis) drop zone: Product dimension\Product hierarchy\Product line level

Categories (x-axis) drop zone:

Time dimension\Time hierarchy\Year level

4. From the Toolbox tab, drag a Crosstab object below the chart.

genware
Highlight
Page 362: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-46 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. Add the following query items to the new crosstab:

Columns area: Time dimension\Time hierarchy\Year level

Rows area: Products dimension\Products hierarchy\Product line level Order method dimension\Order method hierarchy\Order method

type level (to the right of Product line to nest as a child) Measures area:

Measures dimension\Revenue

The results appear as follows:

Page 363: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-47 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 2. Enable drill up and down behavior. 1. From the Data menu, click Drill Behavior.

2. On the Basic tab, select Allow drill-up and drill-down, and then click OK.

3. On the toolbar, click Run Report, and then drill down on 2012 on the chart.

Notice that the crosstab is not affected when drilling.

4. Close IBM Cognos Viewer.

Task 3. Link data items to enable synchronized drill up and down behavior.

1. From the Data menu, click Drill Behavior.

2. Click the Data Items Linking tab.

3. From Query1, drag Year to the Linked data items pane.

4. From Query2, drag Year to the Drop item here drop zone.

5. Repeat steps 3 and 4 for Product Line.

The results appear as follows:

6. Click OK.

genware
Highlight
Page 364: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-48 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

7. On the toolbar, click Run Report, and then drill down on 2012 on the chart.

A section of the report appears as follows:

Notice that the crosstab now reflects the drill action of the chart.

8. Continue to drill up and down on either the chart or crosstab to observe the synchronized drill up and down behavior.

9. Close IBM Cognos Viewer.

Results: By enabling drill up and down behavior and linking common data items between report objects, you were able to provide a dashboard-style report that synchronizes drill up and down behavior.

Page 365: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-49 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Apply One Function to Member Sets

ProductsSales TerritoryOrder Method

MySetMySetMySet

Default Member Set Structure Names

Renamed to a Single Name

rank(currentMeasure tuple [2012] within set [MySet])

Referenced inOne Function

You can also rename member set structures to apply one function to several member sets. The member set structure can be referenced in functions within your report expressions.

When you reference a member set structure in a calculation, you must manually type it in as it is not available as a selection anywhere in the UI. If you change a member set structure name, you must manually update the reference in the calculation.

genware
Highlight
genware
Highlight
genware
Highlight
Page 366: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-50 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 6

Apply a Single Function to Multiple Member Sets

Page 367: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-51 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 6: Apply a Single Function to Multiple Member Sets

Purpose: Consumers want to see sales revenue ranked for various aspects of the business. You will use member sets to apply one instance of the rank function to several member sets.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create a crosstab report with multiple levels from different dimensions.

1. Add the following query items to a new crosstab:

Columns area: Time dimension\Time hierarchy\Year level

Measures area: Measures dimension\Revenue measure

Page 368: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-52 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

2. From the Toolbox tab, drag a Query Calculation object named Product Line Members, as a Set Expression of the Products hierarchy to the Rows drop zone.

3. Create and validate the following expression:

members ([sales_and_marketing].[Products].[Products].[Product line])

You apply the members function because the Rank function that will be used later in the demo expects members as a parameter.

Hints:

Available Components pane\Source tab: Products dimension\Products hierarchy\Product line level

4. Click OK to close the Set Expression dialog box.

5. Repeat steps 2-4 to add Query Calculations named Region Members (Retailers hierarchy, the expression using Region level), and Order Method Type Members (Order method hierarchy, the expression using Order method type level), that use the member function.

Add the Region Members and Order Method Type Members calculations as peers to <Product line Members> so that the report layout will appear as follows:

Hints:

Available Components pane\Source tab: Retailers dimension\Retailers hierarchy\Region level

Available Components pane\Source tab: Order method dimension\Order method hierarchy\Order method type level

Page 369: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 201

or translated into

6. From the Toolbox tab, drag a Crosstab Space object to the Rows zone between <Product Line Members> and <Region Members>.

7. From the Toolbox tab, drag a Crosstab Space object to the Rows zone between <Region Members> and <Order Method Type Members>.

The report appears as follows:

Task 2. Create member sets with same name. 1. On the Explorer bar, point to Query Explorer, and then under Queries, click

Query1.

2. In the Properties pane, under Data, change the Define Member Sets property to Yes.

3. Click the Member Sets tab, and then from the Source tab, drag Product Line Members, Region Members, and Order Method Type Members to the work area.

The member set structures appear as shown below:

2, IBM Corporation 8-53 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

another language without a legal license agreement from IBM Corporation.

Page 370: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-54 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

4. In the work area, click Product Line Members, and then in the Properties pane, under Miscellaneous, rename Product Line Members to MySet.

5. Repeat step 4 to rename the remaining member set structures to MySet.

The member set structures appear as shown below:

Task 3. Create a rank function and reference the new common member set structure name.

1. On the Explorer bar, point to Page Explorer, and then click Page1.

2. From the Toolbox tab, drag a Query Calculation object named Rank in 2012, as a Set expression, to the right of the second <#Year#> column as a peer.

3. Create and validate the following expression:

rank (currentMeasure tuple [2012] within set [MySet])

The tuple syntax specifies that the rank of the members in MySet will be based on the intersection values of currentMeasure and 2012. Notice the reference to the MySet member set structures you created earlier. This function is applied to all three underlying member sets that now have the same member set structure name.

Hints:

Available Components pane\Source tab (members tree view): Time folder\Time root node\2012 member

Task 3, Step 2: You could try declaring the Time hierarchy at this step.

genware
Highlight
Page 371: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-55 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

4. Click OK to close the Set Expression dialog box.

5. On the toolbar, click Run Report.

The report appears as follows:

Notice that the values for 2012 and Rank are not sorted. You can accomplish this by using the order function on each individual set of the crosstab rows.

6. Close IBM Cognos Viewer.

Page 372: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-56 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 4. Sort the rank column. 1. In the report layout, right-click <Product Line Members>, click Edit Set,

and then double-click Set Expression.

2. Create and validate the following expression:

order (members([sales_and_marketing].[Products].[Products].[Product line]), tuple ([2012],[Revenue]), Desc)

Hints:

Available Components pane\Data Items tab: 2012 Available Components pane\Data Items tab: Revenue

3. Click OK to close the Set Expression dialog box, and then click OK to close the Set Definition dialog box.

4. Repeat steps 1-3 to sort Region Members and Order Method Type Members.

Page 373: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-57 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

5. On the toolbar, click Run Report.

The report appears as shown below:

The values for 2012 are sorted in descending order. The Rank column is also sorted also since the ranking is based on revenue values for the year 2012.

6. Close IBM Cognos Viewer.

Results: By renaming member set structures to use a common name, you applied one instance of the rank function to several members sets.

Page 374: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-58 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Summary At the end of this module, you should be able to: understand default drill-up and drill-down

functionality identify cases when you need to override default

drilling behavior

configure advanced drilling behavior to support sophisticated use cases define member sets to support advanced drilling define member sets to support functions

Page 375: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-59 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Workshop 1Create a Report with Drillable Complex Functions

Page 376: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-60 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Create a Report with Drillable Complex Functions

Channels management wants to have a report that shows the top three members from the product hierarchy based on revenue, totals for members not shown in the report, and overall totals. They want the ability to drill up and down on products.

To do this, you must:

use dimensional functions to identify the top three product lines

create aggregates for products shown on the report and for products excluded from the report

enable drilling and configure advanced drill behavior such that the dimensional functions are preserved while the user drills up and down in the product hierarchy

For more detailed information outlined as tasks, see the Task Table section.

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

Page 377: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-61 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Task Table

Task 1: Create the base crosstab report. Where to Work Hints

File menu Create a new crosstab report, using the Public Folders\Samples\Cubes\Sales and Marketing (cube) package.

Source tab Measures area: Measure dimension\Revenue

Columns area: Year dimension\Year hierarchy\Year level

Toolbox tab Set Expression dialog box\Expression Definition box

Rows: Query Calculation for Products Set:

Set expression Products hierarchy children([Products])

Task 2: Create a query calculation to show the top three product members. Where to Work Hints

Toolbox tab

Set Expression dialog box\Expression Definition box

Rows: as a peer to <Products Set>, Query Calculation for Top Products:

Set expression Products hierarchy topCount([Products Set],3,[Revenue])

Report layout\ toolbar Cut Products Set from the report layout.

Run Report.

IBM Cognos Viewer Close IBM Cognos Viewer.

Page 378: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-62 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 3: Create query calculations to show overall summaries and summaries for excluded members.

Where to Work Hints

Toolbox tab

Calculated Member Expression dialog box\Expression Definition box

Rows:

as a peer to <Top Products>, Query Calculation for Summary:

Calculated member Product Hierarchy aggregate(currentMeasure within set [Products

Set])

as a peer above Summary, Query Calculation for Excluded:

Calculated member Product Hierarchy aggregate(currentMeasure within set

except([Products Set],[Top Products])) Task 4: Enable drilling up and drilling down. Where to Work Hints

Data menu\Drill behavior

Enable Allow drill-up and drill-down.

Toolbar On the toolbar, click Run Report.

IBM Cognos Viewer Test the report.

Close IBM Cognos Viewer.

Page 379: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-63 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 5: Create member sets to enable advanced drill behavior. Where to Work Hints

Query Explorer\ Query1\Properties pane

Change Define Member Sets property to Yes.

Drag Products Set to the work area.

Query Explorer\ Query1\Member Sets tab

Drag the following items on top of Products Set in the work area:

Top Products Total Excluded

Query Explorer\ Query1\Properties pane

Change the Name property of each item to add MS to the end.

Data menu\ Drill Behavior\ Advanced tab

Configure advanced drilling behavior:

Set Drill-up behavior and Drill-down behavior to Replace Expression for Products Set.

Set Drill-up behavior and Drill-down behavior to Preserve for Top Products, Summary, and Excluded.

Toolbar Run Report.

IBM Cognos Viewer Drill down on Camping Equipment.

Close IBM Cognos Viewer, Report Studio and IBM Cognos Connection.

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

Page 380: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-64 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Results

The result of the workshop is a report that appears as follows:

When you drill down on Camping Equipment, the report appears as follows:

Page 381: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-65 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Workshop1: Step-by-Step Instructions

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube) Report type: Crosstab

Task 1. Create the base crosstab report. 1. Add the following query items to a new crosstab:

Columns area: Time dimension\Time hierarchy\Year level

Measures area:

Measures dimension\Revenue measure

2. From the Toolbox tab, drag a Query Calculation object named Products Set, as a Set expression of the Products hierarchy, to the Rows drop zone.

3. Create and validate the following expression:

children ([Products])

Hints:

Available Components pane\Source tab: Products dimension\Products hierarchy\Members folder\Products member

4. Click OK to close the Set Expression dialog box.

Page 382: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-66 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. On the toolbar, click Run Report.

The report appears as shown below:

You see totals for all children of the Products member and values for each year in the data. You want to modify this report so that you see values for only the top three product lines, a summary for excluded members, and an overall summary. You will implement these items over the next few tasks.

6. Close IBM Cognos Viewer.

Task 2. Create a query calculation to show the top three product members.

1. From the Toolbox tab, drag a Query Calculation object named Top Products, as a Set expression of the Products hierarchy, to the Rows below <Products Set>.

2. Create and validate the following expression:

topCount ([Products Set],3,[Revenue])

Hints:

Available Components pane\Data Items tab: Products Set

Available Components pane\Data Items tab: Revenue

3. Click OK to close the Set Expression dialog box, and then click OK to close the Set Definition dialog box.

Page 383: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-67 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

4. Cut <Products Set> from the report layout.

5. On the toolbar, click Run Report.

The results appear as follows:

Only the top three product lines are returned.

6. Close IBM Cognos Viewer.

Task 3. Create query calculations to show overall summaries and summaries for excluded members.

1. From the Toolbox tab, drag a Query Calculation object named Summary, as a Calculated member of the Products hierarchy, to the Rows under <Top Products>.

2. Create and validate the following expression:

aggregate (currentMeasure within set [Products Set])

This expression returns the totals for all product members.

Hints:

Available Components pane\Data Items tab: Products Set

3. Click OK to close the Calculated Member Expression dialog box.

You will create a calculation to show the totals for members not shown. You will use the except() function to filter out the top products in our aggregation.

4. From the Toolbox tab, drag a Query Calculation object named Excluded, as a Calculated member of the Products hierarchy, to the Rows above Summary.

Page 384: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-68 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. Create and validate the following expression:

aggregate (currentMeasure within set except ([Products Set],[Top Products]))

This expression aggregates the totals of all product members with the exception of the top three product members and subtracts the value from the summary of all products.

Hints:

Available Components pane\Data Items tab: Products Set

Available Components pane\Data Items tab: Top Products

6. Click OK to close the Calculated Member Expression dialog box.

With large data sets, the Excluded summary expression using the except() function may perform slowly. If performance becomes an issue, you could alternately use the calculation below:

[Summary] - aggregate(currentMeasure within set [Top Products])

This expression accomplishes the same result by taking the totals from the top three products and subtracting them from the totals of all products.

To use this type of expression, you must know your data well to ensure accurate values are returned. For example, you must know whether the default roll up for your measures are sum, average, min, and so on, to know what results to expect. You should also talk to your data modeler (Framework Manager modeler for DMR and cube modeler for OLAP) to ensure that there are no configurations in the data source that may return unexpected results.

Task 4. Enable drilling up and drilling down. 1. From the Data menu, click Drill Behavior.

2. On the Basic tab, select the Allow drill-up and drill-down check box, click OK, and then on the toolbar, click Run Report.

Page 385: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-69 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

3. In the report, drill down on Camping Equipment.

The report appears as shown below:

There are two issues with this report. First, the number of visible items exceeds three members, which is the limit you set when creating the Top Products expression. Second, the values for Excluded and Summary did not change when you drilled down on Camping Equipment.

These expressions directly or indirectly reference the Products Set expression. The Products Set expression uses the syntax children([Products]).

You did not define member set structures to bind the expressions together. You also did not configure advanced drill-up and drill-down behaviors to replace the Products Set expression while preserving the expressions that reference it.

Currently, when you drill down, you lose the Top Products expression in the crosstab and simply return the children of the Camping Equipment member. The Excluded and Total expressions use the original expressions they reference to retrieve their values, which explains why their values did not change after you drilled down.

4. Close IBM Cognos Viewer.

Page 386: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-70 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 5. Create member sets to enable advanced drill behavior.

1. On the Explorer bar point to Query Explorer, and then under Queries click Query1.

2. In the Properties pane under Data, change the Define Member Sets property to Yes.

3. Click the Member Sets tab.

You will bind Products Set with the other expressions that reference it.

4. From the Source tab, drag Products Set to the work area.

5. From the Source tab, drag Top Products, Summary and Excluded onto Products Set in the work area.

6. Rename each member set by appending the Name property with MS.

Top Products MS, Summary MS, and Excluded MS are nested as children of Products Set MS.

The member set structure appears as shown below:

7. From the Data menu, click Drill Behavior, and then click the Advanced tab.

8. In the Data items pane, click Products Set, and then change Drill-up behavior and Drill-down behavior to Replace Expression.

Page 387: Multidimentional Authoring

ADVANCED DRILLING TECHNIQUES AND MEMBER SETS

© 2007, 2012, IBM Corporation 8-71 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

9. Repeat step 8 for the Top Products, Summary, and Excluded data items using the Preserve setting.

10. On the Basic tab, select the check boxes to disable drill-up and drill-down for Summary and Excluded.

11. Click OK to close the Drill Behavior dialog box.

Page 388: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

8-72 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

12. On the toolbar, click Run Report, and then drill down on Camping Equipment.

The report appears as shown below:

Only three child members from the Camping Equipment member are shown on the rows of the report.

Values for the Excluded and the Total data items changed to reflect the level to which you have drilled.

13. Close IBM Cognos Viewer and then close Report Studio without saving the report.

14. Log off of IBM Cognos Connection.

Task 5, step 12: Do not log off of IBM Cognos Connection if you are advancing to the next module today.

Page 389: Multidimentional Authoring

9

© 2012 IBM Corporation

Set Up Drill-through Reports

IBM Cognos BI

Page 390: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-2 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 391: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-3 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Objectives At the end of this module, you should be able to: navigate from a specific report to a target report drill down to greater detail and then navigate to a

target report

navigate between reports created using different data sources

Participants should be familiar with basic concepts of reporting using the dimensional style and dimensional data sources. Other modules from this course that may be useful to reference are: • Introduction to Dimensional Concepts • Introduction to Dimensional Data in Reports • Dimensional Report Context • Focus Your Dimensional Data • Calculations and Dimensional Functions • Advanced Drilling Techniques and Member Sets

Page 392: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-4 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Granite Shovel

Granite Hammer

Granite Ice

Granite Chalk Bag

Firefly Rechargeable Battery

Product

6,306,347.20Tools

2,734,308.88Climbing Accessories

Mountaineering Equipment

2005

2,421,545.46

4,326,684.18

960,521.94

RevenueProduct typeProduct lineYear

4,471,025.2610,349,175.8425,008,574.0836,165,521.07Outdoor Protection

352,910,329.97500,382,422.83402,757,573.17332,986,338.06Camping Equipment

141,520,649.70

174,740,819.29

443,693,449.85

2007

161,039,823.26

230,110,270.55

594,009,408.42

2006

107,099,659.94Mountaineering Equipment

168,006,427.07153,553,850.98Golf Equipment

456,323,355.90391,647,093.61Personal Accessories

20052004Revenue

What is Drill-through Access?

Target Report

Source Report

You can set up drill-through access to let users navigate from one report to another report to view related data that will help them answer their business questions. You can create drill-through source and target reports using a variety of report types, including lists, crosstabs, charts, and map reports.

You can set up drill-through access from a report, or for a package.

Target reports may contain parameters, which act as placeholders, and require values to be passed from the source report when users drill through. The values the source report passes depend on where users drill through from. This means that when users drill through, the target report is filtered to display only the data of interest to the user.

A note of caution, for drill-through scenarios, after a broken MUN reference is fixed, the report may pass the wrong parameter to the target report.

Page 393: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-5 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Source Report

(Created in Report Studio)

Target Report

(Created in Report Studio,

Analysis Studio, Query Studio, or Business Insight

Advanced)

Drill through to a target report to

view related data

Drill-through Access from a Report

In the source report, select the cells you want users to drill through from, and then set up drill-through access to the target.

When you run the source report, the cells you selected become links that users can click to drill through.

You must create the target report before you can set up drill-through access.

The following drill-through combinations are acceptable: Relational to Relational DMR to Relational DMR to DMR OLAP to Relational OLAP to DMR OLAP to OLAP

Page 394: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-6 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

TargetReport

Reports created using the Sales and Marketing (cube) package

Analysis Studio Report

Query Studio Report

Report Studio Report

A

Report Studio Report

B

Drill-through Access for a Package

Workspace Advanced

Report

To let users navigate to a specific target report from reports, analyses, and queries created using a package, you can create a drill-through definition for the package.

The source reports do not need to be created when you create the drill-through definition. This lets you set up drill-through access for the target report, and then later create as many source reports as you require.

Each package drill-through definition can have only one target. You can create multiple drill-through definitions for a package.

You can set permissions properties for target reports to determine which users will be able to open them when they attempt to drill through. You can also set permissions properties for drill-through definitions to determine which users have access to these drill-through definitions.

Targets can be reports or packages

In the slide example, a drill-through definition has been created for the Sales and Marketing package. Users can drill through to the target report from a variety of reports created using the same package. Data modelers publish packages from models they create in Framework Manager. Report authors then use these packages to add data to their reports.

.

Page 395: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-7 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Steps to Set Up a Package-based Drill-through Definition

1. Create the target report.

Create the target report*

Add a parameter to the target report*

2. Create the drill-through definition.

Select the package

Limit the data items from which users can drill through*

Select the target report

Map the parameter values passed to

the target report if needed, or specify

dynamic filtering of target*

3. Drill through tothe target report.

Create a report, using the source

package

Drill through to view related data in

the target report

The target report appears and

displays filtered data

Save the target report

Hide the target report*

* Optional

Before you can set up drill-through access for a package, you must have the target report created. Next, create a drill-through definition that lets users navigate to the target report from reports created using the package. To let users drill through from a Report Studio report using a package drill-through definition, you must enable this drill behavior in the source report.

This slide gives a high-level understanding of this process. The demos will go through this process in detail. When you set up drill through for a package, the following steps are optional: • Create the target report (may be done by a different report author). • Add a parameter to the target report. • Hide the target report. • Limit the data items from which users can drill through. • Map the parameter values passed to the target report, or specify dynamic filtering.

Page 396: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-8 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Specify the Values Passed to Target Parameters

Report-based drill-through definition

Parameters in the target report

Values passed from the source report

Package-based drill-through definition

Properties passed from the source report

When you set up drill-through access, you must map the values that the source report will pass to the target parameters.

If you do not specify which values to pass to target parameters, then when users drill through they will be prompted to select values for any required target parameters.

When dealing with dimensional sources, you can also select which property of the member you would like to pass to the target report (for example: Member Unique Name, Member Caption, and Business Key). It is important to know which values are conformed between the source report and the target report data sources.

Page 397: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-9 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Member-to-Member Drill-through Access

To set up drill-through access between members, in the target report create a parameter using a level or a hierarchy, and then let users drill through from members in source reports.

A parameter created using this level will

expect a specificProduct line member

When users drill through, the target parameter will expect to receive a member. You can set up member-to-member drill-through access when working with:

packages published from OLAP data sources, such as IBM Cognos PowerCubes

packages published from relational data sources that data modelers have modeled dimensionally (called Dimensionally Modeled Relational, or DMR, data sources)

When you create a drill-through definition for a package, you know that a parameter in the target report expects a member if, in the Parameter mapping area, the Type for the parameter will be "Member". When you set up drill-through access from a specific Report Studio report, you know that a parameter in the target report expects a member if, in the Parameters dialog box, the Type for the parameter is "memberUniqueName".

When you create a drill-through definition for a package, you know that a parameter in the target report expects a member if, in the Parameter mapping area, the Type for the parameter will be "Member". When you set up drill-through access from a specific Report Studio report, you know that a parameter in the target report expects a member if, in the Parameters dialog box, the Type for the parameter is "memberUniqueName".

Page 398: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-10 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 1Set Up Member-to-Member Drill-through Access

Page 399: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-11 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 1: Set Up Member-to-Member Drill-through Access

Purpose: The Sales department has requested a report displaying information about the performance of each order method for different retailers. You will create a drill-through definition to let users drill through to view data for a particular retailer type.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples\Cubes\Sales and Marketing (cube) Report type: List

Task 1. Create the target report. 1. Add the following query items to a new list:

Retailers dimension\Retailers hierarchy\Retailer name, Retailer site Order method dimension\Order method hierarchy\Order method type Measures dimension\Revenue, Planned revenue

Page 400: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-12 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 2. Add a parameter, and then save the report. Each level in this package contains a set of members. You will create a parameter that expects a member from the Retailer country level.

1. Fro the Source tab, expand the Retailers dimension\Retailers hierarchy\Retailer country level\Members folder.

You can see that the Retailer country level contains a member for each retailer country.

A section of the tree appears as shown below:

You will create a parameter that expects one of these members. Since this target report is based on multidimensional data, you will use a multidimensional technique to create the parameter. You will create a query calculation that includes a parameter for Retailer country as the first column of the report.

2. From the Toolbox tab, drag a Query Calculation object named Selected Retailer Country, as a Set expression of the Retailers hierarchy, to the left of Retailer name column on the report.

Page 401: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-13 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

3. Create and validate the following expression:

[sales_and_marketing].[Retailers].[Retailers].[Retailer country]->?retail country?

Hints:

Available Components pane\Source tab: Retailers dimension\Retailers hierarchy\Retailer country level

Validate using Australia

4. Click OK to close the Set Expression dialog box.

5. On the report layout, click Selected Retailer Country, Ctrl+click Retailer name, and Retailer site, and then on the toolbar, click Group / Ungroup.

6. On the report layout, click the Revenue column, Ctrl+click Planned revenue, on the toolbar, click Summarize, and then in the drop-down menu click Total.

A section of the report layout appears as follows:

7. From the File menu, click Save, and then navigate to My Folders.

8. In the Name box, type Module9_Demo1_Target, and then click Save.

You will create a drill-through definition to let users drill through to this report from other reports created using the Sales and Marketing package.

Page 402: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-14 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Create a drill-through definition for the package. If you are on the IBM Cognos Welcome Page, click IBM Cognos content to go to IBM Cognos Connection.

1. In IBM Cognos Connection, from the Launch menu, click Drill-through Definitions.

2. Navigate to Public Folders\Samples_PowerCube\Cubes\Sales and

Marketing (cube), and then click New Drill-through Definition .

3. In the Name box, type Module 9 Demo 1 Drill-through Definition, and then click Next.

Since the target report contains a parameter for the Retailer country level, you want to make sure users can drill through only from cells that have a specific Retailer country as their context.

4. Click Set the scope, and expand the Retailers dimension.

You can also set the scope to a measure.

5. Click the Retailer country level, and then click OK.

6. Click Set the target, navigate to My Folders, click Module9_Demo1_Target, and then click OK.

7. Click Next.

The Specify the target details page appears and displays the retail country parameter you created in the target report as shown below:

Page 403: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-15 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

You know that this parameter expects a MUN because the type displayed for this parameter (in the Type column) is memberUniqueName.

You will specify that when users drill through, a member from the Retailer country level will be passed to this parameter.

8. Beside the retail country parameter, in the Source metadata item list, click

Set the value .

9. Expand the Retailers dimension, click the Retailer country level, and then click OK.

In the Source metadata item properties list, because you are working with OLAP data sources in both reports, there is no need to define the setting of the properties which will be passed. When drilling through from a dimensional data source to a dimensional data source, the default is to pass the member unique name.

10. Click Finish.

You will test this drill-through definition by drilling through from a report created in Report Studio using the Sales and Marketing package.

Task 4. Test the drill-through definition. 1. Maximize Report Studio, from the File menu, click New, and then double-

click List.

2. Add the following query items to the new list.

Retailers dimension\Retailers hierarchy\Retailer country Measures dimension\Quantity.

Before users can drill through from this report to drill-through targets created for the Sales and Marketing package, you must enable this behavior for the report.

Page 404: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-16 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

3. From the Data menu, click Drill Behavior, on the Basic tab, ensure that the Allow this report to be a package-based drill-through source check box is selected, and then click OK.

4. On the toolbar click Run Report.

You want to navigate to the target report to view more details about sales in Korea.

5. In the report, right-click Australia, point to Go To, and click Related Links.

The drill-through definition that you created (Module 9 Demo 1 Drill-through Definition) appears in the list.

Before you click the target to drill through, you can perform some troubleshooting to identify if the correct parameters will be passed to the target report.

6. Expand the Go to window, and then click View passed source values.

The drill-through values are shown as follows:

Page 405: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-17 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Because this drill-through passes a member from the source to the target, a MUN representing the Australia member is passed. In following demos, be sure to check the passed source values to see what type of data is being passed.

7. Under Available links, click Module 9 Demo 1 Drill-through Definition.

IBM Cognos drills through to the Module9_Demo1_Target report.

A section of the report appears as follows:

8. In the report, click Bottom and observe that the report displays data for only

Australia.

Drill-through access works as expected.

9. Close both IBM Cognos Viewer windows.

Results: You created a drill-through definition to let users drill through from reports created using the Sales and Marketing package to a target report displaying data for a specific retailer country. You let users drill through from members in the source report to a parameter in the target report that expected a member.

Page 406: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-18 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Drill Down then Drill Through

Product Line

Data

Golf Equipment

Data

Source Report

Source Report

Drill down to view data for Golf

Equipment

Golf Equipment

Data

Target Report

Drill through to view related data

for Golf Equipment

When you create a drill-through definition for a package containing dimensional data, you can let users drill down within a hierarchy, and then drill through from members at any level in the hierarchy.

This lets users explore source reports at different levels of detail before drilling through to view related data.

An example, would be to let users explore product data in an OLAP package at different levels of detail and then drill through from any level, create a parameter in the target report using the Products hierarchy.

A parameter created using an OLAP hierarchy will accept values passed from members at any level within the hierarchy

Page 407: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-19 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 2Let Users Drill Down and Then Drill Through

Page 408: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-20 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Demo 2: Let Users Drill Down and Then Drill Through Purpose: You have been asked to create a chart that compares the quantity of products sold in different years by each order method. You will create a drill-through definition to let users navigate to this chart from reports created using the Sales and Marketing (cube) package. You want to let users explore product data in source reports at different levels of detail, and then drill through to the chart. Therefore, you will create a drill-through definition that lets users drill down, and then drill through.

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples\Cubes\Sales and Marketing (cube) Report type: Clustered Column Chart

Task 1. Create the target report. 1. Add the following query items to a new clustered column chart:

Default measure (y-axis) drop zone: Measures dimension\Quantity. Series (primary axis) drop zone: Order method dimension\

Order method hierarchy\Order method type. Categories (x-axis) drop zone: Time dimension\Time hierarchy\Year

level

You want users to be able to drill through from a member at any level in the Products hierarchy. Therefore, you will add a parameter that will accept any member from the Products hierarchy. Because you are working with dimensional data, you will build the parameter in a dimensional way.

2. On the Explorer bar point to Query Explorer, and then under Queries click Query1.

Page 409: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-21 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

3. From the Toolbox tab, drag a Slicer Member Set object to the Slicer pane.

4. Create and validate the following expression:

[sales_and_marketing].[Products].[Products]->?product?

Hints:

Available Components pane\Source tab: Products dimension\Products hierarchy

Validate using Products member

5. Click OK to close the Slicer Member Expression dialog box.

To let users know what data is displayed in this chart, you will add a title that explains which member from the Products dimension is displayed in the report.

Task 2. Add a descriptive report title. 1. On the Explorer bar point to Page Explorer, and then under Report Pages

click Page1.

2. Double-click the report title text, type Quantity Sold for, press the space bar, and then click OK.

3. From the Toolbox tab, drag a Layout Calculation object to the end of the report title text.

4. On the Available Components pane\Parameters tab, drag the product parameter to the Expression Definition box.

The expression appears as shown below:

ParamDisplayValue('product')

5. Validate the expression to ensure there are no errors, and then click OK to close the Report Expression dialog box.

You will format the layout calculation text to match the report title text, and left align the title.

Page 410: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-22 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

6. In the report title area, click the report title text, on the toolbar click

Pick up Style , in the report layout header, click the Layout Calculation,

and then on the toolbar click Apply Style .

7. Click the report title area, and then on the toolbar click Left.

The results appear as follows:

8. Save the report in the My Folders folder as Module9_Demo2_Target.

You will create a drill-through definition to let users navigate to this report from reports created using the Sales and Marketing package.

Page 411: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-23 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Create the package-based drill-through definition. 1. In IBM Cognos Connection, launch Drill-through Definitions, navigate to

Public Folders\Samples_PowerCub\Cubes\Sales and Marketing (cube) package, and then click New Drill-through Definition.

2. In the Name box, type Module 9 Demo 2 Drill-through Definition, and then click Next.

You want to ensure that when users drill through, they are not prompted to select a member from the Products hierarchy. Therefore, you will limit the scope of the drill-through definition to the Products dimension.

3. Click Set the scope, click the Products dimension, and then click OK.

4. Click Set the target, navigate to My Folders, click Module9_Demo2_Target, and then click OK.

5. Click Next.

The Specify the target details page appears and displays the parameter from the Module9_Demo2_Target report as shown below:

You want this parameter to receive members from any level in the Products hierarchy.

6. Beside the product parameter, in the Source metadata item column, click Set the value, click the Products dimension, and then click OK.

7. Click Finish.

Page 412: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-24 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 4. Test the drill-through definition. 1. Add the following query items to a new list.

Products dimension\Products hierarchy\Product line Measures dimension\Revenue

2. From the Data menu, click Drill Behavior, on the Basic tab, ensure that the Allow drill-up and drill-down and Allow this report to be a package-based drill-through source check boxes are selected, and then click OK.

3. On the toolbar click Run Report.

The report appears as follows:

4. Click Golf Equipment to drill down to view details about golf equipment

product types.

The report appears as follows:

Page 413: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-25 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

5. Click Irons to drill down to view details about each product in the Irons product type.

The report appears as follows:

You will drill through to view information about the quantity sold for the Hailstorm Steel Irons by each order method during different order years.

6. In the Hailstorm Steel Irons row, right-click the value in the Revenue column (58,805,377.39), point to Go To, and then click Related Links.

Page 414: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-26 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

7. Click Module 9 Demo 2 Drill-through Definition.

IBM Cognos drills through to the Module9_Demo2_Target report which is displayed as follows:

The report displays data for the product from which you drilled through in the source report (Hailstorm Steel Irons).

You were able to drill down in the Products hierarchy, and then drill through to the target report. Drill-through access works as expected.

8. Close both IBM Cognos Viewer windows.

Results: You created a drill-through definition that lets users drill down within a hierarchy, and then drill through to a target report from members at any level in the hierarchy.

Page 415: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-27 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Drill Through to Different Data Sources

Product Line

Data

Report Created Using

OLAP Data

Golf Equipment

Data

Report CreatedUsing

Relational Data

Drill through to view detailed data for the Golf Equipment product line

In IBM Cognos, you can set up drill-through access between reports created from different data sources. These data sources may be the same type (such as two OLAP data sources), or they may be different types of data sources.

When you set up drill-through access between reports created using different data sources, you must ensure that parameters in the target report can accurately identify the values passed from source reports. If the parameter in the target report cannot accurately recognize the value passed from the source report, the target report may display no data, or may display unexpected results.

For example, a report author may need to set up drill-through access from a report created using summarized PowerCube data to a report created using detailed data from a relational data source. Setting up drill-through between reports created using different data source is more advanced, and is relevant only for those who will need to set up drill-through access between different data sources. If this is not relevant, you may wish to skip this portion of the module.

Page 416: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-28 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Drill Through to Different Data Sources (cont'd)

NoMemberValue

YesValueMember

Yes *MemberMember

YesValueValue

Supported Combination?

Data Item Expected by

Target Parameter

DrilledData Item in Source

Report

When you set up drill-through access between reports created from different data sources, you must use one of the combinations that are supported in IBM Cognos.

The item users drill through from and the item used for the target parameter must mean the same thing, and must be based on the same data. This is required so that the target report displays the data expected by users when they drill through. To determine whether this is the case, you must ask the data modelers who created the packages.

* Member-to-member drill through is supported only when the MUN structures for each data source are the same.

If the source and target items are based on different data, the target report may show unexpected results. For example, a product code passed from a source report may correspond to the code for a different product in the target report data. This would mean that when users drill through, they would see data for the wrong product.

Page 417: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-29 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

[sales_and_marketing].[Products].[Products].[Product type] ->:[PC].[@MEMBER].[951]

MUN for the Cooking Gear Member

Package Dimension Hierarchy Level

DimensionHierarchy

Level

Member-to-Member

Member-to-Member drill-through access between different data sources uses MUNs to pass members

In IBM Cognos, each member is uniquely identified by a Member Unique Name (MUN). The MUN is different from the caption you see for each member in the Insertable Objects pane. MUNs describe the position of each member in the hierarchical structure.

When you drill through to a target parameter that expects a member, the parameter uses the MUN to identify which member is passed. In order for member-to-member drill through between different OLAP data sources to succeed, the source and target MUNs must match. Before you set up drill-through access between members from different packages, consult with the data modeler(s) who created the packages to determine whether the source and target members have matching MUNs.

Page 418: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-30 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

From OLAP Members to DMR Members

[Sales].[Products].[Products].[Product type]-> [Products].[991].[953]

[sales_and_marketing].[Products].[Products].[Product type] ->:[PC].[@MEMBER].[953]

MUN for DMR Sleeping Bags Member

MUN for Cognos PowerCube Sleeping Bags Member

For drill through from OLAP members to DMR members to succeed, confirm with your data modelers that:

the business keys match in all levels of the dimensions for the source and target members, and

the dimensions for the source and target members have the same number of levels

In the slide example, drill through from the IBM Cognos PowerCube Sleeping Bag member to the DMR Sleeping Bag member would succeed because the two dimensions have the same number of levels, and the business keys for the levels match

If the DMR data source dimensions, levels, level order, and business keys match the OLAP cube data source, the data is said to be conformed. Conformed data is required for OLAP to DMR drill through.

Page 419: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-31 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

From Members to Values

Primary Keys in the PRODUCT_LINE Table in a Relational Database

Query Item Containing These

Business Key Values

You can set up drill-through access from OLAP or DMR members to parameters expecting values. To do this, in the target report you must create a parameter using a query item that represents business key values, such as primary keys. In relational data sources, business keys uniquely identify the entries in each row of a table.

The target report may contain a parameter that expects values that do not match the keys passed by source members. In this case, you can select a property value of the member to pass, such as the caption property.

Before you set up member-to-value drill-through access, you must consult the modelers who created the packages. Any PowerCubes involved must either have drill-through enabled, or must have unique business keys throughout all levels in each dimension. Consult with your Transformer modeler to determine whether this is the case. Ask the modelers if the business keys passed by source members match the business keys in the query item you want to use as the target parameter. If they do, create a parameter in the target report using this query item.

Page 420: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-32 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 3Drill Through from Members to a Parameter Expecting a Business Key

Page 421: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-33 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 3: Drill Through from Members to a Parameter Expecting a Business Key

Purpose: The Sales department has requested a map report that displays the revenue generated in different countries. You must create this report using the relational package, GO Data Warehouse (query). You want to let users drill through to this report from Order method members in reports created using a DMR source: the GO Data Warehouse (analysis) package. Users should be able to drill through to view data for a specific order method.

The data modeler who created these packages tells us that there is a query item in the GO Data Warehouse (query) package (Order method key) with business key values that match the business keys that will be passed by the members from Order method type level in the GO Data Warehouse (analysis) package. Therefore, in the target report, you will create a parameter using the Order method key query item.

Portal: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public folders\Samples\Models\GO Data Warehouse (query) Report Type: Map Folder: Sales and Marketing (query) Namespace: Sales (query)

Page 422: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-34 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 1. Create the target report. 1. In Report Studio, without saving the previous report, create a map report, and

set the Display layers to Oceans.

2. Add the following query items to the map:

Color drop zone: Sales fact query subject\Revenue measure Location drop zone: Retailers query subject\Retailer country query item

You will specify that this report should run even if some retail territories in the map file do not match those in our data source.

3. Click the map report background, in the Properties pane under Data, change the Ignore Data With No Features property to Yes.

You will add a parameter so that when users drill through the report displays only data for the order method they drill through from. You will use the Order method key query item, which has business key values that match those passed by the Order method members in the GO Data Warehouse (analysis) package. Because the target report is from a relational data source, you will use a relational technique for building the parameter.

4. On the toolbar, click Filters, click Edit Filters, and then on the Detail Filters tab, click Add.

5. In the Create Filter dialog box, click Advanced, and then click OK.

6. In the Expression Definition box, create the expression as follows: [Sales (query)].[Order method].[Order method key]=?Order method? Hints: Available Components pane\Source tab: Sales and Marketing (query)

folder\Sales (query) namespace\Order method query subject\Codes\Order method key

Validate by typing 602 at the prompt

7. Click OK to close the Prompt dialog box, and then click OK to close the Detail Filter Expression dialog box.

8. Click OK to close the Filters dialog box.

Page 423: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-35 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 2. Add two layout calculations, and then save the report. You will add two layout calculations to the report to show the Display value and the Use value that are passed to this target parameter when users drill through. The Display value is the value that users would select in the prompt if a prompt appeared for the parameter. The Use value is the value that is passed to the target parameter.

1. From the Toolbox tab, drag a Table object to the right of the block holding the report title text.

2. In the Number of columns box type 1, in the Number of rows box type 2, and then click OK.

3. From the Toolbox tab, drag a Text Item object to the top table cell, type Parameter Display Value:, click the Space bar, and then click OK.

4. From the Toolbox tab, drag a Layout Calculation object to the right of the text in the top table cell, and then on the Available Components pane\Parameters tab drag the Order method parameter to the Expression Definition box. The expression appears as follows: ParamDisplayValue('Order method')

5. Validate the expression, and then click OK to close the Report Expression dialog box.

6. From the Toolbox tab, drag a Text Item object to the bottom table cell, type Parameter Use Value:, click the Space bar, and then click OK.

7. From the Toolbox tab, drag a Layout Calculation object to the right of the text in the bottom table cell, and then on the Available Components pane\Parameters tab, and then drag the Order method parameter to the Expression Definition box.

Page 424: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-36 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

8. In the expression, delete Display. The expression appears as shown below: ParamValue('Order method')

9. Validate the expression to ensure there are no errors, and then click OK to close the Report Expression dialog box.

10. To change the object in focus, click the chart background to select it, and then press Esc to deselect it.

A section of the result appears as follows:

11. Save this report as Module9_Demo3_Target in My Folders.

Task 3. Create a package-based drill-through definition. 1. In IBM Cognos Connection, launch Drill-through Definitions, navigate to

Public Folders\Samples\Models\GO Data Warehouse (analysis), and then click New Drill-through Definition.

Page 425: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-37 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

2. In the Name box, type Module 9 Demo 3 Drill-through Definition, and then click Next.

You will set the scope so users can drill through only from cells that have a specific order method as their context.

3. Click Set the scope, expand the Sales and Marketing (analysis) folder\Sales namespace\Order method dimension, click the Order method type level, and then click OK.

4. Click Set the target, navigate to My Folders, click Module9_Demo3_Target, and then click OK.

When you click Set the target, if prompted to select a report or a PowerCube package, click Select a report.

5. Click Next.

Since you created a parameter that expects business key values, in the Type column for the prompt, you can see that this prompt expects a Number value:

When users drill through, values from members in the Order method level must be passed to the target parameter.

6. Beside the Order method parameter, in the Source metadata item column click Set the value.

7. Expand the Sales and Marketing (analysis) folder\Sales namespace\Order method dimension, click the Order method type level, and then click OK.

8. In the Source metadata item properties list, click Business Key, and then click Finish.

Page 426: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-38 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 4. Create a source report and test the drill-through definition.

1. In Report Studio, use the Public Folders\Samples\Models\GO Data Warehouse (analysis) package to create a list report.

2. Add the following query items to the new list:

Order method dimension\Order method hierarchy\Order method type. Sales fact measure dimension\Quantity.

3. From the Data menu, click Drill Behavior, on the Basic tab, ensure that the

Allow this report to be a package-based drill-through source check box is selected, and then click OK.

4. On the toolbar, click Run Report.

The report appears as follows:

You will drill through to view details about telephone sales in each country.

5. In the list report, right-click Telephone, point to Go To, and then click Related Links.

Page 427: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-39 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

6. Click Module 9 Demo 3 Drill-through Definition.

IBM Cognos drills through to the Module9_Demo3_Target report as follows:

This report displays the revenue generated by sales made by telephone in each country. The top layout calculation indicates that the display value for the member passed to the target parameter is Telephone. The bottom layout calculation indicates that the business key for the Telephone member (602) was passed to the target parameter. Drill-through access works as expected.

7. Close both IBM Cognos Viewer windows.

Results: You set up drill-through access to let users drill through from members to values. You created a parameter that expects business key values. The business key values expected by the target parameter match the business keys passed from members when users drill through.

Page 428: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-40 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Demo 4Drill Through from Member Captions to Values

Page 429: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-41 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Demo 4: Drill Through from Member Captions to Values

Purpose: The Sales department has requested a chart that compares revenue generated by different order methods for each product line. You must use the Sales and Marketing package, published from OLAP data, to create this chart. You have been asked to let users drill through from this chart to a detailed target report based on GO Data Warehouse (query), a relational data source. The target report contains a parameter that expects Product line values. Our modeler told us that the caption properties for the Product line members in the Sales and Marketing package match the Product line values expected by the target parameter. Therefore, you will set up drill-through access to pass the caption value for Product line members when users drill through.

Portal: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public folders\Samples\Models\GO Data Warehouse (query) Report Type: List Folder: Sales and Marketing (query) Namespace: Sales (query)

Task 1. Create the target report. 1. Add the following query items to a new list:

Product: Product line, Product type, Product Sales fact: Revenue

Page 430: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-42 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

2. In the layout report, click Product line, Ctrl+click Product type, and then in the toolbar click Group / Ungroup.

3. In the layout report, click the Revenue column, on the toolbar click Summarize, and then in the drop-down menu click Total.

Your report layout appears as follows:

Because this target report is based on relational data, you will use a detail filter, which is a relational technique, to pass the drill-through parameters.

4. On the toolbar click Filters, click Edit Filters, and then on the Detail Filters tab, click Add.

5. In the Create Filter dialog box, click Advanced, and then click OK.

Page 431: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-43 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

6. Create and validate the following expression:

[Sales (query)].[Products].[Product line]=?Product line?

Hints:

Available Components pane\Source tab: Sales and Marketing (query) folder\Sales (query) namespace\Products query subject\Product line

Validate using Camping Equipment

7. Click OK to close the Prompt dialog box, click OK to close the Detail Filter Expression dialog box, and then click OK to close the Filters dialog box.

8. Save the report in My Folders as Module9_Demo4_Target.

Task 2. Create the source report. 1. In Report Studio, use the Public Folders\Samples_PowerCube\Cubes\

Sales and Marketing (cube) package to create a crosstab report.

2. Add the following query items to the new crosstab:

Columns area: Order method dimension\Order method hierarchy\Order method type level

Rows area: Products dimension\Products hierarchy\Product line level

Measures area: Measures dimension\Revenue measure

You know that the parameter in the target report expects string values, and not the business keys that will be passed by the Product line members. Our data modeler told us that the captions for each Product line member match the values expected by the target parameter. Therefore, you will define a drill-through definition to specify that for each Product line member, its caption property be passed rather than its MUN.

You will now set up drill-through access to the target report.

Page 432: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-44 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Set up report-based drill-through access. You want to let users drill through from the product lines listed in the rows.

1. In the report, click <#Product line#>, on the toolbar, click Drill-Through Definitions, and then in the Drill-Through Definitions dialog box, click New Drill-Through Definition.

2. Beside the Report box, click the ellipsis, navigate to My Folders, click Module9_Demo4_Target, and then click Open.

You will specify that the caption for the Product line be passed to the target parameter.

3. Under Parameters, click Edit.

4. For the Product line parameter, in the Method list, click Pass data item value, in the Value list, click Product line, and then in the Property to Pass list, click Member Caption.

5. Click OK to close the Parameters dialog box, and then click OK to close the Drill-Through Definitions dialog box.

Notice that the appearance of <#Product line#> in the crosstab has changed to indicate the drill-through definition.

6. On the toolbar, click Run Report.

The report runs and appears in IBM Cognos Viewer. You can drill through from items in the rows.

Page 433: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-45 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

7. In the rows, click Personal Accessories.

IBM Cognos drills through to the Module9_Demo4_Target report and a section of the report appears as follows:

8. In the report click Bottom.

Observe that the report contains only data for the Personal Accessories product line. Drill-through access works as expected.

9. Close IBM Cognos Viewer, and then close Report Studio without saving the report.

10. Log off of IBM Cognos Connection.

Results: You set up drill-through access from members in a source report to a target parameter expecting values. You specified that the members in the level that users drill through from will pass caption values instead of business keys to the target parameter.

Task 3, step 10: Do not log off of IBM Cognos Connection if you are advancing to the next module today.

Page 434: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-46 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Drilling to Different Data Sources

Product line Dimension in the

OLAP Source Model

Target Parameters Created Using Values

You can let users drill down on members in a hierarchy, and then drill through to a target report created from a different data source. If the target parameter expects values, the author of the target report must create a separate parameter for each level in the source hierarchy that users can drill through from.

To ensure users are not prompted to enter parameter values when they drill through, each target parameter must be optional. This ensures users are not prompted to provide values for unanswered prompts when they drill through.

In order for drill-down behavior and drill-through access to succeed, the following requirements must be met: a) the level structure in the hierarchy that you want users to drill through from matches the level structure in the hierarchy that you use for the target parameter; and b) the business keys for the all members in the source hierarchy match the keys for the equivalent metadata items in the target hierarchy.

Page 435: Multidimentional Authoring

SET UP DRILL-THROUGH REPORTS

© 2007, 2012, IBM Corporation 9-47 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

This member represents a date range

This target parameter expects a date range

Drill Through from Dates

Some OLAP data structures have time categories that represent date ranges. IBM Cognos PowerCube is an example, as shown above.

To set up drill-through access from date members, the target parameter must expect a date range or a date-time range. You can use the in_range operator to ensure that the target parameter expects the correct value type.

Page 436: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

9-48 © 2007, 2012 IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

© 2012 IBM Corporation

Summary At the end of this module, you should be able to: navigate from a specific report to a target report drill down to greater detail and then navigate to a

target report

navigate between reports created using different data sources

Page 437: Multidimentional Authoring

10

© 2012 IBM Corporation

End-to-End Workshop

IBM Cognos BI

Page 438: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-2 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 439: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-3 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: End-to-End Workshop

Your company would like a report that will allow the corporate office of each country to assess their sales promotions and determine the effectiveness of promotional campaigns of the channels (retailers). By identifying effectiveness of promotions, the corporate offices can make decisions on where to make more investment in promotional advertising, or make other changes to the campaigns to try to improve the revenue results. The initial report will be based on the Sales and Marketing (cube) package. The report will prompt the user to select:

a Retailer country any part of the Products hierarchy

The report will have a summary level chart comparing total promotional sales revenue for each quarter of the current year to the quarters of the previous year, including the following requirements:

3-D clustered column chart quarters of current year and quarters of previous year in the series revenue for promotional sales only (non-Regular Sale)

Page 440: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-4 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

The report will also have a detailed crosstab that examines revenue for each campaign, for each retailer within the selected country. The crosstab will also include:

revenue for each promotional (non-Regular Sale) campaign, for each retailer name

a calculation to display the promotional sales percent of the total sales current year totals previous year totals quarter by quarter totals for the current year a filter to eliminate rows with no promotional sales in the current or past year sorting of campaigns by total revenue in the current year

The report must have drilling enabled. Ensure that the calculations, filters, and sorting are all maintained when the user drills up or down. Finally, the report will be configured with a drill-through definition. From the initial report, the user will be able to drill-through from Retailer name to a report based on the Go Data Warehouse (query) package. The target report will include:

a parameter to filter based on the retailer that is selected in the initial report Retailer, Campaign name, and Product Quantity, Revenue, and Unit Cost

For more detailed information outlined as tasks, see the Task Table section.

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

Page 441: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-5 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Task Table

Task 1: Build a crosstab and include a prompt for Retailer country. Where to Work Hints

File menu Create a new crosstab report, using the Sales and Marketing (cube) package.

Source tab Measures drop zone: Revenue

Toolbox tab Set Expression dialog box\Expression Definition box

Rows drop zone:

Query Calculation for Selected Retailer Country: [sales_and_marketing]. [Retailers].[Retailers].[Retailer country]-> ?Country?

Query Calculation for Retailer Names: children([Selected Retailer Country])

Crosstab in report layout Cut <Selected Retailer Country> from the report layout.

Page 442: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-6 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 2: Add time to columns in report layout. Where to Work Hints

Toolbox tab Set Expression dialog box\Expression Definition box

Columns drop zone:

Query Calculation for Current Year: closingPeriod([sales_and_marketing]. [Time].[Time].[Year])

Query Calculation for Quarters of Current Year, as a peer to the left of <Current Year>: children([Current Year])

Query Calculation for Total Previous Year, as a peer to the right of <Current Year>: prevMember([Current Year])

Page 443: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-7 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 3: Add promotional campaigns to report layout, excluding regular sales, and aggregate the results.

Where to Work Hints

Toolbox tab Set Expression dialog box\Expression Definition box

Rows drop zone: Query Calculation for Promotional Campaigns,

nested as a child of <Retailer Names>: except([sales_and_marketing]. [Promotions].[Promotions].[Campaign], [Regular sale])

Toolbox tab Calculated member dialog box\Expression Definition box

Rows drop zone: Calculated Member for Aggregate(Promotional

Campaigns), nested as a peer of <Promotional Campaigns>: aggregate (currentMeasure within set [Promotional Campaigns])

Crosstab in report layout \Properties pane

Format the Aggregate(Promotional Campaigns) member fact cells to set the Classes property to Crosstab fact cell (inner total nested).

Toolbox tab Calculated member dialog box\Expression Definition box

Rows drop zone:

Query Calculation for Total All Campaigns, as a peer to Aggregate (Promotional Campaign): aggregate(currentMeasure within set [sales_and_marketing].[Promotions]. [Promotions]. [Campaign])

Page 444: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-8 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 4: Create and format a percent of total metric. Where to Work Hints

Toolbox tab Calculated member dialog box\Expression Definition box

Rows drop zone: Query Calculation for % of Total, as a peer to

Aggregate (Promotional Campaigns): [Aggregate(Promotional Campaigns)]/ [Total All Campaigns]

Crosstab in report layout Cut <Total All Campaigns> from the report layout.

Crosstab in report layout\ Properties pane

Format the % of Total member fact cells to set the Data Format property to Percent.

Format the % of Total member fact cells to set the Classes property to Crosstab fact cell (inner total nested).

Task 5: Filter out nulls. Where to Work Hints

Toolbox tab Set expression dialog box\Expression Definition box

Query Calculation for Non-null Promotional Campaigns, as a peer to <Promotional Campaigns>:filter ([Promotional Campaigns],tuple ([Current Year],[Revenue])<>null or tuple ([Total Previous Year],[Revenue])<>null)

Crosstab in report layout Cut <Promotional Campaigns> from the report layout.

Modify <Retailer Names>: filter (children ([Selected Retailer Country]), tuple ([Current Year],[Aggregate(Promotional Campaigns)])<>null or tuple ([Total Previous Year],[Aggregate(Promotional Campaigns)])<>null)

Page 445: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-9 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 6: Order the Promotional Campaigns in descending order by Revenue for the current year.

Where to Work Hints

Toolbox tab Set expression dialog box\Expression Definition box

Query Calculation object named Ordered Non-null Promotional Campaigns, as a peer to <Non-null Promotional Campaigns>: order([Non-null Promotional Campaigns], tuple([Current Year],[Revenue]), desc)

Crosstab in report layout Cut <Non-null Promotional Campaigns>, from the report layout.

Task 7: Add a Slicer tree prompt for products. Where to Work Hints

Query Explorer\ Queries\ Query1\ Slicer pane

Toolbox tab

Create a Slicer Member Set: [sales_and_marketing].[Products]. [Products]-> ?Product?

Page 446: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-10 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 8: Add a chart to the report layout. Where to Work Hints

Page Explorer\ Report Pages\ Page1 Toolbox tab

Drag a Chart object to the report layout above the crosstab: Clustered Column with 3-D Visual Effect chart.

Chart in report layout\ Properties pane

In the Properties pane\Data section, modify the Query, property to use Query1.

Data Items tab Populate the column chart with the following items: Default measure (y-axis): Query1\Revenue Series (primary axis): Query1\Quarters of

Current Year Categories (x-axis): Aggregate(Promotional

Campaigns)

Toolbox tab Series: above Quarters of Current Year insert a Query Calculation for Quarters of Previous Year: children(prevMember([Current Year]))

Task 9: Add a dynamic title to the report. Where to Work Hints

Report layout\ Title area\ Properties pane

Set the Source Type property to Report Expression.

Modify the Report Expression property to the Country parameter.

Report Studio toolbar Unlock the report layout.

Toolbox tab Drag a Text Item object to the left of <%ParamDisplay...%>, type Promotional Campaign Assessment: and then type a space.

Change the title class to Report Title text.

Page 447: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-11 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 10: Add a subtitle for the chart report. Where to Work Hints

Toolbox tab Above the chart report: Add a Block. Drag a Text Item into the Block, type Quarter by

Quarter Comparison of Promotional Sales for, type a space, and then click OK.

Drag a Layout Calculation object to the right of Quarter by Quarter Comparison of Promotional Sales for, and add the Product parameter.

Change the subtitle to class Chart title.

Task 11: Add a subtitle for the crosstab report. Where to Work Hints

Toolbox tab Between the chart report and the crosstab: Add a Block. Drag a Text Item into the Block, type Comparison

of Promotional Sales to All Sales for, type a space, and then click OK.

Drag a Layout Calculation object to the right of Comparison of Promotional Sales to All Sales for, and add the Product parameter.

Report Studio toolbar

Properties pane

Lock the report layout and format: Add a 20 pixel high Block below the chart report. Center the entire report.

Change the subtitle to class Chart title.

Page 448: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-12 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 12: Enable drilling and configure advanced behavior. Where to Work Hints

Data menu Select Drill Behavior, then select the Allow drill-up and drill-down check box.

Query Explorer\ Queries\ Query1 Properties pane

Change the Define Member Sets property to Yes.

Member Sets tab\ Insertable Objects pane

Drag Promotional Campaigns to the member sets work area.

Select Aggregate(Promotional Campaigns), Ctrl+click Non-null Promotional Campaigns, Ordered Non-null Promotional Campaigns, and % to Total and then drag them on top of Promotional Campaigns in the member sets work area.

Member sets work area\ Properties pane

For Promotional Campaigns, rename Promotional Campaigns to Promotional Campaigns MS, and repeat this for the remaining member set structures to add MS to the end of each name.

Data menu\ Drill Behavior\ Advanced tab\ Data Items pane

Change the Drill-up behavior and Drill-down behavior to Replace Expression for Promotional Campaigns.

Change the Drill-up behavior and Drill-down behavior to Preserve for the following items: Aggregate(Promotional Campaigns) Non-null Promotional Campaigns

Ordered Non-null Promotional Campaigns

Page 449: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-13 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 13: Create a report from relational data to provide a drill-through target.

Where to Work Hints

File menu Save the report as End-to-End Workshop Source in My Folders.

Create a new list report using the Go Data Warehouse (query) package.

Source tab\ Sales and Marketing (query)\ Sales (query)

Add the following items to the list report: Retailers\Retailer Promotions\Campaign name Products\Product Sales fact\Quantity Sales fact\Revenue Sales fact\Unit cost

Group Retailer name, Campaign name and Product name.

List report Report Studio toolbar

In the list report, click Retailer name, and click the Section button.

Task 14: Create a detail filter to provide the parameter for the target report and save the report.

Where to Work Hints

Report Studio toolbar

Available Components pane\ Source tab

Click the Filter button, and in the Filters dialog box, click Add to create and validate the following expression: [Sales (query)].[Retailer].[Retailer key]=?retailer?

File menu Save the report as End-to-End Workshop Target.

Page 450: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-14 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 15: Add the drill-through definition to the source report and test the report.

Where to Work Hints

File menu Open the End-to-End Workshop Source report.

Report layout Click Retailer names, and click Drill-Through Definitions.

Drill-Through Definitions dialog box

Add a definition with the End-to-End Workshop Target report as the target report, with the Parameter Method as Pass data item value, and set the Value as Retailer Names.

IBM Cognos Viewer On the toolbar, click Run Report.

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

Page 451: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-15 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Workshop Results

After completing Task 11, and selecting Camping Equipment and France at the prompts, a section of the first page of the report appears as follows:

Page 452: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-16 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

After completing Task 15, and selecting Camping Equipment and France at the prompts, and then drilling through on La bonne Forme in the resulting crosstab report, a section of the final report appears as follows:

Page 453: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-17 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Workshop 1: Step-by-Step Instructions

Server: http://localhost:88/ibmcognos User/Password: brettonf/Education1 Studio: Report Studio Package: Public Folders\Samples\Cubes\Sales and Marketing (cube) Report type: Crosstab

Task 1. Build a crosstab and include a prompt for Retailer country.

1. Add the following query item to a new crosstab:

Measures: Measures dimension\Revenue measure

2. From the Toolbox tab, drag a Query Calculation object named Selected Retailer Country, as a Set expression of the Retailers hierarchy, to the Rows area of the report layout.

3. Create and validate the following expression:

[sales_and_marketing].[Retailers].[Retailers].[Retailer country]->?Country?

Hints:

Available Components pane\Source tab: Retailers dimension\Retailers hierarchy\Retailer country level

Validate using Australia

4. Click OK to close the Prompt dialog box, and then click OK to close the Set Expression dialog box.

5. From the Toolbox tab, drag a Query Calculation object named Retailer Names, as a Set expression of the Retailers hierarchy, as a peer of <Selected Retailer Country>.

Page 454: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-18 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

6. Create and validate the following expression:

children ([Selected Retailer Country])

Hints:

Available Components pane\Data Items tab: Selected Retailer Country

7. Click OK to close the Set Expression dialog box.

8. In the report layout, click <Selected Retailer Country>, and then click Cut.

This action will remove Selected Retailer Country from the report layout, but leave the query in the report.

9. On the toolbar, click Run Report. (select Australia at the prompt).

The results appear as follows:

10. Close IBM Cognos Viewer.

Page 455: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-19 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 2. Add time to columns in report layout. 1. From the Toolbox tab, drag a Query Calculation object named Current

Year, as a Set expression of the Time hierarchy, to the Columns drop zone in the report layout.

2. Create and validate the following expression:

closingPeriod ([sales_and_marketing].[Time].[Time].[Year])

Hints:

Available Components pane\Source tab: Time dimension\Time hierarchy\Year level

3. Click OK to close the Set Expression dialog box.

4. From the Toolbox tab, drag a Query Calculation object named Quarters of Current Year, as a Set expression of the Time hierarchy, as a peer to the left of <Current Year> in the report layout.

5. Create and validate the following expression:

children([Current Year])

Hints:

Available Components pane\Data Items tab: Current Year

6. Click OK to close the Set Expression dialog box.

7. From the Toolbox tab, drag a Query Calculation object named Total Previous Year, as a Set expression of the Time hierarchy, as a peer to the right of <Current Year> in the report layout.

Page 456: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-20 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

8. Create and validate the following expression:

prevMember ([Current Year])

Hints:

Available Components pane\Data Items tab: Current Year

9. Click OK to close the Set Expression dialog box.

10. On the toolbar, click Run Report. (select Australia at the prompt).

A section of the report appears as follows:

11. Close IBM Cognos Viewer.

Page 457: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-21 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 3. Add promotional campaigns to report layout, excluding regular sales, and aggregate the results.

1. From the Toolbox tab, drag a Query Calculation object named Promotional Campaigns, as a Set expression of the Promotions hierarchy, to the Rows area of the report layout, to nest as a child of <Retailer Names>.

2. Create and validate the following expression:

except ([sales_and_marketing].[Promotions].[Promotions].[Campaign], [Regular sale])

Hints:

Available Components pane\Source tab: Promotions dimension\Promotions hierarchy\Campaign level

Available Components pane\Source tab: Promotions dimension\Promotions hierarchy\Campaign level\Members folder\Regular sale member

3. Click OK to close the Set Expression dialog box.

4. From the Toolbox tab, drag a Query Calculation object named Aggregate(Promotional Campaigns), as a Calculated Member of the Promotions hierarchy, as a peer to <Promotional Campaigns> in the report layout.

5. Create and validate the following expression:

aggregate (currentMeasure within set [Promotional Campaigns])

Hints:

Available Components pane\Data Items tab: Promotional Campaigns 6. Click OK to close the Calculated Member Expression dialog box.

7. In the report layout, click Aggregate(Promotional Campaigns), in the Properties pane under Miscellaneous, click the Classes property, and then click the ellipsis.

Task 3, Step 4: In 8.3 this was done by using the Aggregate tool, however in 8.4 there were new warnings displayed regarding the expectation of a member, not a numeric value when the extended data item was reused in other expressions. Because of this, in 10.1, this workshop changed to use a calculated member, rather than the Aggregate tool.

Page 458: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-22 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

8. In the Selected classes pane, click Crosstab member cell (calculated), click the green left arrow to remove it from the list, in the Global classes pane, double-click Crosstab member cell (inner total nested) to add it to the Selected classes pane, and then click OK.

9. In the report layout, right-click Aggregate(Promotional Campaigns), and then click Select Member Fact Cells.

You will format the cells to be consistent with a summary row.

10. In the Properties pane under Miscellaneous, click the Classes property, and then click the ellipsis.

11. In the Selected classes pane, click Crosstab fact cell (calculated member), click the green left arrow to remove it from the list, in the Global classes pane, double-click Crosstab fact cell (inner total nested) to add it to the Selected classes pane, and then click OK.

12. From the Toolbox tab, drag a Query Calculation object named Total All Campaigns, as a Calculated member of the Promotions hierarchy, as a peer to <Aggregate(Promotional Campaigns)> in the report layout.

13. Create and validate the following expression:

aggregate(currentMeasure within set [sales_and_marketing].[Promotions]. [Promotions].[Campaign])

Hints:

Available Components pane\Source tab: Promotions dimension\Promotions hierarchy\Campaign level

14. Click OK to close the Calculated Member Expression dialog box.

Page 459: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-23 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

15. On the toolbar, click Run Report. (select Australia at the prompt).

A section of the report appears as follows:

16. Close IBM Cognos Viewer.

Task 4. Create and format a percent of total metric. 1. From the Toolbox tab, drag a Query Calculation object named % of Total,

as a Calculated member of the Promotions hierarchy, as a peer to Aggregate(Promotional Campaigns) in the report layout.

2. Create and validate the following expression:

[Aggregate(Promotional Campaigns)]/[Total All Campaigns]

Hints:

Available Components pane\Data Items tab: Aggregate(Promotional Campaigns)

Available Components pane\Data Items tab: Total All Campaigns 3. Click OK to close the Calculated Member Expression dialog box.

4. In the report layout, click Total All Campaigns, and then click Cut.

This action will remove Total All Campaigns from the report layout, but leave the query in the report.

Page 460: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-24 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

5. In the report layout, click % of Total, in the Properties pane under Miscellaneous, click the Classes property, and then click the ellipsis.

6. In the Selected classes pane, click Crosstab member cell (calculated), click the green left arrow to remove it from the list, in the Global classes pane, double-click Crosstab member cell (inner total nested) to add it to the Selected classes pane, and then click OK.

7. In the report layout, right-click % of Total, and then click Select Member Fact Cells.

8. In the Properties pane under Data, click the box next to the Data Format property, click the ellipsis, in the Format type list, click Percent, and then click OK.

You will format the cells of the % of Total row to be consistent with a summary row.

9. In the crosstab, ensure that the cells selected in step 7 are still selected, in the Properties pane under Miscellaneous, click the Classes property, and then click the ellipsis.

10. In the Selected classes pane, click Crosstab fact cell (calculated member), click the green left arrow to remove it from the list, in the Global classes pane, double-click Crosstab fact cell (inner total nested) to add it to the Selected classes pane, and then click OK.

Page 461: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-25 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

11. On the toolbar, click Run Report. (select Australia at the prompt).

A section of the report appears as follows:

12. Close IBM Cognos Viewer.

Task 5. Filter out nulls. 1. Toolbox tab, drag a Query Calculation object named Non-null

Promotional Campaigns, as a Set expression of the Promotions hierarchy, as a peer to <Promotional Campaigns> in the report layout.

2. In the Expression Definition box, create and validate the expression using items from the Available Components pane\Data Items tab as follows:

filter ([Promotional Campaigns], tuple ([Current Year], [Revenue])<>null or tuple ([Total Previous Year],[Revenue])<>null)

Hints:

Promotional Campaigns Current Year Revenue Total Previous Year

3. Click OK to close the Data Item Expression dialog box.

Page 462: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-26 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

4. Click <Retailer Names>, in the Properties pane, under Data Item, for the Set Definition property, double-click (Defined), and then double-click Set Expression.

5. In the Expression Definition box, create and validate the expression using items from the Available Components pane\Data Items tab as follows:

filter (children ([Selected Retailer Country]), tuple ([Current Year],[Aggregate(Promotional Campaigns)])<>null or tuple ([Total Previous Year],[Aggregate(Promotional Campaigns)])<>null)

Hints:

Current Year Aggregate(Promotional Campaigns) Total Previous Year

6. Click OK to close the Set Expression dialog box, and then click OK to close the Set Definition dialog box.

7. In the report layout, click <Promotional Campaigns>, and then click Cut.

This action will remove Promotional Campaigns from the report layout, but leave the query in the report.

8. On the toolbar, click Run Report. (select Australia at the prompt).

A section of the report appears as follows:

9. Close IBM Cognos Viewer.

Page 463: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-27 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 6. Order the Promotional Campaigns in descending order by Revenue for the current year.

1. From the Toolbox tab, drag a Query Calculation object named Ordered Non-null Promotional Campaigns, as a Set expression of the Promotions hierarchy, as a peer to <Non-null Promotional Campaigns> in the report layout.

2. In the Expression Definition box, create and validate the expression using items from the Available Components pane\Data Items tab as follows:

order([Non-null Promotional Campaigns],tuple([Current Year],[Revenue]), desc)

Hints:

Non-null Promotional Campaigns Current Year Revenue

3. Click OK to close the Set Expression dialog box.

4. In the report layout, cut <Non-null Promotional Campaigns>.

This will remove Non-null Promotional Campaigns from the report layout, but leave the query in the report.

5. On the toolbar, click Run Report. (select Australia at the prompt).

A section of the report appears as follows:

6. Close IBM Cognos Viewer.

Page 464: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-28 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 7. Add a Slicer tree prompt for products. 1. On the Explorer bar, point to Query Explorer, and then under Queries click

Query1.

2. From the Toolbox tab, drag a Slicer Member Set object to the Slicer pane.

3. Create and validate the following expression:

[sales_and_marketing].[Products].[Products]->?Product?

Hints:

Available Components pane\Source tab: Products dimension\Products hierarchy

Validate by choosing Products at the prompt

4. Click OK to close the Prompt dialog box, and then click OK to close the Slicer Member Expression dialog box.

5. On the toolbar, click Run Report. (select Australia and Products at the prompts) and then review the results.

6. Close IBM Cognos Viewer.

Task 8. Add a chart to the report layout. 1. On the Explorer bar point to Page Explorer, and then under Report Pages

click Page1.

2. From the Toolbox tab, drag a Chart object to the report layout above the crosstab.

3. In the Insert Chart dialog box, in the Chart type pane, click Clustered Column with 3-D Effects, and then click OK.

4. Click the background of the chart to select the chart object, and in the Properties pane under Data, change the Query property to Query1.

Page 465: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-29 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

5. From the Data Items tab, add the following query items to the column chart:

Default measure (y-axis): Query1\Revenue Series (primary axis): Query1\Quarters of Current Year

Categories (x-axis): Query1\Aggregate(Promotional Campaigns)

6. From the Toolbox tab, drag a Query Calculation object named Quarters of Previous Year, as a Set expression of the Time hierarchy, to the Series (primary axis) drop zone as a peer of <#Quarters of Current Year#>.

7. Create and validate the following expression:

children(prevMember([Current Year]))

Hints:

Available Components pane\Data Items tab: Current Year

8. Click OK to close the Set Expression dialog box.

Page 466: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-30 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

9. On the toolbar, click Run Report. (select Products and Australia at the prompts).

A section of the report appears as follows:

10. Close IBM Cognos Viewer.

Task 9. Add a dynamic title to the report. 1. In Report Studio, click the text item in the title area of the report, and then in

the Properties pane under Text Source, change the Source Type property to Report Expression.

2. In the Properties pane, click the box next to Report Expression, and then click the ellipsis.

3. On the Parameters tab, drag Country to the Expression Definition box, validate the expression to ensure there are no errors, and then click OK.

Page 467: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-31 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

4. From the Toolbox tab, drag a Text Item to the left of <%ParamDisplay...%>.

5. In the Text dialog box, type Promotional Campaign Assessment: press the space bar, and then click OK.

6. Click <%ParamDisplay...%>, on the toolbar, click Pick up Style.

Click Promotional Campaign Assessment:, on the toolbar, click Apply Style.

Task 10. Add a subtitle for the chart report. 1. From the Toolbox tab, drag a Block to the space before the chart and below

the Report title header in the report layout.

2. From the Toolbox tab, drag a Text Item into the block, type Quarter by Quarter Comparison of Promotional Sales for, press the space bar, and then click OK.

3. From the Toolbox tab, drag a Layout Calculation object to the right of Quarter by Quarter Comparison of Promotional Sales for, on the Available Components pane\Parameters tab, drag Product to the Expression Definition box.

4. Validate the expression to ensure there are no errors, and then click OK to close the Report Expression dialog box.

5. In the report layout, click Quarter by Quarter Comparison of Promotional Sales for, Ctrl+click <%ParamDisplay...%>, and then in the Properties pane under Miscellaneous, change the Classes property to Chart title.

Page 468: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-32 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 11. Add a subtitle for the crosstab report. 1. From the Toolbox tab, drag a Block to the space after the chart and before

the crosstab.

2. From the Toolbox tab, drag a Text Item into the new block, type Comparison of Promotional Sales to All Sales for, press the space bar, and then click OK.

3. From the Toolbox tab, drag a Layout Calculation object to the right of Comparison of Promotional Sales to All Sales for, the Available Components pane\Parameters tab, drag Product to the Expression Definition box.

4. Validate the expression to ensure there are no errors, and then click OK to close the Report Expression dialog box.

5. Click Comparison of Promotional Sales to All Sales for, Ctrl+click <%ParamDisplay...%>, and then in the Properties pane under Miscellaneous, change Classes to Chart title.

6. From the Toolbox tab, drag a Block to the space below the chart in the report layout, select the new block and then in the Properties pane under Positioning, change the Size & Overflow property to have a height of 20 px.

7. Click in the background of the report page to select the page body, and then on the toolbar click Center.

8. On the toolbar, click Run Report. (select Camping Equipment and France at the prompts) and review the results.

Refer to the Workshop Results section on page 10-15 for an example of the report.

9. Close IBM Cognos Viewer.

Page 469: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-33 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 12. Enable drilling and configure advanced behavior. 1. From the Data menu click Drill Behavior, and then on the Basic tab, click the

Allow drill-up and drill-down check box to select it.

2. Click OK, and then on the toolbar, click Run Report, selecting Products and France at the prompts.

3. In the results crosstab, drill down on Canyon Mule Campaign.

Notice, that the resulting list of promotions is no longer sorted by current year revenue, nor are null rows eliminated. Also, the total for Promotional Campaigns shows all promotional campaigns, not just products sold during Canyon Mule Campaign. You must configure member set structures and advanced drilling behavior to preserve the calculations.

4. Close IBM Cognos Viewer.

5. On the Explorer bar point to Query Explorer, and then under Queries click Query1.

6. In the Properties pane under Data, change the Define Member Sets property to Yes.

7. Click the Member Sets tab, and then from the Source tab, drag Promotional Campaigns to the work area.

8. From the Source tab, click Aggregate(Promotional Campaigns), Ctrl+click Non-null Promotional Campaigns, Ordered Non-null Promotional Campaigns, and % of Total, and then drag them onto Promotional Campaigns in the work area.

The items are nested under Promotional Campaigns.

Page 470: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-34 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

9. In the work area, click Promotional Campaigns, and then in the Properties pane under Miscellaneous, rename Promotional Campaigns to Promotional Campaigns MS.

10. Repeat step 9 to rename the remaining member set structures to add MS to the end of each name.

11. From the Data menu click Drill Behavior, and then click the Advanced tab.

12. In the Data items pane, click Promotional Campaigns, and then change the Drill-up behavior and Drill-down behavior to Replace Expression.

13. In the Data items pane, change the Drill-up behavior and Drill-down behavior to Preserve for the following items:

Aggregate(Promotional Campaigns) Non-null Promotional Campaigns Ordered Non-null Promotional Campaigns

Now when you drill up or down, the expressions used to format, filter, and aggregate promotional campaigns are not changed, while the underlying set of Promotional Campaigns will be replaced by children or parents as the user drills up and down.

In step 8, the % of Total calculation is added as a member set so that its drilling behavior will be controlled and disabled. In step 13, you specifically do not configure the advanced drilling behavior for % to Total so that the behavior remains as default; by default, any defined member set will have drilling disabled until specifically defined. The same functionality could be created by disabling drill up and drill down on the first tab of Drill behavior dialog box. In that case the member set for % of Total would not be needed.

14. Click OK to close the Drill Behavior dialog box, on the toolbar, click Run Report. (select Camping Equipment and France at the prompts) to review the results, and then close IBM Cognos Viewer.

Page 471: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-35 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 13. Create a report from relational data to provide a drill-through target.

1. From the File menu, click Save to save your current report.

2. In the Name box, type End-to-End Workshop Source, browse to My Folders and then click OK.

3. From the File menu click New, select the Public Folders\Samples\Models\Go Data Warehouse (query) package, and then click OK.

4. Click List to create a list report, and then click OK.

5. Expand the Sales and Marketing (query) folder\Sales (query) namespace, and then add the following query items to the new list:

Retailers: Retailer name Promotions: Campaign name Products: Product Sales Fact: Quantity, Revenue, Unit cost The report layout appears as follows:

6. In the report layout, click Retailer name, Ctrl+click Campaign name and

Product, and then on the toolbar, click Group / Ungroup.

7. In the report layout, click Retailer name, and then on the toolbar click Section.

Page 472: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-36 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Task 14. Create a detail filter to provide the parameter for the target report and save the report.

1. On the toolbar click Filters, click Edit Filters, in the Filters dialog box click Add, click Advanced, and then click OK to close the Create Filter dialog box.

2. Create and validate the following expression:

[Sales (query)].[Retailers].[Retailer key]=?retailer?

Hints:

Available Components pane\Source tab: Sales and Marketing (query) folder\Sales (query) namespace\Retailers query subject\Codes\Retailer key

Validate using 7351 at the prompt

3. Click OK to close the Prompt dialog box, and then click OK to close the Detail Filter Expression dialog box.

4. From the File menu, click Save and save the report with the name End-to-End Workshop Target in My Folders.

5. On the toolbar, click Run Report. (use 7351 at the prompt) and review the results.

A section of the report appears as follows:

6. Close IBM Cognos Viewer.

Page 473: Multidimentional Authoring

END-TO-END WORKSHOP

© 2007, 2012, IBM Corporation 10-37 This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without a legal license agreement from IBM Corporation.

Task 15. Add the drill-through definition to the source report and test the report.

1. From the File menu, click Open, click End-to-End Workshop Source, and then click Open.

2. In the report layout in the crosstab, click <Retailer Names>, and then on the toolbar, click Drill-Through Definitions.

3. In the Drill-Through Definitions dialog box, click New Drill-Through Definition.

4. On the Target Report tab, click the ellipsis to select the target report, click End-to-End Workshop Target, and then click Open.

5. In the Parameters section, click the Edit button, and then in the Parameters dialog box, from the Method drop-down list, click Pass data item value.

6. From the Value drop-down list, click Retailer Names, and then click OK.

7. Click OK to close the Drill-Through Definitions dialog box.

8. On the toolbar, click Run Report. (select Camping Equipment and France at the prompts) and then in the resulting crosstab report click La bonne Forme to review the results.

Refer to the Workshop Results section on page 10-16 for an example of the report.

9. Close IBM Cognos Viewer and Report Studio.

10. Log off of IBM Cognos Connection.

Page 474: Multidimentional Authoring

IBM COGNOS REPORT STUDIO: AUTHOR REPORTS WITH MULTIDIMENSIONAL DATA (V10.2)

10-38 © 2007, 2012, IBM Corporation This guide contains proprietary information which is protected by copyright. No part of this document may be photocopied, reproduced,

or translated into another language without a legal license agreement from IBM Corporation.

Page 475: Multidimentional Authoring
Page 476: Multidimentional Authoring

This information was developed for products and services offered in the U.S.A.

IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service.

IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not grant you any license to these patents. You can send license inquiries, in writing, to:

IBM Director of Licensing IBM Corporation North Castle Drive Armonk, NY 10504-1785 U.S.A.

The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you.

This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice.

Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product and use of those Web sites is at your own risk. IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you. Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. This information contains examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental. If you are viewing this information softcopy, the photographs and color illustrations may not appear.