MDX计算维度属性

时间:2013-06-20 12:56:05

标签: ssas mdx

是否可以使用WITH语句创建查询范围的维度属性(与措施一样)。

我正在尝试做这样的事情:

WITH
MEMBER [Customer].[Has Child At Home] AS
IIF( [Customer].[Number of Cars Owned] > 0,
True,
False

然后在select语句中使用上面的属性,但它给出了一个错误,指出客户维度有多个层次结构,需要指定一个层次结构。

1 个答案:

答案 0 :(得分:0)

在这种格式中,它需要一个层次结构,以构建您的代码示例[Number of Cars Owned]需要是一个层次结构:

WITH
  MEMBER [Customer].[Number of Cars Owned].[Has Child At Home] AS
  IIF([Customer].[Number of Cars Owned] > 0, "True", "False")
SELECT
  {[Customer].[Has Child at Home]} ON COLUMNS,
  [DimExample].[AttributeExample].Members ON ROWS,
FROM [CubeExample]

请参阅Creating Query-Scoped Calculated Members (MDX)