Você está na página 1de 15

Tip or Technique

Creating Dynamic Analysis Studio


Type Reports in Report Studio
Part-1

Product(s): Report Studio


Area of Interest: Report Design
Creating Dynamic Analysis Studio 2
Type Reports in Report Studio Part-
1

Copyright
Your use of this document is subject to the Terms of Use governing the
Cognos software products and related services which you have licensed or
purchased from Cognos. The information contained in this document is
proprietary information of Cognos Incorporated and/or its licensors and is
protected under copyright and other applicable laws. You may use the
information and methodologies described in this document 'as is' or you may
modify them, however Cognos will not be responsible for any deficiencies or
errors that result from modifications which you make. Copyright 2006 (c)
Cognos Incorporated. All Rights Reserved.
You can print selected pages, a section, or the whole book. Cognos grants
you a non-exclusive, non-transferable license to use, copy, and reproduce the
copyright materials, in printed or electronic format, solely for the purpose of
providing internal training on, operating, and maintaining the Cognos
software.
This document is maintained by the Best Practices, Product and Technology
team. You can send comments, suggestions, and additions to Best Practices,
Product and Technologies.

Cognos Proprietary Information


Creating Dynamic Analysis Studio 3
Type Reports in Report Studio Part-
1

Contents
1 INTRODUCTION ............................................................................................ 4
1.1 PURPOSE .............................................................................................................. 4
1.2 APPLICABILITY ....................................................................................................... 4
2 REPORT REQUIREMENTS.............................................................................. 4
2.1 EXAMINING THE ANALYSIS STUDIO REPORT .................................................................... 4
3 REPORT STUDIO REPORT ............................................................................. 5
3.1 STEP1 ................................................................................................................. 5
3.2 STEP 2 ................................................................................................................ 5
3.3 STEP 3. ............................................................................................................... 6
3.4 STEP 4 ................................................................................................................ 7
3.5 STEP 5 ................................................................................................................ 8
3.6 STEP 6 .............................................................................................................. 10
3.7 STEP 7 .............................................................................................................. 11
3.8 STEP 8 .............................................................................................................. 12
3.9 STEP 9 .............................................................................................................. 13
4 CONCLUSION .............................................................................................. 15

Cognos Proprietary Information


Creating Dynamic Analysis Studio 4
Type Reports in Report Studio Part-
1

1 Introduction
1.1 Purpose
This document is intended to help anyone who has a requirement to use
Report Studio to perform some of their OLAP type reporting, yet still retain
some of the Analysis Studio type functionality. Only a couple of Analysis
Studio reporting techniques are created in this document, and it is intended
as an example of what can be done in Report Studio. This is part-1 of the
entire technique in which we will create the basic crosstab report which will
be used in part-2 where we further enhance the report and make it more
dynamic. An advanced knowledge of OLAP and report design for Cognos8 is
recommended to fully understand the techniques in this document.

1.2 Applicability
This document was created using Cognos8 MR2 specifically the Great
Outdoors Company sample cube that comes with the product. At the time
the document was created all techniques were validated and supported.

2 Report Requirements
2.1 Examining the Analysis Studio Report
Assume the report you need to recreate in Report Studio is a crosstab report
with Products on the rows, and Years on the columns. For the sake of
simplicity the totals for Years has been removed and the number of visible
items on the rows is set to a custom level of 2. The report in Analysis Studio
looks like the one below (diagram 1).

Diagram 1.

Cognos Proprietary Information


Creating Dynamic Analysis Studio 5
Type Reports in Report Studio Part-
1

We now know that we need to create a report which has Products


(summarized) on the Rows with the number of visible items set to 2, Years
(not summarized) on the columns and lastly we have to create some sort of a
calculation that will calculate the total of all remaining products that we cant
see.

3 Report Studio report


3.1 Step1
Open Report Studio against the Great Outdoors Company sample cube and
when prompted choose to create a new report, and then choose the crosstab
template to work from. From the Tools menu select Options and ensure
the Show members folder check box is enabled (Diagram 2.).

Diagram 2.

3.2 Step 2
Expand the Years dimension, then the Years Hierarchy and drag Year
level onto the columns and then from the Measures drag Quantity sold into the
cells (diagram 3.).

Cognos Proprietary Information


Creating Dynamic Analysis Studio 6
Type Reports in Report Studio Part-
1

Diagram 3.

3.3 Step 3.
Now expand the Products dimension, then the Products hierarchy, then the
Products level, and finially the Members folder and drag the Products member
onto the rows of the report. Youre report should now look like Diagram 4 and when
run the results should look like Diagram 5. Save this report at this point so if a
mistake is made you have something to fall back on.

Diagram 4.

Cognos Proprietary Information


Creating Dynamic Analysis Studio 7
Type Reports in Report Studio Part-
1

Diagram 5.

3.4 Step 4
This isnt quite what we had in Analysis Studio. For starters we need to have the
Products level expanded to show the members beneath it, and then we have to
restrict the number of members we actually see to 2. We inserted the Products
level for a reason. While its not quite the level of data we wish to see, it is needed
in order to create some of the new members were going to create as well its key
to have this level in our report for the dynamic feature of this report youll create
later on.
First we need to create a new member which will display the member beneath the
Products level. To do this open the Query Explorer window and select Query1
(Diagram 6.)

