2010-05-24 47 views
2

我是MDX/OLAP的完整newb,一般來說就是「數據倉庫」。我有以下MDX查詢,並希望我的結果顯示月份的編號(1 = 1月,12 = 12月)。幸運的是,多維數據集創建者創建了一個名爲「Month Number Of Year」的成員屬性MDX查詢 - 如何使用成員屬性?

當我嘗試運行查詢時,出現以下... 「Query(4,8)該函數需要一個元組集合表達式爲1的參數。使用字符串或數字表達式。「

有關修復此問題的任何建議?

謝謝!

WITH 
MEMBER [Measures].[Tmp] as '[Measures].[Budget]/[Measures].[Net Income]' 

SELECT {[Date].[Month].Properties("Month Number Of Year")} ON COLUMNS, 
{[Measures].[Budget],[Measures].[Net Income],[Measures].[Tmp]} ON ROWS 

FROM [AnalyticsCube] 

回答

3

它看起來像你試圖獲得一個屬性?如果是這樣的語法如下:

WITH 
MEMBER Measures.ProductKey as [Product].[Product Categories].Currentmember.Properties("Key") 
SELECT {Measures.ProductKey} ON axis(0), 
[Product].[Product Categories].Members on axis(1) 
FROM [Adventure Works] 

http://www.ssas-info.com/analysis-services-faq/27-mdx/167-how-can-i-get-attribute-key-with-mdx

所以,如果你原來的MDX接近,嘗試:

[Date].[Month].CurrentMember.Properties("Month Number Of Year") 

還是你的意思日期維度有這個作爲一個成員,你會用哪種情況:

[Date].[Month Number Of Year]