COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: LDJB81 on 25 Jul 2013 08:42:22 AM

Title: Dynamically determine lowest populated level in ragged hierarchy
Post by: LDJB81 on 25 Jul 2013 08:42:22 AM
I would like to know if there is a way to determine against a SSAS 2008 OLAP cube the lowest populated level in a hierarchy which is a ragged hierarchy. I can use the following...

ordinal(level(item(tail(hierarchize(members([sales_and_marketing].[Products].[Products]))),0)))+1

...to determine the last level position but I really want to navigate to the level which is populated.

Regards L

Title: Re: Dynamically determine lowest populated level in ragged hierarchy
Post by: CognosPaul on 25 Jul 2013 10:02:13 AM
roleValue(
  '_levelNumber'
  , item(
    order(
      filter(
        [Cube].[Dim].[Hierarchy]
        , [Cube].[Measures].[Measure]>0)
      , roleValue('_levelNumber',currentMember([Cube].[Dim].[Hierarchy]))
      , bdesc)
    , 0)
)