2014-10-08 32 views
2

在MDX中执行此操作的最有效方法是什么?我知道你可以创建两个计算的度量值,它们在选择时间维度当前时间段时处于活动状态,另一个处于前一时间段,然后执行复杂条件的过滤器。MDX - 当前期间有效,前期无效

但是其他可能更有效的功能呢?任何建议?

我的目标是创建一套计算度量值,这将有助于客户分析师。主要的2个维度是[日历],显然[客户]。我有一个事实,其中包含针对客户的活动。这些是我们计算所依据的3个实体。

+0

没有我的回答帮助呢? – whytheq 2015-07-07 13:47:25

回答

0

这是从文章由克里斯·韦伯:http://cwebbbi.wordpress.com/2010/10/08/counting-new-and-returning-customers-in-mdx/

关于如何优化它的后续文章:http://cwebbbi.wordpress.com/2013/06/28/optimising-returning-customers-calculations-in-mdx/

WITH 
MEMBER MEASURES.[Returning Customers] AS 
COUNT(
NONEMPTY(
NONEMPTY(
[Customer].[Customer].[Customer].MEMBERS 
, [Measures].[Internet Sales Amount]) 
, {[Measures].[Internet Sales Amount]} 
* {NULL : [Date].[Calendar].CURRENTMEMBER.PREVMEMBER} 
) 
) 
MEMBER MEASURES.[New Customers] AS 
[Measures].[Customer Count] – MEASURES.[Returning Customers] 
SELECT 
{[Measures].[Customer Count] 
, MEASURES.[Returning Customers] 
, MEASURES.[New Customers]} ON 0, 
[Date].[Calendar].[Calendar Year].MEMBERS ON 1 
FROM [Adventure Works]