IBM Cognos 10 Report Studio Cookbook, Second Edition - Ahmed Lashin - E-Book

IBM Cognos 10 Report Studio Cookbook, Second Edition E-Book

Ahmed Lashin

0,0
44,39 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

IBM Cognos Report Studio is widely used for creating and managing business reports in medium to large companies. It is simple enough for any business analyst, power user, or developer to pick up and start developing basic reports. However, this book is designed to take the reader beyond the basics and into the world of creating more sophisticated, functional business reports.IBM Cognos 10 Report Studio Cookbook, Second Edition helps you understand and use all the features provided by Report Studio to generate impressive deliverables. It will take you from being a beginner to a professional report author. It bridges the gap between basic training provided by manuals or trainers and the practical techniques learned over years of practice.Written in a recipe style, this book offers step-by-step instructions for IBM Cognos Report Studio users to author reports effectively, allowing a reader to dip in and out of the chapters as they desire.
You will see a new fictional business case in each recipe that will relate to a real-life problem and then you will learn how to crack it in Report Studio.
This book covers all the basic and advanced features of Report Authoring. It introduces the fundamental features useful across any level of reporting. Then it ascends to advanced techniques and tricks to overcome Studio limitations. Develop excellent reports using dimensional data sources by following best practices that development work requires in Report Studio. You will also learn about editing the report outside the Studio by directly editing the XML specifications. You will discover how to build and use Cognos Active Reports, a new addition in IBM Cognos 10.
Provide richness to the user interface by adding JavaScript and HTML tags and using the different chart types introduced in IBM Cognos 10. The main focus is on the practical use of various powerful features that Report Studio has to offer to suit your business requirements.
Learn numerous techniques and hacks that will allow you to make the best out of your IBM Cognos 10 Report Studio.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 324

Veröffentlichungsjahr: 2013

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

