COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: ratnalein on 17 Sep 2012 09:18:02 AM

Title: total (currentMeasure within set ...)
Post by: ratnalein on 17 Sep 2012 09:18:02 AM
Hallo everyone,

I have 3 data elements:

1. Top = topCount ([DataSet];?Top x?;NumExp)
2. SetForRest = except([DataSet];[Top])
3. Rest = member (total(currentMeasure within set [SetForRest]);'Rest';'Rest';[SchemaName].[DimensionName].[DimensionHierarchy])

Goal:
Top + Rest

So, my goal is to summarize Top and Rest.  My first move to do so looks like this:

total(currentMeasure within set[Top])

This will summarize the value from all the Top members

My question:
How can I additionally take Rest into it?  I tried this, but it didn't work:
total(currentMeasure within set[[Top],[Rest]])

Thank you..

Regards,
Ratna
Title: Re: total (currentMeasure within set ...)
Post by: Greg on 17 Sep 2012 10:23:25 AM
It looks like Top + Rest = DataSet so why don't you just calculate total( currentMeasure within set [DataSet] ) ?
Title: Re: total (currentMeasure within set ...)
Post by: tjohnson3050 on 17 Sep 2012 08:55:55 PM
I agree with Greg, you shouldn't have to try and total the two sets when you already have the set [DataSet].

However, assuming you didn't, the way to do that calculation would be:

total(currentMeasure within set( set([Top],[Rest])))

It looks strange, but after you say you want to aggregate the current measure with a set, you need to provide a valid set, in this case defined by another set command.
Title: Re: total (currentMeasure within set ...)
Post by: ratnalein on 18 Sep 2012 04:56:04 AM
Hallo Greg and tjohnson3050,

thank you for the hints, it worked with good performance.  I learnt someting -> "sometimes you have to think simple" :P

Regards,
ratna  ;)