0

我想在同一个 SELECT mdx 语句中添加一个具有不同维度的度量。一般来说,我的大部分措施都与[客户创建日期].[日期层次结构].[月份名称]相关联。但是,匿名客户没有客户创建日期的链接;因此,我必须将匿名链接到查询创建日期。如何将两个度量组合到单个选择查询中。

> WITH  MEMBER [Measures].[Allow Contact] as
            ([Measures].[# CRM Customers],[Customer].[Customer Allow Contact].&[Yes],[Customer].[Customer Status].&[Active] )

        MEMBER [Measures].[Total Identified Customers] AS
            ([Measures].[# CRM Customers],[Customer].[Customer Status].&[Active] )

        MEMBER [Measures].[Anonymous Customers] AS
            ([Measures].[# Unique Distinct Customers on Contact],[Enquiry].[Anonymous].&[Yes]) 



SELECT NON EMPTY {  Measures].[Allow Contact], 
                    [Measures].[Total Identified Customers]
                    //,[Measures].[Anonymous Customers]

                 } ON COLUMNS
       ,NON EMPTY ([Customer Creation Date].[Date Hierarchy].[Month Name]
       //,[Enquiry Creation Date].[Date Hierarchy].[Month Name] //How to add different dimensionality  

       ) ON ROWS
FROM [Cube]
4

1 回答 1

1

如果两个时间维度具有相同的结构(如果它们被实现为同一维度对象上的角色扮演维度,显然应该是这种情况),您可以使用定义中的LinkMember函数[Measures].[Anonymous Customers]来使用[Customer Creation Date].[Date Hierarchy]行中的 ,但使用这些日期如[Enquiry Creation Date].[Date Hierarchy]在度量计算中:

WITH  MEMBER [Measures].[Allow Contact] as
            ([Measures].[# CRM Customers],[Customer].[Customer Allow Contact].&[Yes],[Customer].[Customer Status].&[Active] )

        MEMBER [Measures].[Total Identified Customers] AS
            ([Measures].[# CRM Customers],[Customer].[Customer Status].&[Active] )

        MEMBER [Measures].[Anonymous Customers] AS
            ([Measures].[# Unique Distinct Customers on Contact],[Enquiry].[Anonymous].&[Yes], 
             LinkMember([Customer Creation Date].[Date Hierarchy].CurrentMember, [Enquiry Creation Date].[Date Hierarchy]) 

SELECT NON EMPTY {  Measures].[Allow Contact], 
                    [Measures].[Total Identified Customers]
                   ,[Measures].[Anonymous Customers]
                 } ON COLUMNS
       ,NON EMPTY ([Customer Creation Date].[Date Hierarchy].[Month Name]
       ) ON ROWS
FROM [Cube]
于 2014-07-08T16:52:39.327 回答