日期:2014-05-18  浏览次数:20642 次

如何写 判断维度成员是否为空 的mdx?
比如:
orderInfo表
gps sales name
0 100 admin
1 50 admin
0 100 admin
新建一个计算成员1,要求 gsp为0的销售量。
计算成员1=([Order Info].[Gps].&[0],[Measures].[Sales])
orderinfo既是事实又是维度。如果orderinfo表没有数据,那么[Order Info].[Gps]下就没有维度成员。如果有值,就像上面那样有0和1.
问题:如果gps这个维度成员没值,计算成员1为0,否则计算成员1为gps为0的销售量。
请教 如何写这个计算成员1的mdx?
谢谢!!
 null 、nonempty、currentmember 都试过,计算成员1显示#value!
 
在orderInfo表有数据时,
([Order Info].[Gps].&[0],[Measures].[Sales])值显示正确;
在orderInfo表无数据时,
([Order Info].[Gps].&[0],[Measures].[Sales])显示#value!

------解决方案--------------------
IIF([Order Info].[Gps].&[0] IS NULL,
NULL,
([Order Info].[Gps].&[0],[Measures].[Sales]))


可以不
------解决方案--------------------
with member xx as
iif([订单状态].[订单状态].&[xx] is null,0,

 ([订单状态].[订单状态].&[xx],[Measures].[定车量]) )
//([Order Info].[Gps].&[0],[Measures].[Sales])
select {
xx
} on 0
from [kpi]