COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Ann on 11 Jan 2012 05:23:36 AM

Title: Run the report by default for the first member in a level
Post by: Ann on 11 Jan 2012 05:23:36 AM
Hi Guys

I have a requirement as below:
I have an organization hierarchy, in which department comes in third level.
I am having a Dept prompt(value prompt). When the report run for the first time, it should run for the first dept in my list( first in the sorted list).
I am not able to  use any JS codes to accomplish this, as my report is a part of dashboard. So the first time the report should run without asking for any prompts for the first Department.

I am trying to implement this  using a filter. I have the value prompt placed in prompt page of my report. default value given as 'All'

Now my filter will say.. dept in (case when (?dept?= 'All') then (head(dept level)) end) or dept=?dept?

But this throw an error.

Any clue please help..

Title: Re: Run the report by default for the first member in a level
Post by: CognosPaul on 11 Jan 2012 06:44:37 AM
Is this DMR or a proper cube?
Title: Re: Run the report by default for the first member in a level
Post by: Ann on 11 Jan 2012 08:00:27 AM
DMR
Title: Re: Run the report by default for the first member in a level
Post by: CognosPaul on 12 Jan 2012 03:28:13 AM
DMR makes things more difficult, as it allows people to use an unholy combination of detail filters and slicers.

The dept is a multi-select prompt? Try something like this:

[dept] in #promptmany('dept','mun','head([dept level])','set(','',')')#

Get rid of the default value in the prompt.
Title: Re: Run the report by default for the first member in a level
Post by: Ann on 16 Jan 2012 07:39:47 AM
I have few queries here.. (i am new to dimensional modeling)
what does [dept] stand for? level?
and 'dept' inside #promptmany(..) ? i assume that this is parameter name.

Title: Re: Run the report by default for the first member in a level
Post by: CognosPaul on 16 Jan 2012 07:47:29 AM
Exactly, I was simply converting your example filter.

Also, if you intend to use dept in the report (as opposed to simply filtering it) you can use the #promptmany(..)# expression in the data item, without using a filter at all.