简体   繁体   English

MDX计算的尺寸属性

[英]MDX calculated dimension attribute

Is it possible to create a query scoped dimension attribute (as is done with measures) using the WITH statement. 是否可以使用WITH语句创建查询范围的维属性(与度量一样)。

I'm trying to do something like this: 我正在尝试做这样的事情:

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

)

And then use the above attribute in a select statement however it is giving me an error saying that the customer dimension has more than one hierarchy and that one needs to be specified. 然后在select语句中使用上述属性,但是这给我一个错误,表明客户维度具有多个层次结构,需要指定一个层次结构。

In this format it requires a hierarchy, to build on your code example [Number of Cars Owned] would need to be a hierarchy: 在这种格式下,它需要一个层次结构,才能在您的代码示例中构建[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]

See Creating Query-Scoped Calculated Members (MDX) 请参阅创建查询范围的计算成员(MDX)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM