MDX - 多个Where和/或过滤条件
对于一个看似基本的 MDX 问题,我事先表示歉意。我正在尝试根据维度属性的多种组合来过滤 MDX 结果集。
这是我的维度/度量布局:
维度:
[AccidentDate]
Year
Quarter
Month
Day
Date
[ItemInformation]
ItemState
[CoverageInformation]
CoverageHiearchy
----UserLine
--- Coverage Code
度量:
CTDPaid
现在,我希望从 [CTDPaid]
度量中选择总金额,并按 [ItemInformation].ItemState
分组属性。但是,我想根据多个过滤条件来过滤此查询的结果集。
这些条件将如下所示,并且将单独进行评估:
1. [CoverageInformation].[CoverageHiearchy].&[98]&[002] and [ItemInformation].ItemState.&[MI]
2. [CoverageInformation].[CoverageHiearchy].&[98]&[004] and [ItemInformation].ItemState.&[MI]
3. [CoverageInformation].[CoverageHiearchy].&[98]&[004] and [ItemInformation].ItemState.&[IL]
4. [CoverageInformation].[CoverageHiearchy].&[98]&[002] and [ItemInformation].ItemState.&[IL]
本质上,如果我将其移植到 T-SQL where 条件,它将构成以下内容:
where
(ItemState = 'MI' and CoverageCode = '002' and UserLine = '98')
and
(ItemState = 'MI' and CoverageCode = '004' and UserLine = '98')
and
(ItemState = 'IL' and CoverageCode = '002' and UserLine = '98')
and
(ItemState = 'IL' and CoverageCode = '004' and UserLine = '98')
将其放入MDX 切片器无法运行,因为我认为不支持跨同一层次结构的交叉连接。
使用 filter() MDX 函数对我来说也不起作用。
我非常感谢您帮助制定正确的 MDX 查询,以正确过滤我的结果集,如上所述。
非常感谢您抽出时间
I apologize beforehand for a seemingly basic MDX question. I am trying to filter an MDX resultset based on multiple combinations of dimension attributes.
This is my dimension/measures layout:
Dimensions:
[AccidentDate]
Year
Quarter
Month
Day
Date
[ItemInformation]
ItemState
[CoverageInformation]
CoverageHiearchy
----UserLine
--- Coverage Code
Measures:
CTDPaid
Now, I wish to select the total amount from the [CTDPaid]
measure, grouped by the [ItemInformation].ItemState
attribute. However, I would like to filter the resultset of this query based on multiple filter conditions.
These conditions would be the following, and would be evaluated separately:
1. [CoverageInformation].[CoverageHiearchy].&[98]&[002] and [ItemInformation].ItemState.&[MI]
2. [CoverageInformation].[CoverageHiearchy].&[98]&[004] and [ItemInformation].ItemState.&[MI]
3. [CoverageInformation].[CoverageHiearchy].&[98]&[004] and [ItemInformation].ItemState.&[IL]
4. [CoverageInformation].[CoverageHiearchy].&[98]&[002] and [ItemInformation].ItemState.&[IL]
Essentially, if I were to port this over to a T-SQL where condition, it would constitute the following:
where
(ItemState = 'MI' and CoverageCode = '002' and UserLine = '98')
and
(ItemState = 'MI' and CoverageCode = '004' and UserLine = '98')
and
(ItemState = 'IL' and CoverageCode = '002' and UserLine = '98')
and
(ItemState = 'IL' and CoverageCode = '004' and UserLine = '98')
Putting this into an MDX slicer would not function as I believe cross joins across the same hierarchy are not supported.
Using the filter() MDX function is not working for me either.
I would greatly appreciate assistance with formulating the correct MDX query to correctly filter my resultset as outlined above.
Thank you kindly for your time
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试这个解决方案:
Try this solution: