如何在 MDX 计算成员中传递多值参数?
我实际上正在使用 SQL Server Reporting Services 开发 SSAS 多维数据集。 为了过滤字段,我需要使用专门使用参数的计算成员。
这是我的计算成员:
WITH MEMBER [Measures].[Comparable Stock Room] AS Iif (
[Stock room].[Stock room code].currentMember IS (Iif (STRTOMEMBER(@StockRoomCode).Count = 1, STRTOMEMBER(@StockRoomCode), xxx)),
0,
[Measures].[Retail sales amount invoiced including tax]
)
如果 @StockRoomCode 只有一个值,则效果很好。但我不知道当参数有多个值时如何使其工作。如何替换“xxx”? 您能帮助我或告诉我如何更好地做到这一点吗,谢谢!
I'm actually working on a SSAS Cube using SQL Server Reporting Services.
In order to filter a field, I need to use a calculated member which specifically use a parameter.
Here is my calculated member:
WITH MEMBER [Measures].[Comparable Stock Room] AS Iif (
[Stock room].[Stock room code].currentMember IS (Iif (STRTOMEMBER(@StockRoomCode).Count = 1, STRTOMEMBER(@StockRoomCode), xxx)),
0,
[Measures].[Retail sales amount invoiced including tax]
)
This works well if @StockRoomCode only have one value. But I don't know how to make it works when the parameter has multiple values. How to replace the 'xxx' ?
Can you help me or tell me how to do it a better way, thanks !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以创建一个计算成员,聚合您想要报告的成员,并在计算成员的项中定义度量,例如:(
注意:未经测试,只是我的想法)。或者,
请注意,无论使用哪种方法,都应先正确设置表达式并进行测试。
You could create a calculated member aggregating the members you want to report on and define the measure in tems of the calculated member, something like:
(Note: not tested, just off the top of my head). Or,
Note, with either, get your set expression right and test that first.