MDX 查询中Where 子句的比较

发布于 2024-12-16 13:21:16 字数 716 浏览 2 评论 0原文

在 MDX 查询中,如何比较级别值是否小于某个值。 例如,

SELECT NON EMPTY
    [Sales Territory].[Sales Territory Country].Members ON 0,
    [Product].[Category].[Clothing] ON 1
FROM
    [Adventure Works]
WHERE
    ([Measures].[LowGPM] > 120)

此 MDX 查询不起作用。

另外,我也尝试过WITH子句。

WITH Member [Measures].[Calculated Measures] as
     IIF ([Measures].[LowGPM] < 120, [Measures].[LowGPM], null)

SELECT NON EMPTY
    [Sales Territory].[Sales Territory Country].Members ON 0,
    [Product].[Category].[Clothing] ON 1
FROM
    [Adventure Works]
WHERE
    ([Measures].[LowGPM] > 120)

它显示 Mondrian 错误:在多维数据集中找不到 MDX 对象“[Measures].[Calculated Measures]”

In MDX Queries, How can i compare whether a level value is less than a certain value or not.
e.g.

SELECT NON EMPTY
    [Sales Territory].[Sales Territory Country].Members ON 0,
    [Product].[Category].[Clothing] ON 1
FROM
    [Adventure Works]
WHERE
    ([Measures].[LowGPM] > 120)

This MDX query didn't work.

Also, i tried WITH Clause also.

WITH Member [Measures].[Calculated Measures] as
     IIF ([Measures].[LowGPM] < 120, [Measures].[LowGPM], null)

SELECT NON EMPTY
    [Sales Territory].[Sales Territory Country].Members ON 0,
    [Product].[Category].[Clothing] ON 1
FROM
    [Adventure Works]
WHERE
    ([Measures].[LowGPM] > 120)

It shows Mondrian Error:MDX object '[Measures].[Calculated Measures]' not found in cube.

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

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

发布评论

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

评论(1

锦爱 2024-12-23 13:21:16

您可以像这样过滤轴:

SELECT
  [Measures].[Internet Sales Amount] ON 0,
  Filter(
    [Customer].[Country].Members, 
    ([Measures].[Internet Sales Amount] > 2000000) 
        AND ([Measures].[Internet Sales Amount] < 5000000)
  ) ON 1
FROM [Adventure Works]

You can filter the axis like this:

SELECT
  [Measures].[Internet Sales Amount] ON 0,
  Filter(
    [Customer].[Country].Members, 
    ([Measures].[Internet Sales Amount] > 2000000) 
        AND ([Measures].[Internet Sales Amount] < 5000000)
  ) ON 1
FROM [Adventure Works]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文