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

Rearranging members within a subset.

Started by suhas_bhat, 26 Aug 2010 02:09:18 AM

Previous topic - Next topic

suhas_bhat

Hi,
My members of a level are a,b,c,d,e,f.I have created a subset of first 3 members therefore i have a,b,c now. When i use this data item in my crosstab report it displays as a,b,c. I want to interchange the members so that they display as a,c,b.
What is the function to interchange members? I do not want to sort them on any value expression.
Please help.

Thanks.

CognosPaul

The easiest way to do this would be to add a Sort Order to the attributes of the level. Then you could do something like:

order([MySet],[NS].[Dim].[Hier].[Level].[Sort] ASC)

If that's not possible then you'd have to use the set functions. ITEM, TAIL, HEAD, SET, and so on.

First you need to define the logic. Is it always going to be 3 items, A B C reordering to A C B?

set(item([MySet],0),item([MySet],2),item([MySet],1))

Can there be an unknown number of members? If so, does the last member need to go to the second place?

set(item([MySet],0),item(tail([MySet]),0),except([MySet],set(item([MySet],0),item(tail([MySet]),0))))

The more complex the logic, the more complex the statement. But as long as there is a consistent logic, then it's possible.

suhas_bhat

Thanks Paul, this worked out perfectly.  :)