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

TopCount() changing all other columns in report?

Started by tschuman13, 08 Aug 2012 11:46:20 AM

Previous topic - Next topic

tschuman13

I have run out of ideas and I need help with a report that is 95% complete.  I am using a PowerCube and C10.

Some background info:

Dimensions in the cube (for specific report) are:
Group -> Company -> Issuer
State
Coverage Type

Measures (for specific report)
Group Category Count
Premium Amount

I am using a list report due to the requirement to show a text value in the report.

The report has the following columns:
Coverage Type (Group By) / State Name/ # of Groups in State / Name of Largest Group / % Premium of Largest Group/ % Premium of 3 Largest Groups/ # of Groups that make up top 90%

I have everything working except for the Name of Largest Group.  When I try to calculate this, I can get the right value but all other calcs break and give just the value for the largest group.  The function I am trying to use is:

item(
    TopCount(set of Groups, 1, Premium)
    ,0
)
The function I am using to get the other values are variations of this:
aggregate(
   Premium within set
   (
      topCount (
         Groups
         ,1
         ,Premium
      )
   )
)

count(
   1 within set
   (topPercent (
      Groups
      ,90
      ,Premium
   )
)
)

So it looks like the within set scope keeps the report from filtering all results.  Is there a way to bring back the 1st member and display it in the same report?
Thanks in advance for any help!

Attached before and after images to help visually describe the issue...

CognosPaul

The same way Cognos transforms a relational source for a crosstab, it needs to transform a dimensional source for a list. Unfortunately it doesn't always work the way you want it to.

Recreate the report in a crosstab. In the rows, place the topCount that you wrote. Immediately to the right, place a new calculation:
completetuple([All Member from Group],currentMember([Coverage Hierarchy),currentMember(State Hierarachy))

That will essentially override the topCount. Hide those two nodes by setting boxtype to none. Drag in a crosstab space into the crosstab, and set defined contents to yes in the intersections. Unlock the report and drag in the topCount calculation into the intersection. If all goes well, you should see the text inside the crosstab.

tschuman13

Thanks for the response Paul.

I've never used the completeTuple() function before, so that makes sense to nest it in the rows to all values are kept in scope.

I am able to get the names of the Groups in the crosstab now but my values in the report are coming across as NULLs.  Is there something I am missing?  I am attaching the xml and screen capture.

Thanks again for your help with this.  Very much appreciated.

CognosPaul

Remember that the measures is also a dimension. Stick currentMeasure into the completetuple list and try again.

completetuple(
currentMeasure
, allMember
, currentMember()
, currentMember()
)

tschuman13

That did the trick.  Very cool idea to hide it in the crosstab.  I would have never gotten it on my own.

The completeTuple() function is very useful.  I definitely plan to use it more in the future.

Thank you very much for your help.