如果您的维度也有动态计算,那么这是可行的。让我告诉你另一个例子,但想法是一样的。
如果客户(通过电子邮件识别)在第二次,第三次,第四次签名时,我有一个维度[重复客户] - 将此客户移动到此维度的适当成员。
首先,使用一个默认成员创建维度。
其次,添加几个空成员:
(你可以跳过它,因为昏暗的成员在你的情况下实现)
CREATE MEMBER CURRENTCUBE.[Repeat Customers].[Repeat Customers].[All].[One] as NULL; CREATE MEMBER CURRENTCUBE.[Repeat Customers].[Repeat Customers].[All].[Two] as NULL; CREATE MEMBER CURRENTCUBE.[Repeat Customers].[Repeat Customers].[All].[Three] as NULL; CREATE MEMBER CURRENTCUBE.[Repeat Customers].[Repeat Customers].[All].[Four] as NULL; CREATE MEMBER CURRENTCUBE.[Repeat Customers].[Repeat Customers].[All].[Five] as NULL; CREATE MEMBER CURRENTCUBE.[Repeat Customers].[Repeat Customers].[All].[6+] as NULL; CREATE MEMBER CURRENTCUBE.[Repeat Customers].[Repeat Customers].[All].[N/A] as NULL;
第三,添加他们的计算:
SCOPE([Repeat Customers].[Repeat Customers].[All].[One],[Measures].[Count]); THIS=Count(Filter([Email].[Email].Members,([Measures].[Count],[Repeat Customers].[Repeat Customers].&[0])=1)); END SCOPE; SCOPE([Repeat Customers].[Repeat Customers].[All].[Two],[Measures].[Count]); THIS=Count(Filter([Email].[Email].Members,([Measures].[Count],[Repeat Customers].[Repeat Customers].&[0])=2)); END SCOPE; ... SCOPE([Repeat Customers].[Repeat Customers].[All].[6+],[Measures].[Count]); THIS=Count(Filter([Email].[Email].Members,([Measures].[Count],[Repeat Customers].[Repeat Customers].&[0])>=6)); END SCOPE; SCOPE([Repeat Customers].[Repeat Customers].[All].[N/A],[Measures].[Count]); THIS=([Measures].[Count],[Repeat Customers].[Repeat Customers].&[0]) -SUM({ [Repeat Customers].[Repeat Customers].[All].[One] ,[Repeat Customers].[Repeat Customers].[All].[Two] ,[Repeat Customers].[Repeat Customers].[All].[Three] ,[Repeat Customers].[Repeat Customers].[All].[Four] ,[Repeat Customers].[Repeat Customers].[All].[Five] ,[Repeat Customers].[Repeat Customers].[All].[6+] },[Measures].[Count]); END SCOPE;
输出:
我认为您的过滤器必须使用> =和< = Nr_Days_Calculated。但不确定你想要展示哪种衡量标准。是 1 - TextA 相关 [Measures].[Nr_Days_Calculated] ?如果是的话,我们很好,只需使用你的度量和SUM或者在我的情况下使用聚合而不是Count()。
1 - TextA
[Measures].[Nr_Days_Calculated]
这不是最好的性能解决方案(因为动态计算),但它仍然有效。希望能帮助到你。