首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SSRS MDX Where子句问题

SSRS MDX Where子句问题
EN

Stack Overflow用户
提问于 2011-06-16 19:07:34
回答 2查看 2.1K关注 0票数 0

我对MDX-Query有点小问题。

我想要显示所有索赔成本,划分为类型和特定的DocumentType。

以下是我的代码:

代码语言:javascript
复制
    select
    {
        [Measures].[Claim Count],
        [Measures].[Claim Cost Position Count],
        [Measures].[Claim Cost Original],
        [Measures].[Claim Cost Original Average],
        [Measures].[Claim Cost Possible Savings],
        [Measures].[Claim Cost Possible Savings Average],
        [Measures].[Claim Cost Possible Savings Percentage]
    } on 0,
    NON EMPTY{
        [Claim Cost Type].[Claim Cost Type].[Claim Cost Type].Members
    } on 1
    from
        Cube    
where 
    (
        ( {StrToMember(@DateFrom) : StrToMember(@DateTo ) } )
         ,[Claim Document Type].[Document Type].&[1] 
    )

我有四种文档类型:1-4

我只想显示三个第一个Documenttypes的数据。

我尝试了以下Where-Clause:

代码语言:javascript
复制
where 
(
    ( {StrToMember(@DateFrom) : StrToMember(@DateTo ) } )
   ,( {[Claim Document Type].[Document Type].&[1] : [Claim Document Type].[Document Type].&[3]} ) 
)

但是它只显示了DocumentType1和3的数据,而不是1到3。

有人能帮我吗?

非常感谢并为我糟糕的英语感到抱歉!

亚历克斯

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-06-16 19:40:20

是否单据类型属性的OrderBy属性不等于"Key"?在这种情况下,有必要使用

代码语言:javascript
复制
{[Claim Document Type].[Document Type].&[1],
 [Claim Document Type].[Document Type].&[2],
 [Claim Document Type].[Document Type].&[3]}
票数 0
EN

Stack Overflow用户

发布于 2011-06-17 10:48:46

在下面的条件下

代码语言:javascript
复制
where 
(( {StrToMember(@DateFrom) : StrToMember(@DateTo ) } ),( {[Claim Document Type].[Document Type].&[1] : [Claim Document Type].[Document Type].&[3]} ))

甚至下面的表达式也应该可以工作,因为这是一个范围运算符。

代码语言:javascript
复制
({[Claim Document Type].[Document Type].&[1] : [Claim Document Type].[Document Type].&3]})

在浏览此维度和属性的多维数据集时需要检查哪些内容[Claim Document Type].[Document Type]维键顺序看起来像什么

代码语言:javascript
复制
[Claim Document Type].[Document Type].&[1]
[Claim Document Type].[Document Type].&[2]
[Claim Document Type].[Document Type].&[3]

代码语言:javascript
复制
[Claim Document Type].[Document Type].&[1]
[Claim Document Type].[Document Type].&[3]
[Claim Document Type].[Document Type].&[2]

如果你看到1,3阶,如果你输入1:3,你不会得到2。所以看看你的阶,然后修改你的范围表达式。

早期的解决方案也可以,但是如果有很多成员,那么将所有这样的成员都包含到集合中是不现实的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6370798

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档