简体   繁体   中英

SSAS MDX Namedset issue with hierarchy

I'm using some MDX to create a named set in SSAS.

I have a hierarchy of Company, Group, Store

I'm trying to filter out a number of specific Store members.

I've used the Descendants function, as below, to do that, however it then doesn't have any proper hierarchy (expand and collapse etc) when viewing it in Performance Point. Any ideas? Is there a way of doing it without breaking the hierarchy?

Namedset:

Descendants([Company].[Company Hierarchy], [Company].[Company Hierarchy].
[Stores]) 
- [Company].[Company Hierarchy].[Stores].[Store1]  
- [Company].[Company Hierarchy].[Stores].[Store2] 
- [Company].[Company Hierarchy].[Stores].[Store3] 

What you have looks ok. As an alternative maybe see if the following works:

EXCEPT(
  [Company].[Company Hierarchy].[Stores].MEMBERS
  ,{
     [Company].[Company Hierarchy].[Stores].[Store1]  
    ,[Company].[Company Hierarchy].[Stores].[Store2] 
    ,[Company].[Company Hierarchy].[Stores].[Store3] 
   }
)

Try using HIERARCHIZE around the set.

HIERARCHIZE
    (
    Descendants
            (
                [Company].[Company Hierarchy], 
                [Company].[Company Hierarchy].[Stores]  
            ) 
        - [Company].[Company Hierarchy].[Stores].[Store1]  
        - [Company].[Company Hierarchy].[Stores].[Store2] 
        - [Company].[Company Hierarchy].[Stores].[Store3] 
    )

msdn reference for hierarchize

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM