COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: tushar gaurav on 29 Apr 2015 02:04:02 AM

Title: How to apply prompt for current month and previous two months in DMR.
Post by: tushar gaurav on 29 Apr 2015 02:04:02 AM
Hi ,

I am using Dimensional package in my reports.
We have time dimension with month as one the level.
Now I need to create a prompt for month and need to show data as per the month selected alongwith previous two months too.
Can anyone plz let me know which dimensional function should be used in such scenarios??
Title: Re: How to apply prompt for current month and previous two months in DMR.
Post by: schrotty on 29 Apr 2015 02:36:44 AM
Hello tushar,

Do you know how to create a prompt to select your month? (create a Data Item [SelectedMonth] with function: [Dimensional Path for Month] -> ?p_ParameterXYZ?)

To get the two previous months you can use the lastPeriods()-function: lastPeriods(3; [SelectedMonth])

Alternativly you can create foreach previous Month a Data Item with the lag/lead-functions: lag([SelectedMonth];1) and lag([SelectedMonth];2)


schrotty.





Title: Re: How to apply prompt for current month and previous two months in DMR.
Post by: tushar gaurav on 29 Apr 2015 05:14:42 AM
Hi Schrotty,

Thanks for your help,but I am not able to create prompt for month.
Actually in Time dimension there is a level called period which have a member called Month.So this Month that I need to use is neither a Level nor a hierarchy,so I am trying to use a parameter filter for this member month I am getting error.
Can you please let me know how to create a parameter filter using member.
Title: Re: How to apply prompt for current month and previous two months in DMR.
Post by: schrotty on 29 Apr 2015 06:27:17 AM
Hi tushgar,

I'm confused how your Time dimension is organized?!  :o

So the time dimension got a hierachy x. How many Levels are in These hierachy? What names do they have?
Does the Member "month" got any children?

Could you please describe your Time dimension in detail?
(Maybe you can post a screenshot of your expanded Time-Dimension?)

schrotty


Title: Re: How to apply prompt for current month and previous two months in DMR.
Post by: tushar gaurav on 29 Apr 2015 08:20:44 AM
Hi Schrotty,

Thanks for your reply.
The Time dimension that I am using is like the image that I have attached.
The month can drill down to weeks.
Now I need to apply parameter filter on months .But when I do that I am getting error "The metadata part of the member is not a level or hierarchy as expected"..
Please let me know how to overcome this problem.


Title: Re: How to apply prompt for current month and previous two months in DMR.
Post by: MFGF on 30 Apr 2015 03:42:14 AM
Quote from: tushar gaurav on 29 Apr 2015 05:14:42 AM
Hi Schrotty,

Thanks for your help,but I am not able to create prompt for month.
Actually in Time dimension there is a level called period which have a member called Month.So this Month that I need to use is neither a Level nor a hierarchy,so I am trying to use a parameter filter for this member month I am getting error.
Can you please let me know how to create a parameter filter using member.

If your level is called Period (and contains month members) then all you should need to do is to add a query calculation to your report using an expression like:

[your period level] -> ?Your parameter?

Cheers!

MF.