跳至主要内容
Adaptive Planning
上次更新时间 :2023-06-23
在公式中创建动态时间引用

在公式中创建动态时间引用

This article includes suggestions and workarounds. Content may not be accurate for all use cases or represent best practices for the latest release.

问题

我需要编写一个函数如下所示的公式:
ACCT.IT_Expense[time=01/2017]
除了 2017 年,我想引用的是所报告年份的 1 月。如何编写时间修饰符以实现此功能?

答案

在当前功能中,尚无用于动态引用当年第一个月的语法。例如,您不能编写这样的公式:
ACCT.IT_Expense[time=1/this.year]
。但是,您可以使用 if 语句获得类似的结果。您的公式将如下所示:
iff(year(this)=2016,ACCT.IT_Expense[time=01/2016],iff(year(this)=2017,ACCT.IT_Expense[time=01/2017],iff(year(this)=2018,ACCT.IT_Expense[time=01/2018]...