COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: raj_aries81 on 28 May 2014 01:40:02 PM

Title: Prompt Macro in DMR Crosstab
Post by: raj_aries81 on 28 May 2014 01:40:02 PM
Hi All,

Instead of filtering the Year, I want to use the below code in crosstab for comparing YTD Vs PYTD. I tried below two approaches.
However, I could not get it right. Is there something that is causing the issue

[Year]->#prompt('Param_Year','token','closingPeriod([Prod Level Cube].[Time Dim].[Report Period].[Year])')#

or

[Year]->#prompt('Param_Year','MUN','roleValue('_memberUniqueName',closingPeriod([Prod Level Cube].[Time Dim].[Report Period].[Year]))')#

Thanks & Regards
Raj
Title: Re: Prompt Macro in DMR Crosstab
Post by: Lynn on 28 May 2014 02:09:24 PM
Quote from: raj_aries81 on 28 May 2014 01:40:02 PM
Hi All,

Instead of filtering the Year, I want to use the below code in crosstab for comparing YTD Vs PYTD. I tried below two approaches.
However, I could not get it right. Is there something that is causing the issue

[Year]->#prompt('Param_Year','token','closingPeriod([Prod Level Cube].[Time Dim].[Report Period].[Year])')#

or

[Year]->#prompt('Param_Year','MUN','roleValue('_memberUniqueName',closingPeriod([Prod Level Cube].[Time Dim].[Report Period].[Year]))')#

Thanks & Regards
Raj

It might help if you explain what the issue is.
Title: Re: Prompt Macro in DMR Crosstab
Post by: raj_aries81 on 28 May 2014 09:28:52 PM
Lynn,

For one of the reports, i have inline prompts in the report page.so whenever report is run it should not prompt the user to select any specific year.instead it should
run for current year and the values should be compared against previous year. I am trying to pass current year as default value using the below code in crosstab calculation

[Year]->#prompt('Param_Year','token','closingPeriod([Prod Level Cube].[Time Dim].[Report Period].[Year])')#

The above code works fine if i use = instead of -> but will not serve the purpose as the year gets filtered for the selected year 
Title: Re: Prompt Macro in DMR Crosstab
Post by: raj_aries81 on 29 May 2014 04:18:15 AM

Can I set a default value for a prompt macro and use it in a crosstab node instead of filter.

eg:[Year]->#prompt('Param_Year','token','closingPeriod([Prod Level Cube].[Time Dim].[Report Period].[Year])')#
Title: Re: Prompt Macro in DMR Crosstab
Post by: raj_aries81 on 29 May 2014 06:49:38 AM
Quote from: Lynn on 28 May 2014 02:09:24 PM
It might help if you explain what the issue is.

Lynn,

[Year]->?Year? works fine, can I use prompt macro instead of ?Year?
Title: Re: Prompt Macro in DMR Crosstab
Post by: Lynn on 29 May 2014 07:50:11 AM
Quote from: raj_aries81 on 29 May 2014 06:49:38 AM
Lynn,

[Year]->?Year? works fine, can I use prompt macro instead of ?Year?

I don't see why not, although you shouldn't be using detail filters. This post provides some excellent advice on that subject: http://www.cognoise.com/index.php/topic,24931.0.html