IBM Cognos 10 Report Studio Cookbook Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Instant Updates on New Packt Books
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Report Authoring Basic Concepts
Introduction
Summary filters and detail filters
Getting ready
How to do it...
How it works...
The detail filter
The summary filter
There's more...
Before/after aggregation
See also
Sorting grouped values
Getting ready
How to do it...
How it works...
There's more...
Aggregation and rollup aggregation
Getting ready
How to do it...
How it works...
The aggregation property
The rollup aggregation property
Multiple aggregation
There's more...
Implementing if-then-else in filters
Getting ready
How to do it...
How it works...
There's more...
Formatting data – dates, numbers, and percentages
Getting ready
How to do it...
How it works...
Date format
Numerical format
The % margin
There's more...
Creating sections
Getting ready
How to do it...
How it works...
There's more...
See also
Hiding columns in crosstabs
Getting ready
How to do it...
How it works...
There's more...
Prompts – display value versus use value
Getting ready
How to do it...
How it works...
There's more...
2. Advanced Report Authoring
Introduction
Adding cascaded prompts
Getting ready
How to do it...
How it works...
Cascaded source
There's more...
Auto-Submit
See also
Creating a nested report – defining the master-detail relationship
Getting ready
How to do it...
How it works...
The master-detail relationship
There's more...
See also
Writing back to the database
Getting ready
How to do it...
How it works...
There's more...
Adding conditional formatting
Getting ready
How to do it...
How it works...
The String variable
The Boolean variable
The report language variable
There's more...
The style variable property
The text source variable property
Formatting negative values
Getting ready
How to do it...
How it works...
Running Difference
Showing negative values in red and brackets
Playing with conditional styles
Getting ready
How to do it...
How it works...
There's more...
Using conditional blocks – many reports in one
Getting ready
How to do it...
How it works...
There's more...
Defining drill-through from crosstab intersection
Getting ready
How to do it...
How it works...
Overriding crosstab intersection drill-through definitions
Getting ready
How to do it...
How it works...
There's more...
3. Using JavaScript Files – Tips and Tricks
Introduction
Defining dynamic default values for prompts
Getting ready
How to do it...
How it works...
Span
GetElementsByTagName
SelectedIndex
CanSubmitPrompt
There's more...
Changing the title of the value prompt
Getting ready
How to do it...
How it works...
There's more...
Validating textbox prompts
Getting ready
How to do it...
How it works...
Showing/hiding prompt controls at runtime
Getting ready
How to do it...
How it works...
There's more...
Selecting and submitting values automatically
Getting ready
How to do it...
How it works...
There's more...
Manipulating the Date Time control
Getting ready
How to do it...
How it works...
There's more...
Creating a variable width bar chart using JavaScript
Getting ready
How to do it...
How it works...
There's more...
4. The Report Page – Tips and Tricks
Introduction
Showing images dynamically (traffic light report)
Getting ready
How to do it...
How it works...
There's more...
Handling the missing image issue
Getting ready
How to do it...
How it works...
There's more...
Dynamic links to an external website (a Google Maps example)
Getting ready
How to do it...
How it works...
There's more...
Alternating drill links
Getting ready
How to do it...
How it works...
Render Variable
There's more...
Showing tooltips on reports
Getting ready
How to do it...
How it works...
There's more...
See also
Merged cells in Excel output
Getting ready
How to do it...
How it works...
Worksheet name in Excel output
Getting ready
How to do it...
How it works...
There's more...
Conditional column titles
Getting ready
How to do it...
How it works...
5. Working with XML
Introduction
Changing drill targets quickly
Getting ready
How to do it...
How it works...
There's more...
Copying and pasting drill links
Getting ready
How to do it...
How it works...
There's more...
Removing references to old packages or items
Getting ready
How to do it...
How it works...
A hidden gem in XML – row level formatting
Getting ready
How to do it...
How it works...
There's more...
See also
6. Writing Printable Reports
Introduction
Controlling the container size and rows per page
Getting ready
How to do it...
How it works...
There's more...
Eliminating orphan rows
Getting ready
How to do it...
How it works...
There's more...
Defining page orientation and size (and overriding them for one page)
Getting ready
How to do it...
How it works...
Avoiding page title repetition
Getting ready
How to do it...
How it works...
There's more...
Horizontal pagination
Getting ready
How to do it...
How it works...
There's more...
Page numbering with horizontal pagination
Getting ready
How to do it...
How it works...
Choosing the output format from a prompt
Getting ready
How to do it...
How it works...
There's more...
Choosing the right colors
Getting ready
How to do it...
How it works...
There's more...
Defining page sets
Getting ready
How to do it...
How it works...
Cautions about HTML items and JavaScript files
Getting ready
How to do it...
How it works...
Displaying the report name in a footer
Getting ready
How to do it...
How it works...
7. Working with Dimensional Models
Introduction
List report or crosstab report
Getting ready
How to do it...
How it works...
Filtering rows or columns
Getting ready
How to do it...
How it works...
There's more...
Filtering a whole report
Getting ready
How to do it...
How it works...
There's more...
Adding a prompt into Slicer and its limitations
Getting ready
How to do it...
How it works...
There's more...
More Info
Achieving zero suppression
Getting ready
How to do it...
How it works...
There's more...
Aggregation versus preaggregated values
Getting ready
How to do it...
How it works...
There's more...
The roleValue() function
Getting ready
How to do it...
How it works...
There's more...
Swapping dimensions using MUN manipulation
Getting ready
How to do it...
How it works...
See also
8. Working with Macros
Introduction
Adding data-level security using the CSVIdentityMap macro
Getting ready
How to do it...
How it works...
There's more...
Using the Prompt macro in native SQL
Getting ready
How to do it...
How it works...
There's more...
Making prompts optional
Getting ready
How to do it...
How it works...
Optional_defaultValue
Pure_Optional
There's more...
Adding a token using macros
Getting ready
How to do it...
How it works...
Using the prompt() and promptmany() macros in query subjects
Getting ready
How to do it...
How it works...
Showing the prompt values in a report based on security
Getting ready
How to do it...
How it works...
String operations to get it right
Getting ready
How to do it...
How it works...
There's more...
Showing a username in the footer
Getting ready
How to do it...
How it works...
There's more...
9. Using Report Studio Efficiently
Introduction
Using Report Studio's environmental options
Getting ready
How to do it...
How it works...
View | Visual Aids
Structure | Create Crosstab Nodes
Tools | Options | View | Reuse IBM Cognos Viewer window
Tools | Options | Report
There's more...
Copying and pasting partial or full reports
Getting ready
How to do it...
How it works...
Upgrading report specifications
Getting ready
How to do it...
How it works...
Setting the execution timeout
Getting ready
How to do it...
How it works...
There's more...
Setting the maximum row limit
Getting ready
How to do it...
How it works...
Handling slow report validation
Getting ready
How to do it...
How it works...
There's more...
Capturing a query
Getting ready
How to do it...
How it works...
There's more…
Why make filters mandatory?
Query formatting
Capturing the query for the database
Browsing values from the data expression window
Getting ready
How to do it...
How it works...
There's more...
Viewing the page structure
Getting ready
How to do it...
How it works...
Picking up and applying styles
Getting ready
How to do it...
How it works...
Using the "grab them all" practice
Getting ready
How to do it...
How it works...
See also
Using Default Data Formats
Getting ready
How to do it...
How it works...
10. Working with Active Reports
Introduction
Building tabbed reports
Getting ready
How to do it...
How it works...
There's more...
Working with Decks
Getting ready
How to do it...
How it works...
There's more...
Working with the Data Deck
Getting ready
How to do it...
How it works...
Filtering data using Data Check Box Group
Getting ready
How to do it...
How it works...
There's more...
11. Charts and New Chart Features
Introduction
Chart formatting options
Getting ready
How to do it...
How it works...
Chart Palette Presets
Background Effects Presets
There's more...
Converting a chart to another chart type
Getting ready
How to do it...
How it works...
Working with pie charts
Getting ready
How to do it...
How it works...
The Summarize Small Slices property
The First Slice Angle property
The Exploded Slices property
Getting started with bullet charts
Getting ready
How to do it...
How it works...
There's more...
Getting started with scatter charts
Getting ready
How to do it...
How it works...
12. More Useful Recipes
Introduction
Timing report execution
Getting ready
How to do it...
How it works...
The report view
Scheduling
There's more...
Missing values versus zero values
Getting ready
How to do it...
How it works...
There's more...
Overriding data formatting using patterns
Getting ready
How to do it...
How it works...
Setting up conditional drill-throughs
Getting ready
How to do it...
How it works...
There's more...
Dynamically switching between reports using an iFrame
Getting ready
How to do it...
How it works...
There's more...
Freezing column titles
Getting ready
How to do it...
How it works...
There's more...
13. Best Practices
Introduction
Reducing the number of query items
Getting ready
How to do it...
How it works...
Alias member unique name
Delete unreferenced query objects
Dragging items from the Data Items pane
Highlighting hidden items
Getting ready
How to do it...
How it works...
Using relative paths for images
Getting ready
How to do it...
How it works...
There's more...
Controlling JavaScript file execution
Getting ready
How to do it...
How it works...
Customizing classes for report-wide effect
Getting ready
How to do it...
How it works...
Creating templates
Getting ready
How to do it...
How it works...
Regression testing
Getting ready
How to do it...
How it works...
There's more...
Commenting the code
Getting ready
How to do it...
How it works...
Naming data containers (lists, crosstabs, and charts) for use in Cognos Workspace
Getting ready
How to do it...
How it works...
There's more...
Enabling a larger worksheet size for Excel 2007
Getting ready
How to do it...
How it works...
There's more...
A. Recommendations and References
Introduction
Version controlling
Recommendations for prompt types
Cognos Mashup Service
SDK and third-party tools for Cognos
IBM Cognos Analysis For Excel (CAFE)
IBM Cognos for Microsoft Office
IBM Cognos Workspace
IBM Cognos Workspace Advanced
IBM Cognos Cloud
Index

