COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: terry_stjean on 04 May 2010 01:07:31 PM

Title: Month range selection in a cube report
Post by: terry_stjean on 04 May 2010 01:07:31 PM
I am building a report based on a cube. The date dimension consists of Year/Quarter/Month.
I have to allow the user to select a From and To Month for the report.
Suggestions on what type of prompt for the Prompt screen and syntax in the query would be great.

Title: Re: Month range selection in a cube report
Post by: terry_stjean on 04 May 2010 01:41:41 PM
Never mind. I found an example.
Title: Re: Month range selection in a cube report
Post by: cognostechie on 04 May 2010 07:26:27 PM
Can you post the solution here?
Title: Re: Month range selection in a cube report
Post by: terry_stjean on 05 May 2010 07:09:17 AM
intersect(lastPeriods(-9999, [Compensation Cube].[Date].[Date].[Month]->?pFrMonth?),
lastPeriods(9999,  [Compensation Cube].[Date].[Date].[Month]->?pToMonth?))

There are 2 Value prompts and they display the Month level from [Compensation Cube].[Date].[Date].[Month].
Title: Re: Month range selection in a cube report
Post by: cognostechie on 05 May 2010 04:52:36 PM
Thanks. I found the same from IBM KB.

I also added a column to sum up the data for all the Months selected from the Prompt

total(currentMeasure within set[Range of Months])

In this case 'Range of Months' is the name of the data item containing your calculation.