开发者

MDX query- How do I use a member property?

I'm a complete newb to MDX / OLAP, "data warehousing" in general. I have the following MDX query and would like my results to display the month's number (1 = January, 12 = December). Luckily, the cube creator created a member property named "Month Number Of Year"

When I try to run the query, I get the following... "Query (4, 8) The function expects a tuple set expression for the 1 argument. A string or numeric expression was used."

Any suggestions for fixing this?

T开发者_运维百科hanks!

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]


It looks like you're trying to get an attribute? If so the syntax looks like:

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

So if your original MDX is close, try:

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

Or do you mean the date dimension has this as a member, in which case you'd use:

 [Date].[Month Number Of Year]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