SSAS - 移动年度总计

发布于 2024-08-07 01:19:35 字数 283 浏览 2 评论 0原文

环境:SQL-Server-2005、SSAS 2005

我使用以下公式创建移动年度总计

SUM ({[Time].CurrentMember.Lag(3):[Time].CurrentMember}, [Measures]。 [TRx Quantity])

同一列[Measures].[Trx Quantity] 用于其他计算,并且工作正常。然而,这个出现了 #Value! 来指示某种错误。有人能在这里指出正确的方向吗?

Environment: SQL-Server-2005, SSAS 2005

I am using the following formula to create a Moving Annual Total

SUM ({[Time].CurrentMember.Lag(3):[Time].CurrentMember}, [Measures].[TRx Quantity])

The same column [Measures].[Trx Quantity] is used in other calculations and it works fine. This one, however, comes up with #Value! to indicate some kind of an error. Can anyone point me in the proper direction here?

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

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

发布评论

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

评论(2

才能让你更想念 2024-08-14 01:19:35

这是 SSAS 2005/2008 吗?

如果是其中任何一个并且您在 Management Studio 中运行它,您可以将鼠标悬停在 #Value 上并获取错误的详细信息。

但据猜测,这很可能是因为 .CurrentMember 需要在层次结构上调用,而 [Time] 是维度引用。它应该引用诸如 [Time].[Calendar].CurrentMember[Time].[Quarter].CurrentMember 之类的层次结构之一

Is this SSAS 2005/2008?

If it is either of these and you are running this in Management Studio you can hover over the #Value and get the details of the error.

But at a guess it is most likely because .CurrentMember needs to be called on a hierarchy and [Time] is a dimension reference. It should refer to one of the hierarchies like [Time].[Calendar].CurrentMember or maybe [Time].[Quarter].CurrentMember

坚持沉默 2024-08-14 01:19:35

事实证明,我错过了 MONTH

SUM ({[Time].[Month].CurrentMember.Lag(3):[Time].[Month].CurrentMember}, [Measures].[TRx Quantity])

It turned out to be that I was missing the MONTH

SUM ({[Time].[Month].CurrentMember.Lag(3):[Time].[Month].CurrentMember}, [Measures].[TRx Quantity])

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