【发布时间】:2013-10-23 10:35:40
【问题描述】:
WITH MEMBER [Measures].[Country Count]
AS
Count(existing [Customer].[Customer Geography].[Country])
MEMBER [Customer].[Customer Geography].ClassA AS
SUM(filter([Customer].[Customer Geography].[Country],[Measures].[Internet Order Count] > 3000))
MEMBER [Customer].[Customer Geography].ClassB AS
SUM(filter([Customer].[Customer Geography].[Country],[Measures].[Internet Order Count] > 1500))
MEMBER [Customer].[Customer Geography].ClassC AS
SUM(filter([Customer].[Customer Geography].[Country],[Measures].[Internet Order Count] > 0))
SET My_Custom_Set AS
{[Customer].[Customer Geography].ClassA, [Customer].[Customer Geography].ClassB,[Customer].[Customer Geography].ClassC}
SELECT {[Measures].[Internet Order Count], [Measures].[Internet Sales Amount], [Measures].[Country Count]} ON COLUMNS,
My_Custom_Set ON ROWS
FROM
[Adventure Works]
结果:
在上面的查询中,如何获得有多少国家贡献了 A 类、B 类、C 类,这里对于任何类,最大国家数 6 显示在度量“Country Count”中?
为什么这里 existing 没有提供 current class 的国家数量?
【问题讨论】:
-
感谢@Justin 格式化文本。
标签: sql-server-2012 ssas mdx