IBM Cognos 10 Report Studio Cookbook Second Edition

IBM Cognos 10 Report Studio Cookbook Second Edition

Copyright © 2013 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: May 2010

Second edition: August 2013

Production Reference: 1200813

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-84968-820-8

www.packtpub.com

Cover Image by Vivek Sinha (<[email protected]>)

Credits

Authors

Ahmed Lashin

Abhishek Sanghani

Reviewers

Ramesh Parcha

João Patrão

Acquisition Editor

Joanne Fitzpatrick

Lead Technical Editor

Dayan Hyames

Technical Editors

Jalasha D'costa

Menza Mathew

Zafeer Rais

Amit Ramadas

Project Coordinators

Arshad Sopariwala

Venitha Cutinho

Proofreader

Paul Hindle

Indexers

Rekha Nair

Monica Ajmera Mehta

Production Coordinator

Shantanu Zagade

Cover Work

Shantanu Zagade

About the Authors

Ahmed Lashin is a highly motivated Information Technology (IT) professional with more than nine years of experience, most of it in the Business Intelligence and data warehousing domains. His core skills include a full set of BI tools, ETL, and data warehousing tools such as IBM Cognos, IBM DataStage, SAP BusinessObjects, Microsoft SQL Server BI SSIS, SSAS, and SSRS. Through his experience, he has been exposed to many industries such as banking and finance, oil and gas, education, and the automotive industry.

