在MDX查询中具有维度的案例陈述

时间:2013-02-11 21:32:40

标签: reporting-services mdx

在MDX查询中,我使用SSRS报告中的case语句。它没有返回所需的结果。它应根据[Facility Market]参数的选择过滤Territory

with member [Dim Facility].[Facility Market].[Facility Market] as
case  [Dim North Texas Sales].[North Texas Rural Sales Territory].currentmember

when   [Dim North Texas Sales].[North Texas Rural Sales Territory].&[NTXSalesRuralEast] then [Dim Facility].[Facility Market].&[OKLAHOMA] 

end

select......

我想根据参数选择更改设施市场维度的价值,并根据该数据集过滤

2 个答案:

答案 0 :(得分:0)

Case statements仅适用于标量值。

你应该使用像这样的表达式:

IIf([Dim North Texas Sales].[North Texas Rural Sales Territory].CurrentMember IS [Dim North Texas Sales].[North Texas Rural Sales Territory].&[NTXSalesRuralEast],
[Dim Facility].[Facility Market].&[OKLAHOMA],
...)

答案 1 :(得分:0)

with member [Dim Facility].[Facility Market].[Facility Market] as
case  

when  [Dim North Texas Sales].[North Texas Rural Sales Territory].currentmember IS [Dim North Texas Sales].[North Texas Rural Sales Territory].&[NTXSalesRuralEast] then [Dim Facility].[Facility Market].&[OKLAHOMA] 

end

select......