我需要在较高级别上使用过滤器对较低级别的成员进行聚合。 报告每年在一个特定月份过滤销售。 这是FoodMart数据库和产品维度的示例,其级别为:
MDX:
WITH
MEMBER [Measures].[Unit Sales Calculated] AS
Aggregate(
Intersect(
Descendants(
[Product].CurrentMember,
[Product].[Product Department],
SELF
),
[Filtered Product Department]
),
[Measures].[Unit Sales]
)
SET [Filtered Product Department] AS
Except(
[Product].[Product Department].Members,
[Product].[Drink].[Alcoholic Beverages]
)
SELECT
NON EMPTY [Measures].[Unit Sales Calculated] ON COLUMNS,
NON EMPTY [Product].[Product Family].Members) ON ROWS
FROM [Sales]
此解决方案有效但性能相当差。 是否有更好的方式来编写此查询?