MDX 去年完整版(尚未发布)
我将其用于 LastYTD
ROUND(
SUM(YTD(ParallelPeriod([Invoice Date].[Date Hierarchy].[Year]
, 1
, [Invoice Date].[Date Hierarchy].CurrentMember))
, [Measures].[Revenue]
),
2
)
现在我需要完整的去年,而不是 YTD。怎么做呢?
更新:
我尝试过以下操作,但它仅显示年份级别的结果。
ROUND(
SUM(YTD(ParallelPeriod([Invoice Date].[Date Hierarchy].[Year]
, 1
, ClosingPeriod([Invoice Date].[Date Hierarchy].[Year],
[Invoice Date].[Date Hierarchy].CurrentMember)
)
)
, [Measures].[Revenue]
),
2
)
屏幕截图
查询 2:
ROUND(
SUM(ParallelPeriod([Invoice Date].[Date Hierarchy].[Year]
, 1
, [Invoice Date].[Date Hierarchy].CurrentMember)
, [Measures].[Revenue]
),
2
)
结果:
UPDATE3:
这就是我需要的:
I use this for LastYTD
ROUND(
SUM(YTD(ParallelPeriod([Invoice Date].[Date Hierarchy].[Year]
, 1
, [Invoice Date].[Date Hierarchy].CurrentMember))
, [Measures].[Revenue]
),
2
)
Now I need full last year, not YTD. How to do that?
UPDATE:
II have tried following but it shows results only on Year level.
ROUND(
SUM(YTD(ParallelPeriod([Invoice Date].[Date Hierarchy].[Year]
, 1
, ClosingPeriod([Invoice Date].[Date Hierarchy].[Year],
[Invoice Date].[Date Hierarchy].CurrentMember)
)
)
, [Measures].[Revenue]
),
2
)
SCREENSHOT
Query 2:
ROUND(
SUM(ParallelPeriod([Invoice Date].[Date Hierarchy].[Year]
, 1
, [Invoice Date].[Date Hierarchy].CurrentMember)
, [Measures].[Revenue]
),
2
)
Results:
UPDATE3:
This is what I need:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通过两次计算就可以做到这一点,
希望这可以帮助你。
I was able to do this with 2 calculations
I hope this can help you.
我刚刚从您的表达式中删除了 YTD 函数。在我的数据库上,这个表达式工作得很好,除了日期维度上有一些间隙的情况(例如:2009、2011 成员存在于年份级别,但不存在 2010 成员)。
/**********************************/
更新版本:
(通过注释:当年的所有成员都必须包含上一年的值)
ps 该表达式尚未经过测试。
I have just removed YTD function from your expression. On my DB this expression works fine, except the situation when we have some gaps in the date dimension (for example: 2009, 2011 members exist on level Year, but not 2010 member).
/**********************************/
Updated version:
(by the comments: all members for the current year must contain value for the previous year)
p.s. This expression hasn't been tested yet.