Vous êtes sur la page 1sur 7

Cognos 8 Tip Creating a Parameterized Slicer

By Nanci Forgeron, Education Specialist, Education Services, Cognos, Toronto, Canada

Here is a very neat tip that will enable a report that uses a slicer, created in Report Studio, to be defined via a parameter applied to the slicer member set. This procedure uses the Great Outdoors Company package and creates the slicer for the Product Line level. 1. Build a cross tab report with "Year level" as the column, "Order Method1" as the row and "Revenue" as the measure.

2. 3.

Navigate to the Query Explorer and into your report "Query1", drag a "Slicer Member Set" from the Toolbox tab to the Slicer pane. In the Slicer Member Set Expression pane,

o o o

Type set ( From the "Data Items" tab, drag the Product line level after the parentheses Append to the end of the Product line level -> ?Products?

The expression should read as follows: set([great_outdoors_company].[Products].[Products].[Product line]-> ?Products?)

4. 5. 6. 7. 8.

Using the Page explorer return to Page1. We will now add a string literal and a prompt for the slicer. From the Toolbox, drag a block object to the left of the cross tab. Drag a Text item from the Toolbox and enter the following string "Values for: " The next step is to drag the "Value Prompt" object from the Toolbox and position it to the right of the Text item within the block. When the Prompt Wizard dialog box is displayed, select the option "Use existing parameter" and select "Products" from the drop down list box. Click Next.

9.

On the second dialog box of the Prompt Wizard, select the default settings and click "Finish".

10. The completed page layout should look as follows:

11. The final steps are to set the properties of the "Value Prompt" and provide a default value. Highlighting the "Value Prompt" in the page layout will display the properties in the Properties pane. Set the following properties for the "Value Prompt":

o o o o

Required: Yes Multi-Select: No Select UI: Drop down list Auto-Submit: Yes

12. To ensure that the default prompt page is not generated, a value must be set for the "Default Selections" property of the Value prompt. Since the prompt is built against a

cube the Member Unique Name (MUN) must be used for the default value. To obtain MUN value you want as the default selection; highlight the member on the Source tab of the Insertable Objects pane. Right click to activate the context menu. In this example we will use "Personal Accessories". On the Properties of member highlight the Member Unique Name, right click to activate the context menu and select copy.

The MUN should look as follows. [great_outdoors_company].[Products].[Products].[Product line]->: [PC].[@MEMBER].[3~238]

13. Once the MUN is in the paste buffer we now must set the default value for the Value Prompt. Highlight the "Value Prompt" on the page. Using the Properties page select "Default Selections". Click the "Add" icon of the Default Selection dialog box. Then select "Simple Selection".

14. Right click and paste the MUN name for Personal Accessories into the "Add value" field. Click OK twice to close the Default Selections dialog.

15. Click the "Run Report" button on the toolbar to execute the report. The report should resemble the following screen capture.