开发者

Add a parameter to an MDX-Query

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.


The correct syntax is strtomember(@Name).

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


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