If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Count members in a set

Started by RubenvdLinden, 07 Oct 2009 04:13:12 AM

Previous topic - Next topic

RubenvdLinden

Hi,

I have a report where the user can select a year and the month of the year.
Next, I created a new data item [YTD] and used periodsToDate to get all months until the selected month.
I would like to count these months, so I tried to create a new dataitem [Number of months] with the expression

count(1 within set set([YTD]))

Until here, everything works fine.


Finally, I added a simple prognosis using

[Result] / [Number of months] * 12

The expression evaluates fine, however when I try to run the report it returns:

OP-ERR-0046 Unable to support query items from the same dimension on different report dimensions: {0}.
OP-ERR-0046 Unable to support query items from the same dimension on different report dimensions: <nodeRef ID="OPSummaryQuery::CheckQRDDimensions()"/><nodeRef ID="dimension="[MEASURES]"; edge="axis(2)"; edge="axis(0)""/>.


I hope anyone can help me or provide me with a better solution to calculate my prognosis.
Thank you.

billylodz

try this
total(currentMeasure within set [YTD]) /count(currentMeasure within set [YTD]) *12

TomasF

or this:

12 * average(currentMeasure within set [YTD])


    Tomas

RubenvdLinden

Thank you both.

I replaced currentMeasure with the actual measure I needed to make it work.
My solution to count the members was a bit difficult, considering the possibility to use the average function directly ...