我写了一个计算的度量如下
With member [Measures].[Path] as
Iif (condition, DisplayIteration, null)
Select [Measures].[Path] ,
[Measures].[Caption],
[Measures].[Value] on 0 ,
{NonEmpty
(
Crossjoin (
[Item].[Product],
Descendants ([Item].[Iteration])
)
, Descendants ([Item].[Iteration])
)
}on 1 from [Item]
[Measures]。[Path]是报告参数标签和[Measures]。[Value]是报告参数值。由于过滤器应用于后代([Item]。[Iteration],[Measures]。[Path]的空值仍然可见。有没有办法解决这个问题?
答案 0 :(得分:0)
作为非空的替代,你可以尝试使用MeasureGroupName参数的exists()。度量的NullProcessing属性可能未设置为“保留”
您可以查看以下主题:
菲利普,
答案 1 :(得分:0)
我认为有两种可能性可以满足您的要求:
使用[Measures].[Path]
作为NonEmpty
的第二个参数:
With member [Measures].[Path] as
Iif (condition, DisplayIteration, null)
Select [Measures].[Path] ,
[Measures].[Caption],
[Measures].[Value] on 0 ,
{NonEmpty
(
Crossjoin (
[Item].[Product],
Descendants ([Item].[Iteration])
)
, { [Measures].[Path] }
)
}on 1 from [Item]
或使用HAVING
代替NonEmpty
,这可能会对条件更具选择性:
With member [Measures].[Path] as
Iif (condition, DisplayIteration, null)
Select [Measures].[Path] ,
[Measures].[Caption],
[Measures].[Value] on 0 ,
Crossjoin (
[Item].[Product],
Descendants ([Item].[Iteration])
)
Having Not [Measures].[Path] Is null
on 1 from [Item]
我不确定对结果或性能的正确性有何影响,您必须对此进行测试。