MDX聚合在较低级别

时间:2013-02-06 10:38:37

标签: aggregate mdx mondrian

我需要在较高级别上使用过滤器对较低级别的成员进行聚合。 报告每年在一个特定月份过滤销售。 这是FoodMart数据库和产品维度的示例,其级别为:

  1. [产品系列]
  2. [产品部]

  3. 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]
    

    此解决方案有效但性能相当差。 是否有更好的方式来编写此查询?

0 个答案:

没有答案