MDX 查询 - 如何使用成员属性?

发布于 2024-09-02 23:15:32 字数 506 浏览 3 评论 0原文

我对 MDX / OLAP(“数据仓库”)完全是个新手。我有以下 MDX 查询,并希望我的结果显示月份的数字(1 = 一月,12 = 十二月)。幸运的是,多维数据集创建者创建了一个名为“Month Number Of Year”的成员属性,

当我尝试运行查询时,我得到以下结果... “查询 (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]

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?

Thanks!

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]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橪书 2024-09-09 23:15:32

看起来您正在尝试获取属性?如果是这样,语法如下:

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]

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]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文