Currently, Ahmed is working as a Business Intelligence Lead in one of IBM's major global partners. He is also an IBM Certified Cognos Solution Expert.

This is Ahmed's first technical book. He is maintaining a technical blog at http://www.alashin.net. You can get in touch with him at <[email protected]>.

I would like to thank my beloved wife Esraa for all the encouragement and support she has given me. I would also like to thank my mother and my family.

I would like also to thank my partner Abhishek for his great work and his valuable comments. With your work, Cognos is much more fun.

A special thanks to Packt Publishing for their efforts. I am sure that I wouldn't have been able to complete this book without their support.

Abhishek Sanghani was born in India and attended Mumbai University, where he majored in Computer Engineering. He began his career in 2004 as a Business Intelligence and Cognos Consultant, and has worked with leading IT and financial services companies since then.

He pursued Finance Management along with his work in the field of Cognos and BI, successfully progressing and winning awards and certifications year-on-year. Presently, he is working in the United Kingdom, utilizing his skills of Cognos, SQL, BI, and data warehousing. In his free time, he writes technical blogs and also provides training/seminars on demand.

He first authored Packt Publishing's book IBM Cognos 8 Report Studio Cookbook, which was well received worldwide. He has recently composed a video course called IBM Cognos 10 Report Studio Fundamentals, which is available on the www.packtpub.com website for download as well as online streaming.

I would like to thank Ahmed for giving a new life and avatar to my Cookbook, making it suitable for Cognos v10.x. I am sure, this new book with its new content, easy-to-understand recipes, real-life examples, and v10 sample codes, will prove very useful to Report Studio users, project managers, developers, and business analysts.

I would also like to thank the whole Packt Publishing team for all the hard work and support. On a personal note, I would also like to thank my loving wife Dolly for the encouragement and for putting up with my IT nonsense at the dinner table.

About the Reviewers

Ramesh Parcha graduated with a degree in Mechanical Engineering from Gulbarga University and has been working in the IT industry for over 13 years now. He is presently working in NTTDATA as a Project Manager.

He has been working with IBM Cognos BI products since 2006.

Earlier in his career, he worked for SETKHAM, SIS Inoftech, and Dataformix Technologies, USA. He has worked on a few other books such as IBM Cognos Framework Manager, Video Course on IBM Cognos 10 Report Studio, and IBM Cognos 8 Report Studio Cookbook.

It was a great pleasure reviewing this book and I would sincerely like to thank Dayan and Arshad.

João Patrão is a technology leader with expertise in mobile development, application integration aligned with business and strategic goals, multi-disciplinary team management, and project delivery. As the IT Director of SUMA, he has built a responsive and proactive IT organization, with improvements to service delivery, standardization, and business/systems performance.

With a strong orientation to strategic and business objectives, he always looks for innovation and integration of different methods and technologies to create new solutions that can maximize the talent and the resources of the organization.

He has a background in Engineering and Computer Science at Instituto Superior Técnico (IST Lisbon) and has an Executive MBA from EGP-University of Porto Business School.

www.PacktPub.com

Support files, eBooks, discount offers and more

You might want to visit www.PacktPub.com for support files and downloads related to your book.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

http://PacktLib.PacktPub.com

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. 

Why Subscribe?

Fully searchable across every book published by PacktCopy and paste, print and bookmark contentOn demand and accessible via web browser

Free Access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.

Instant Updates on New Packt Books

Get notified! Find out when new books are published by following @PacktEnterprise on Twitter, or the Packt Enterprise Facebook page.

 

I would like to dedicate this book to my beloved wife Esraa. Thank you for being you.

  --Ahmed Lashin
 

I am dedicating this book to the smiling addition to my life, my daughter Siyara.

  --Abhishek Sanghani

Preface

