将参数添加到 MDX 查询

发布于 2024-09-18 05:45:37 字数 400 浏览 4 评论 0原文

我正在 MS Visual Studio 中构建一个报告,该报告从多维数据集获取数据。其中有一个称为“玩家”的维度。我想传递一个参数“Name”并接收玩家玩过的游戏数量。但我没有将参数集成到我使用的 MDX 查询中。我已经定义了参数,并在查询中尝试了 许多不同的东西,例如

Select 
strtomember('@Name')
on 1,
[Measures].[Match Count]
on 0
From [Kicker Manager Data Warehouse]

,而不是 strtomember('@Name')

[Dimension Player].[@Name]

但没有任何作用。将不胜感激任何帮助。

I am building a Report in MS Visual Studio which gets its data from a cube. This has amongst others a dimension called Player. I want to hand over a parameter 'Name' and receive the number of games the player has played. But I do not get the parameter integrated in the MDX-query I use. I had defined the parameter and in the query, I tried
many different things, e.g.

Select 
strtomember('@Name')
on 1,
[Measures].[Match Count]
on 0
From [Kicker Manager Data Warehouse]

and instead of strtomember('@Name') for ex.

[Dimension Player].[@Name]

but nothing works. Would appreciate any help.

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

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

发布评论

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

评论(2

剧终人散尽 2024-09-25 05:45:37

正确的语法是strtomember(@Name)

在查询设计器中,我必须再次定义参数
(对话框“查询参数”)。

The correct syntax is strtomember(@Name).

In the query designer, I had to define the parameter once again
(dialogue "Query Parameters").

嘿看小鸭子会跑 2024-09-25 05:45:37

MDX 不像 SQL 存储过程那样支持参数。

您可以考虑使用 SQL 命令OPENROWSET,它允许 SQL 过程执行一些 MDX 并以普通(2D)记录集返回结果。 MDX 将是一个字符串,您可以在调用代码或过程中按照您喜欢的方式格式化它。

或者查看使用 Visual Studio 中的 ADOMD 执行 MDX(或者我是不是有点过时了?)。同样,您将向其传递一个字符串。

MDX does not support parameters like SQL stored procedures do.

You could look at using the SQL command OPENROWSET which allows a SQL proc to execute some MDX and return the results in a normal (2D) recordset. The MDX would then be a string that you could format how you like in the calling code or in the proc.

Or look at executing MDX using ADOMD from Visual Studio (or am I a bit out of date there?). Again, you'd pass it a string.

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