You are on page 1of 9

IBM Cognos Proven Practices: Dynamic Sorting of a List within IBM Cognos 8 Report Studio http://www.ibm.com/developerworks/data/library/cognos/reporting/scripting_techn iques/page515.

html Month Filtering ------------------https://www-304.ibm.com/support/docview.wss?uid=swg21342131 Problem(Abstract) This document brings a sample of how to create a Report Studio (OLAP ) report to receive Year (Month ) and Period from a Metric Studio Package. Please see attached report spec based on Great Outdoors Company ( Cognos 8.2 )

Environment Cognos 8.2 Resolving the problem Add 3 data items inside the report: 1 for getting member Caption 1 for getting only month names 1 for returning and comparing Period numbers Add 2 filters inside the report: 1 for getting year 1 for getting correct period Steps:In Query Explorer ( Inside the Query )

A. Create a data item called MONTH_LABEL with roleValue('_memberCaption',[Month]) This data item will get the month caption based on format YYYY/Mon example 2007/Jan B. Create a data item called MONTH_NAME with substring([MONTH_LABEL],6,3) This data item will get the month name based on a format of YYYY/Mon example 2007/Jan C. Create a data item called MONTH_NUMBER with case [MONTH_NAME] when 'Jan' then (1) when 'Feb' then (2) when 'Mar' then (3) when 'Apr' then (4) when 'May' then (5) when 'Jun' then (6) when 'Jul' then (7) when 'Aug' then (8) when 'Sep' then (9) when 'Oct' then (10) when 'Nov' then (11) when 'Dec' then (12) else (0) end Depending on the month, the correct month number will be returned. Inside Query Explorer -> Detail Filters D. Creat a filter with roleValue('_memberCaption',[Year])=?P_YEAR? It gets correct year from the parameter.

E. Create a filter with [MONTH_NUMBER]=?P_MONTH? It gets correct year from the parameter.

Show parameter date range in the title of the page


case when (ParamDisplayValue('FromDate') is not null) then (ParamDisplayValue('FromDate')) else null end case when (ParamDisplayValue('ToDate') is not null) then (ParamDisplayValue('ToDate')) else null end

IBM Cognos Report Studio Tip: How to show hierarchy information on the top of the report
http://www-148.ibm.com/bin/newsletter/tool/landingPage.cgi? lpId=811&open&cm_mmc=4179-_-n-_-vrm_newsletter-_11022_93778&cmibm_em=dm::
By Maarten van Eck, Getronics/PinkRoccade (Netherlands) This technique describes how to display the level label from a dimension hierarchy after a drill-down action. With this technique the end-user always knows the navigation context within a dimension so that the information showing in a report will be interpreted as it should be. This technique is based on the GO Data Warehouse (analysis) model, a package that is provided with IBM Cognos 8 BI. This technique has been tested on IBM Cognos 8.3. It only works for a DMR (Dimensionally Modeled Relational) model.

Steps

1.

Using the GO Data Warehouse package, start with a blank template. Then create a table with two rows and place a crosstab on the bottom row. Drag from the Sales namespace (in the Sales and Marketing folder) the Productline (Products dimension) to the rows. Place the years (Time dimension) in the columns and drag the Quantity to the measures drop zone.

Figure 1 2. Place in the top row, a text element and type the name Level. Go to the query of the crosstab and drag a data item into the query. Type the following in the expression definition: roleValue('_levelLabel',item([Product line],0)) Name the data item LevelLabel 3. Drag a singleton object after the text label and connect this object with the query of the crosstab. Drag the LevelLabel data item into the singleton object.

Figure 2

4.

Go to Data > Drill behavior in the menu and select Allow drill up and Drill down. Now when you run the report it displays above the crosstab the Label of the level from the dimension hierarchy.

Figure 3 When you drill-down the Level will not be replaced with the next level of the hierarchy.

Figure 4 5. To accomplish the automatic replacement of the LevelLabel expression with the new Level Set (in this case Product type after the drill-down action) you need to define Member Sets and their dependency. Go to the crosstab query and change the option Define Member Sets to Yes.

Figure 5

6.

Click the Member Sets tab that appears next to the Projected Data Items Tab.

Figure 6

7.
8.

Click on the Member Sets tab next to the Projected Data Items Tab and nest the LevelLabel data item in the Product line data item. After the nesting of the Member Sets it is necessary to change the standard Drill-up and Drill-down behavior so that with each action the LevelLabel expression will be replaced with the corresponding Level Set. Go to Data > Drill Behavior and select the tab Advanced. Change for the Product line data item the behavior to 'Replace Expression'.

Figure 7

9.

Run the report again and click a Drill-down action on Productline. Now, the level label expression will be replaced with the Product Type Level and the Level will be OK.

Figure 8

How to create a checkbox prompt to control how a filter is defined. https://www-304.ibm.com/support/docview.wss?uid=swg21342048&wv=1


Problem(Abstract)

How to create a checkbox prompt to control how a filter is defined. Error: none
Resolving the problem

Use a promptmany() macro in a filter expression which utilizes a prompt parameter that is set to a static value. Steps:1) Open new list report in report studio using Go Sales & Retailers package. 2) Drag Order Year and Quantity from the Orders Query Subject into the list report. 3) Go to Page Explorer and add a new prompt page. 4) Go to the prompt page and add a value prompt to it. Call the prompt parameter 'checkbox' and click Finish. Select the value prompt and under properties set the following: a) Under the "General" section, set Required=No, Multiselect=Yes, Select UI=check box group b) Double click "Static Choices" and click Add button. Enter Use=checked, Display=Check this box. Click OK. c) Under Positioning, double-click "Size & Overflow". Set the height=40 px. Click OK. 5) Go to page explorer, select a cell in the list report and click the Filter button in the button bar to add a filter. a) Under Tabular Filters section, click the Add button and add the following: if(#promptmany('checkbox', 'string', sq('notchecked'))# = 'notchecked') then ([Order year] = [Order year]) else ([Order year]=2004) Click OK and OK again. 6) Run the report. When the checkbox is selected the report displays quantity ordered for order year= 2004. When the checkbox is not selected the report displays all quantities ordered for all order years.

IBM Cognos Proven Practices: Auto Cascading Prompts without Page Refresh in IBM Cognos Report Studio

http://www.ibm.com/developerworks/data/library/cognos/reporting/advanced_report_design/page5 83.html

Casting
cast([LFBW].[ZZVIW_EDI852_SELLTHRO_FINAL].[Units_Sold_Last_Week] as decimal(36,6))/ cast( ([LFBW].[ZZVIW_EDI852_SELLTHRO_FINAL].[Units_Onhand]+ [LFBW].[ZZVIW_EDI852_SELLTHRO_FINAL].[Units_Sold_Last_Week]) as decimal(34,4))

You might also like