MDX报告呈现缓慢

时间:2014-09-05 09:24:01

标签: reporting-services mdx

这是我的MDX查询:

with member [Measures].[Rent] as IIF(IsEmpty([Measures].[Budget]), NULL, [Measures].[Rent])

select {[Measures].[Rent]} on columns,

          [Property].[Address].[All].children *
         DESCENDANTS([Account].[Account Hierarchy].[Account Group].[Expenditures],
                     [Account].[Account Tree].[Account]) *
                     [Asset].[asset].[All].children on rows
from    [Master]

当我评论[Asset] Dimension成员时,我得到了结果,但我需要MDX中的资产维度。

有没有人知道该做什么?

1 个答案:

答案 0 :(得分:0)

您应该在交叉连接之前尝试过滤尺寸。在您的情况下,如果预算为空,请保留它。另外,不要忘记添加NON EMPTY子句以从结果集中删除空值:

with 
     member hasBudget as
(
  IIF(IsEmpty([Measures].[Budget]), 0, 1)
)

member [Rent] as IIF(IsEmpty([Measures].[Budget]), NULL, [Measures].[Rent])
set accounts = Filter(DESCENDANTS([Account].[Account Hierarchy].[Account Group].[Expenditures],[Account].[Account Tree].[Account]), [Measures].[hasBudget] = 1)

select non empty
{ [Measures].[Rent] } on 0,

non empty
{ ([accounts] * (EXISTING [Asset].[asset].[All].children) * (EXISTING [Property].[Address].[All].children)) } on 1

from ( select { Filter([Asset].[asset].[All].children, [Measures].[hasBudget] = 1) } on 0

from ( select { Filter([Property].[Address].[All].children, [Measures].[hasBudget] = 1) } on 0

from [Master]))