2013-06-20 181 views
2

是否有可能使用WITH語句創建一個查詢範圍的維度屬性(如與措施進行)。MDX計算維度屬性

我試圖做這樣的事情:

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

然後用上面的屬性在select語句但它給我一個錯誤說,客戶維度有更多而不是一個層次結構,需要指定一個層次結構。

回答

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)