IBM Cognos Report Studio is widely used for creating and managing business reports in medium to large-scale companies. It is simple enough for any business analyst, power user, or developer to pick up and start developing basic reports. However, when it comes to developing more sophisticated, fully functional business reports for wider audiences, report authors will need guidance.

This book helps you to understand and use all the features provided by the new version of IBM Cognos 10 Report Studio to generate impressive deliverables. It will take you from being a beginner to a professional report author. It bridges the gap between the basic training provided by manuals or trainers and the practical techniques learned over years of practice.

What this book covers

Chapter 1, Report Authoring Basic Concepts, introduces you to some fundamental components and features that you will be using in most of the reports. This is meant to bring all readers on the same page before moving on to advanced topics. It covers filters, sorting, aggregations, formatting and conditional formatting, and so on.

Chapter 2, Advanced Report Authoring, introduces you to the advanced techniques required to create more sophisticated report solutions that meet demanding business requirements. It covers cascaded prompts, master-detail queries, conditional blocks, defining drill links, and overriding the drill links. The most distinguishing recipe in this chapter is Writing back to the database.

Chapter 3, Using JavaScript Files – Tips and Tricks, explains how to manipulate the default selection, titles, visibility, and so on when the prompt page loads. It also explains how to add programmability like validating the prompt selection before submitting the values to the report engine. A favorite recipe in this chapter is Creating a variable width bar chart using JavaScript. The recipes in this chapter open a whole new avenue for you to progress on.

Chapter 4, The Report Page – Tips and Tricks, shows some techniques to break boundaries and provides some features in reports that are not readily available in the Studio. It also talks about showing images dynamically (traffic lights), handling missing images, dynamic links to external websites (for example, Google Maps), alternating drill links, showing tooltips on reports, minimum column width, and merged cells in Excel output.

Chapter 5, Working with XML, shows you how to edit the report outside the Studio by directly editing the XML specifications. The recipes in this chapter show you how to save time and quickly change references to old items, copy and paste the drill parameter mappings, and introduce you to important XML tags. The most intriguing recipe in this chapter is A hidden gem in XML – row level formatting.

Chapter 6, Writing Printable Reports, gives you tips and shows you the options available within the Studio to make the reports printable, as business reports need to be printed. This is often ignored during technical specification and development.

Chapter 7, Working with Dimensional Models, explains how when reports are written against a dimensional data source (or a dimensionally modeled relational schema), a whole new style of report writing is needed. You can use dimensional functions, slicers, and others. Also, filtering and zero suppression are done differently. This chapter talks about such options (as dimensional data sources are becoming popular again).

Chapter 8, Working with Macros, shows you that even though macros are often considered a framework modeler's tool, they can be used within Report Studio as well. These recipes will show you some very useful macros around security, string manipulation, and prompting.

Chapter 9, Using Report Studio Efficiently, shows you the Studio options and development practices to get the best out of Report Studio. It will include discussions about Studio options, setting time-outs, capturing the real query fired on a database, handling slow report validation, customizing classes, and so on.

Chapter 10, Working with Active Reports, introduces you to a new and powerful tool available in IBM Cognos 10 Report Studio called Active Reports. Active Reports allows you to create highly interactive and easy-to-use reports. You will learn some techniques that will change the way your reports look.

Chapter 11, Charts and New Chart Features, shows you how to use advanced features in charts available in IBM Cognos Report Studio. These features are based on the new charting engine that was introduced in IBM Cognos Version 10.

Chapter 12, More Useful Recipes, is an assorted platter of useful recipes, meant to show more workarounds, tricks, and techniques.

Chapter 13, Best Practices, shows you how to achieve code commenting, version controlling, regression testing, and so on. It will also show you some useful practices you should cultivate as standard during development.

Appendix, Recommendations and References, covers topics that are very useful for a Cognos report developer such as version controlling, Cognos mash-up service, and Cognos Go Office.

What you need for this book

IBM Cognos Report Studio 10 (10.1 to 10.2) or any later version.

Who this book is for

If you are a Business Intelligence or MIS Developer (programmer) working on Cognos Report Studio who wants to author impressive reports by putting to use what this tool has to offer, this book is for you. You could also be a Business Analyst or Power User who authors your own reports and who wants to look beyond the conventional features of Report Studio 10.

This book assumes that you can do basic report authoring, are aware of the Cognos architecture, and are familiar with Studio.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail <[email protected]>.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book on, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.

Chapter 1. Report Authoring Basic Concepts

