COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Shamar on 19 May 2015 07:21:33 AM

Title: Dynamically changing the column based on prompt
Post by: Shamar on 19 May 2015 07:21:33 AM
Hello Gurus!!!

I need to find the 12 months moving average based of prompt (Year and month) selection in multidimensional report.

I tried like this :
aggregate([Measure] within set lastPeriods(12, #prompt('P_Month','string','[namespace].[dimension].[hierarchy].[Month]')#))/12 . But am getting Invalid coercion error.

Can anyone please suggest me , how to pass parameter in the data item to change dynamically.

environment : cognos 10.2.1
source : Cube
DB : Sql Server
Title: Re: Dynamically changing the column based on prompt
Post by: cognos05 on 19 May 2015 07:55:16 AM
Can you try this

aggregate(currentMeasure within set (lastPeriods(3,#prompt('Parameter1','mun','[Time Period]')#)))

Here [TimePeriod] is my top level member in my time hierarchy.

You can also set a default value to prompt if you dont want to show the top level member on start. On changing the prompt values it would automatically pick up the values.

Thanks,
Nithya
Title: Re: Dynamically changing the column based on prompt
Post by: Shamar on 19 May 2015 08:39:22 AM
Hey Nithya1224!!!

   Applauds  :)

   Thank U , Its working fine.

Thanks,
Shamar