If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Set a Default value for a Slicer

Started by chawki, 28 Sep 2010 03:21:57 AM

Previous topic - Next topic

chawki

Hi Everybody,
I create 2 reports:
1-the first report contain a prompt in which we select the society (list of society). I named the parameter of the prompt "ParamSoc".
2-in the second Report I have a croostable of revenue by product and year. In this report I added a slicer in Query like this "[CubeName].[DimensionName].[LevelName].[Hierarchie]->?ParamSoc?".
The problem is that every time when I run the second report, it ask me to select the society.
So i like to find a method that define a default value for my parameter "ParamSoc", i like that the report run directly with the default society and it will not ask me to select the society.

I found a method in other Forum: to add a prompt page in the second report with a prompt of list of society like the first report and I added in Default selection of the prompt this expression: "[CubeName].[DimensionName].[LevelName].[Hierarchie]->:[PC].[@MEMBER].[1]"


And it doesn't work. :(

please if you have any suggestion to help me.

Thanks.

CognosPaul

You can use a prompt macro for this. A prompt macro is almost always preferable to a prompt alias.

To begin with, the structure of the prompt macro:
#
prompt(
'ParameterName'
,'DataType'
,'default value'
,'Leading Text'
,'Source'
,'trailing text')
#

In your case you need to prompt for a memberuniquename, so you could do something like the following:
#prompt('ParamSoc','memberuniquename','[CubeName].[DimensionName].[LevelName].[Hierarchie]->:[PC].[@MEMBER].[1]','','[CubeName].[DimensionName].[Hierarchy].[LevelName]')# This will prompt the user to optionally select a member from the level LevelName in Hierarchy, or return [CubeName].[DimensionName].[LevelName].[Hierarchie]->:[PC].[@MEMBER].[1] if no member is selected.

It's worth mentioning that the default value doesn't need to be a member from that hierarchy, it could be from a different dimension altogether, or even a calculated member.

chawki

Thank you for your suggestion
I don't have any idea about prompt macro.
can you tell me more about it.