Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using of prompt parameter in expression on a report

Status
Not open for further replies.

salusa

MIS
Aug 27, 2007
5
CZ
I'm stuggling with use of the prompt parameters in my expressions in Report Studio. I'm using Cognos 8 BI Platform, PowerPlay Transformer for cubes creation and Report Studio to create reports.

I have prompt for selection of month from automatically generated dimension from Transformer and for this particular month I'd like to create YTD (year-to-date) calculation. In cube there are data for entire year and one year back.

I'm trying to use filter like this:
[Dummy].[Time].[Time].[Year] = ancestor(?p_month?;1)

or this

[Dummy].[Time].[Time].[Year] <= ?p_month?

Nothing works (errors before any report shows up).

Suggestions?
Thanks,
Jan.
 
?p_year? is a good idea, but I have trouble with extracting the prompt parameter to a report..

p_month is based on time dimension defined in PowerPlay, this dimension has two levels (Year, Month). Now I'd like to extract current month and current year from prompt parameter to design appropriate filters.

How should I make such filters?
Error message I'm experiencing is:
OP-ERR-0198
Invalid prompt use was found in expression="ancestor(?p_month?;1)".

How to use prompt parameters properly?
Very thanks, J.
 
I usually have my year and month in date range prompts. If you can't do that, then you have to have year choice and month choice for each dimension.

CP [cook]
 
I've finally resolved the YTD calculation. No filters are required and here is the solution I made up:

I have defined a parameter prompt p_month, parameter values are populated from Time dimension with 2 levels: Year and Month. Cube name is Dummy.

To find out what month was selected in the prompt I'm using CurrentMonth dataitem with following query:

[Dummy].[Time].[Time].[Month] -> ?p_month?


To define a set of months making the YTD set I'm using YTDSet dataitem:

periodsToDate([Dummy].[Time].[Time].[Year];[CurrentMonth])

Finally, sum of values in YTD set is done by total aggregation:

total([Dummy].[Measures].[Profit_Item_Amt] within set [YTDSet])

And that's it! ;o)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top