COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: mel4363 on 25 Aug 2014 02:05:22 AM

Title: Nesting Prompt Macros
Post by: mel4363 on 25 Aug 2014 02:05:22 AM
Hi Everyone,

Just a quick question,

Is there anyway that I may nest these two prompt macros?

1. #promptmany('buSearchParam';'memberuniquename';'[Presentation Layer].[VU Vehicle Business Unit].[Unit].[Business Unit]';'set(','[Presentation Layer].[VU Vehicle Business Unit].[Unit].[Business Unit]',')')#

2. set (#promptmany ('organisation';'MUN';'[Presentation Layer].[VU Vehicle Business Unit].[Unit].[Unit Desc(All)]->[all]')#)

They work seperately but I have two prompts that feeds the same column

Anyway to do this?

Thank you.

Mel
Title: Re: Nesting Prompt Macros
Post by: CogentNostra on 05 Sep 2014 01:53:10 PM
Hi mel,

It looks like you have two different mun's being fed by your prompts, but you are saying you want them to feed the same column?

I assume you are trying to get both of these prompts to feed the same column, in which case, you can use nearly the same logic for both prompts.  Your choice which one to modify, based on your needs. But let's assume you keep the first one and modify the second one in your example.  I would suggest modifying the second one as follows:

2. set  (#promptmany ('buSearchParam';'MUN';'[Presentation Layer].[VU Vehicle Business Unit].[Unit].[Business Unit]','','[Presentation Layer].[VU Vehicle Business Unit].[Unit].[Business Unit]')#)

Basically, the same prompt as the first one, but you move the "set(" function outside the promptmany macro; and you set the parameter name the same as in the other prompt so the report knows that input into one also feeds the other.  This approach has worked for me when I need a slicer using the #promptmany macro and a data item in my query which is then displayed as a set in my report.

Hope this helps!

-CN