Cognos Proprietary Information


Creating Dynamic Analysis Studio 8
Type Reports in Report Studio Part-
1

Diagram 6.

3.5 Step 5
Using the Toolbox, drag a Data Item from the Insertable Objects pane into the
Data Items section of your query (Diagram 7). In the Expression Definition box
type in children(). Now select the Data Items tab of the expression editor and
drag the Products data item in between the ( and ) brackets. Your calculation
should look like, children(Products), see Diagram 8.

Diagram 7.

Cognos Proprietary Information


Creating Dynamic Analysis Studio 9
Type Reports in Report Studio Part-
1

Diagram 8.

Rename this data item to something a little more logical like Full Members List
(Diagram 9).

Diagram 9.

Cognos Proprietary Information


Creating Dynamic Analysis Studio 10
Type Reports in Report Studio Part-
1

3.6 Step 6
The next step is to create the member which will display only the number of
members from the Full Members List that was defined by the report specification.
In this case we only wish to show the first 2 members. To do this we need to create
a new data item. From the Tool Box drag a Data Item object into the Data
Items pane. In the Expression Definition dialog box enter the following syntax:
_firstfromset(
Next select the Data Items tab for the Available Components, and drag the query
item we previously created (Full Members List) to the right of the syntax you just
entered. Youre calculation should now look like (Diagram 10).
_firstfromset([Full Members List]

Diagram 10.

To complete the calculation we need to tell the function the number of members to
display (numeric_exp_max), as well as define the number for overflow
(numeric_exp_overflow). In our case we are going to use 2 for both, each value is
separated by a comma. Your final calculation should look like (Diagram 11.)

Cognos Proprietary Information


Creating Dynamic Analysis Studio 11
Type Reports in Report Studio Part-
1

Diagram 11.

If you choose to, verify the calculation and then press the OK button. Lastly
rename the data item to something more descriptive like Products Displayed

3.7 Step 7
Next you need to create the calculation to calculate the total of all the members in
the level, whether they are displayed or not. To do this you need to once again add
a new data item. Follow the same steps as what were described previously to add a
new Data Item object. In the syntax enter the following: (Diagram 12)

total(currentMeasure within set [Full Members List])

When ready validate the expression and then press OK. Rename the data item to
Total.

Cognos Proprietary Information


Creating Dynamic Analysis Studio 12
Type Reports in Report Studio Part-
1

Diagram 12.

3.8 Step 8
Next you need to create the calculation to total the members not displayed in the
level. To do this you need to once again add a new data item. Follow the same
steps as what were described previously to add a new Data Item object. In the
syntax enter the following: (Diagram 13)

member([Total] - (aggregate(currentMeasure within set [Products


Displayed])),'More Subtotal','More Subtotal',hierarchy([Full Members List]))

When ready validate the expression and then press OK. Rename the data item to
More Subtotal. Lets look at this calculation a little closer. We have already
created the [Total] calculation which calculates the total quantity for all members in
the level. In order to calculate the total of the members not displayed by the
Products Displayed data item we will need to take the total for all the members in
the level and subtract the total of the members which are displayed. To calculate
the total of the members displayed in the report we use the following syntax:
aggregate(currentMeasure within set [Products Displayed])

You can either create a separate data item for this total, or include it in the Member
Subtotal data item as I have done here. Since we do not need this total for any
other part of the report it simplifies things to have it built into the Member Total
data item. The last part of this calculation has 3 parts, one which defines the data
item within the report, the second piece is the caption for the data item used in the
report and the last part defines the hierarchy for which the calculation is based upon.

Cognos Proprietary Information


Creating Dynamic Analysis Studio 13
Type Reports in Report Studio Part-
1

Diagram 13.

3.9 Step 9
Next we need to add the data items weve created into the actual report page. From
the Page Explorer select Page1. Either right click on the Products data item and
select Cut or Left click the Products data item to highlight it and then select cut
from the Edit menu to remove this data item. We dont want to delete it from the
report, just remove it from the page so we use cut.
Now select the Data Items tab from the Insertable Object pane and drag
Products Displayed onto the rows. Repeat the steps dragging the More Subtotal
data item, followed by the Total query item. Youre report should now look like
Diagram 14 and when run the results should look like Diagram 15.

Cognos Proprietary Information


Creating Dynamic Analysis Studio 14
Type Reports in Report Studio Part-
1

Diagram 14.

Diagram 15.

Cognos Proprietary Information


Creating Dynamic Analysis Studio 15
Type Reports in Report Studio Part-
1

4 Conclusion
You should now have a report which resembles the default Analysis Studio structure
including "Visible Members". This is what Analysis Studio provides so that users are
able to focus on a limited number of items in their analysis session. In order to get
better business value from your reports, we suggest adding filters to these sets such
as Top X or something more meaningful to your business than simply the first X
members. Part 2 will provide more information about using member sets with filters.
The next step is to make this report more dynamic by allowing drilling up and down
on the members to mimic the behaviour that is by default available in Analysis
Studio. Creating Dynamic Analysis Studio Type Reports in Report Studio Part-2
will step you through how to enable drill through, as well as the use of Member
Sets to ensure that the proper context is retained when drilling up or down.

Cognos Proprietary Information

Você também pode gostar