In this chapter, we will cover the following:

Summary filters and detail filtersSorting grouped valuesAggregation and rollup aggregationImplementing if-then-else in filtersFormatting data – dates, numbers, and percentagesCreating sectionsHiding columns in crosstabsPrompts – display value versus use value

Introduction

In this chapter, we will cover some fundamental techniques that will be used in your day-to-day life as a Report Studio author. In each recipe, we will take a real-life example and see how it can be accomplished. At the end of the chapter, you will learn several concepts and ideas which you can mix-and-match to build complex reports. Though this chapter is called Report Authoring Basic Concepts, it is not a beginner's guide or a manual. It expects the following:

You are familiar with the Report Studio environment, components, and terminologiesYou know how to add items on the report page and open various explorers and panesYou can locate the properties window and know how to test run the report

Based on my personal experience, I will recommend this chapter to new developers with two days to two months of experience. If you have more experience with Report Studio, you might want to jump to the next chapter.

In the most raw terminology, a report is a bunch of rows and columns. The aim is to extract the right rows and columns from the database and present them to the users. The selection of columns drive what information is shown in the report, and the selection of rows narrow the report to a specific purpose and makes it meaningful. The selection of rows is controlled by filters. Report Studio provides three types of filtering: detail,summary, and slicer. Slicers are used with dimensional models and will be covered in a later chapter (Chapter 7, Working with Dimensional Models). In the first recipe of this chapter, we will cover when and why to use the detail and summary filters.

Once we get the correct set of rows by applying the filters, the next step is to present the rows in the most business-friendly manner. Grouping and ordering plays an important role in this. The second recipe will introduce you to the sorting technique for grouped reports.

With grouped reports, we often need to produce subtotals and totals. There are various types of aggregation possible. For example, average, total, count, and so on. Sometimes, the nature of business demands complex aggregation as well. In the third recipe, you will learn how to introduce aggregation without increasing the length of the query. You will also learn how to achieve different aggregation for subtotals and totals.

The fourth recipe will build upon the filtering concept you have learnt earlier. It will talk about implementing the if-then-else logic in filters. Then we will see some techniques on data formatting, creating sections in a report, and hiding a column in a crosstab.

Finally, the eighth and last recipe of this chapter will show you how to use prompt's UseValue and DisplayValue properties to achieve better performing queries.

The examples used in all the recipes are based on the GO Data Warehouse (query) package that is supplied with IBM Cognos 10.1.1 installation. These recipe samples can be downloaded from the Packt Publishing website. They use the relational schema from the SalesandMarketing (query)/Sales (query) namespace.

The screenshots used throughout this book are taken from Cognos Version 10.1.1 and 10.2.

Sorting grouped values

The output of the previous recipe brings the right information back on the screen. It filters the rows correctly and shows the highest selling product per product line for the selected shipment month.

For better representation and to highlight the best-selling product lines, we need to sort the product lines in descending order of quantity.

Getting ready

Open the report created in the previous recipe in Cognos Report Studio for further amendments.

How to do it...

In the report created in the previous recipe, we managed to show data filtered by the shipment month. To improve the reports look and feel, we will sort the output to highlight the best-selling products. To start this, perform the following steps:

Open the report in Cognos Report Studio.Select the Quantity column.Click on the Sort button from the toolbar and choose Sort Descending.Run the report to check if sorting is working. You will notice that sorting is not working.Now go back to Report Studio, select Quantity, and click on the Sort button again. This time choose Edit Layout Sorting under the Other Sort Options header.Expand the tree for Product line. Drag Quantity from Detail Sort List to Sort List under Product line as shown in the following screenshot:Click on the OK button and test the report. This time the rows are sorted in descending order of Quantity as required.

How it works...

The sort option by default works at the detailed level. This means the non-grouped items are sorted by the specified criteria within their own groups.

Here we want to sort the product lines that are grouped (not the detailed items). In order to sort the groups, we need to define a more advanced sorting using the Edit Layout Sorting options shown in this recipe.

There's more...

You can also define sorting for the whole list report from the Edit Layout Sorting dialog box. You can use different items and ordering for different groups and details.

You can also choose to sort certain groups by the data items that are not shown in the report. You need to bring only those items from source (model) to the query, and you will be able to pick it in the sorting dialog.

Aggregation and rollup aggregation