COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: ryan.thomas on 08 Mar 2010 06:46:33 PM

Title: Hierachy of one level
Post by: ryan.thomas on 08 Mar 2010 06:46:33 PM
Hi All,

Environment: 

I have multiple levels within the GL Account hierarchy structure. 
How do I select one level, and it's sub levels only?

Example:
1
  1.2
    1.2a
2
  2.1
     2.1a
     2.1b
     
I have tried using hierarchy(1.2) and get the levels below 1.2 and also the
other category and levels under 2.  Since the GLAccount structure can change on
a weekly basis, the function needs to be dynamic.  I cannot use the except and set
function to list all levels I do not want.

Thank you in advance for the help.

Ryan

Title: Re: Hierachy of one level
Post by: redmist on 08 Mar 2010 08:26:45 PM
What do you mean by the structure being dynamic? Assuming that you know the name or part of the name of your level you could use the filter function

filter([CUBE_NAME].[DIMENSION_NAME].[HIERARCHY_NAME].[LEVEL_NAME], caption([CUBE_NAME].[DIMENSION_NAME].[HIERARCHY_NAME].[LEVEL_NAME]) = 'NAME')

Children of this level can be obtained by nesting another data item with the following function

children(currentMember ( [CUBE_NAME].[DIMENSION_NAME].[HIERARCHY_NAME] ))

Title: Re: Hierachy of one level
Post by: ryan.thomas on 09 Mar 2010 10:47:43 AM
Thanks redmist..

The hierarchy must be dynamic, meaning I cannot use a tuple or use each level per row. 

I tried your recommended solution and found it only brings in the level filtered on and not all levels below within the same hierarchy.

The structure is similar the example displayed in the original post.  I need all levels within catagory 1, not the levels in catagory 2.

Any other recommendations, please?   :)
Title: Re: Hierachy of one level
Post by: MFGF on 10 Mar 2010 11:39:50 AM
Hi,

Is this as simple as defining a context (slicer) filter in the query for member 1?

MF.
Title: Re: Hierachy of one level
Post by: angela on 10 Mar 2010 04:07:41 PM
Try descendants instead of children.