SSAS / MDX 查询 - 显示 2 个日期之间的数据

发布于 2024-12-22 05:09:09 字数 368 浏览 3 评论 0原文

我有一个查询:

select non empty
order ([Item].Children
,([Measures].[Total Line Value]
,[January 2010])
,DESC)
on Columns,
non empty
[January 2010]
on Rows
from [Sales Analysis]
where [Measures].[Total Line Value]

此查询按从最高到最低的顺序显示特定商品在 2010 年 1 月的总销售额。我想要做的是显示商品在 2 个指定日期之间的总销售额,例如 2010 年 1 月 - 2011 年 3 月。它只需是总值,而不是每个月的值。任何帮助将不胜感激,谢谢。

I have a query:

select non empty
order ([Item].Children
,([Measures].[Total Line Value]
,[January 2010])
,DESC)
on Columns,
non empty
[January 2010]
on Rows
from [Sales Analysis]
where [Measures].[Total Line Value]

This query shows, in order from highest to lowest, the total sales a particular item has made for the month January 2010. What I would like to do is show the total sales an item has made between 2 specified dates, say January 2010 - March 2011. It just has to be the total value and not the value for each month. Any help would be appreciated, thanks.

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

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

发布评论

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

评论(1

坦然微笑 2024-12-29 05:09:09

使用“WITH”语句声明新度量

Sum({[Your dim-n].[January 2010]:[Your dim-n].[March 2011]}, [Measures].[Total Line Value])

在轴 Rows 上使用此新度量并删除 WHERE 子句。

ps我现在无法测试它,所以我可能会犯错误:)。

Use "WITH" statement to declare new measure

Sum({[Your dim-n].[January 2010]:[Your dim-n].[March 2011]}, [Measures].[Total Line Value])

Use this new measure on the axis Rows and remove WHERE clause.

p.s. I can't test it now, so I can make a mistake :).

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