SSRS MDXWhere 子句问题

发布于 2024-11-15 14:50:44 字数 1168 浏览 3 评论 0原文

我在 MDX-Query 方面遇到了一些问题。

我想显示所有索赔成本,按类型和特定文档类型划分。

这是我的代码:

    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

我只想显示前三个文档类型的数据。

我尝试了以下Where-Clause:

where 
(
    ( {StrToMember(@DateFrom) : StrToMember(@DateTo ) } )
   ,( {[Claim Document Type].[Document Type].&[1] : [Claim Document Type].[Document Type].&[3]} ) 
)

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

有人可以帮助我吗?

非常感谢你,并对我的英语不好表示歉意!

亚历克斯

I have a little Problem with a MDX-Query.

I want show all the Claim Costs, divided in Types and with a certain DocumentType.

Here is my Code:

    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] 
    )

I have four Document Types: 1 - 4

I want to show only the data of three first Documenttypes.

I tried the following Where-Clause:

where 
(
    ( {StrToMember(@DateFrom) : StrToMember(@DateTo ) } )
   ,( {[Claim Document Type].[Document Type].&[1] : [Claim Document Type].[Document Type].&[3]} ) 
)

But it shows me only the Data of the Documenttype 1 and 3, not 1 to 3.

Can anybody help me?

Thank you very much and sorry for my bad English!

Alex

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

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

发布评论

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

评论(2

不离久伴 2024-11-22 14:50:44

也许 [Document Type] 属性的 OrderBy 属性不等于“Key”?在这种情况下需要使用

{[Claim Document Type].[Document Type].&[1],
 [Claim Document Type].[Document Type].&[2],
 [Claim Document Type].[Document Type].&[3]}

Maybe the OrderBy property of [Document Type] attribute is not equal to "Key"? In this case it is necessary to use

{[Claim Document Type].[Document Type].&[1],
 [Claim Document Type].[Document Type].&[2],
 [Claim Document Type].[Document Type].&[3]}
软糯酥胸 2024-11-22 14:50:44

在下面的条件下,

where 
(( {StrToMember(@DateFrom) : StrToMember(@DateTo ) } ),( {[Claim Document Type].[Document Type].&[1] : [Claim Document Type].[Document Type].&[3]} ))

即使下面的表达式也应该起作用,因为这是一个范围运算符。

({[Claim Document Type].[Document Type].&[1] : [Claim Document Type].[Document Type].&3]})

浏览此维度和属性的多维数据集时需要检查的内容 [Claim Document Type].[Document Type] 维度 KEY 顺序是否类似于

[Claim Document Type].[Document Type].&[1]
[Claim Document Type].[Document Type].&[2]
[Claim Document Type].[Document Type].&[3]

[Claim Document Type].[Document Type].&[1]
[Claim Document Type].[Document Type].&[3]
[Claim Document Type].[Document Type].&[2]

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

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

In the below condition

where 
(( {StrToMember(@DateFrom) : StrToMember(@DateTo ) } ),( {[Claim Document Type].[Document Type].&[1] : [Claim Document Type].[Document Type].&[3]} ))

even the following expression should work as this is a range operator.

({[Claim Document Type].[Document Type].&[1] : [Claim Document Type].[Document Type].&3]})

What you need to check when you browse cube for this dimension and attribute [Claim Document Type].[Document Type] does the Dimension KEY order look like

[Claim Document Type].[Document Type].&[1]
[Claim Document Type].[Document Type].&[2]
[Claim Document Type].[Document Type].&[3]

or

[Claim Document Type].[Document Type].&[1]
[Claim Document Type].[Document Type].&[3]
[Claim Document Type].[Document Type].&[2]

If you see order 1,3 and if you enter 1:3 you would not get 2. So look at order and then modify your range expression.

Earlier solution would also work but what if there are lot of member then it is not practical to include all of such members into set.

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