【发布时间】:2016-04-15 11:40:50
【问题描述】:
我必须编写 MDX,它将显示在列上并将行分为三组。第一组以少数数字区分,第二组以属性区分,第三组是其余不适合的地方。
到目前为止,我的代码看起来像这样:
case
when [Customer].[Customer's Document].CURRENTMEMBER.MEMBERVALUE = "4254255527" then "ABC"
when [Customer].[Customer's Document].CURRENTMEMBER.MEMBERVALUE = "2752637520" then "ABC"
when [Customer].[Customer's Document].CURRENTMEMBER.MEMBERVALUE = "5637839739" then "ABC"
when [Customer].[Customer's Document].CURRENTMEMBER.MEMBERVALUE = "9378793737" then "ABC"
when [Customer].[Customer's Document].CURRENTMEMBER.MEMBERVALUE = "3789789397" then "ABC"
when [Document].[Document series].CURRENTMEMBER.MEMBERVALUE = "XYZ" then "XYZ"
else "Rest"
end
但我每次都在“休息”。
我应该如何纠正?
编辑: 再次尝试但仍然无法正常工作:
case
when [Customer].[Customer's Document].[&5196189651] then "ABC"
when [Customer].[Customer's Document].[&7885181585] then "ABC"
when [Customer].[Customer's Document].[&7511535861] then "ABC"
when [Customer].[Customer's Document].[&4742575277] then "ABC"
when [Customer].[Customer's Document].[&7272727272] then "ABC"
when [Customer's Document].[Document Series].[&CHP] then "XYZ"
else "Rest"
end
【问题讨论】:
-
客户文档的值、键和名称属性是什么?客户维度的结构是什么?您如何查询此度量并将“其余”视为您的最终结果?请将查询添加到您的问题中,以便我们提供帮助。
-
@Dodzik - 维度
[Customer]在最终的 SELECT 子句的行上?!如果它不在行上,则 Currentmember 是 All 成员 ....currentmember 仅在维度实际上是 current 时起作用,即在上下文中。这可能是你一直休息的原因。你可以添加你的 mdx 脚本的其余部分吗?
标签: sql-server mdx business-intelligence olap