在 Cognos 中减去行值

Subtracting row values in Cognos

我有以下报告:

Id   Product    Revenue   Month
1     A          302        jan
1     A          342        feb
1     A          133        mar

对于这份报告,我需要找出几个月的收入差异,即 1 月至 2 月和 2 月至 3 月的收入差异。 我想像这样添加另一列:

  Id   Product    Revenue   Month  Profit
    1     A          302     jan
    1     A          342     feb     40
    1     A          142     mar    -200

我可以为它编写一个案例语句并创建一个计算字段,但我不知道如何引用这些行来进行减法。谁能帮我解决这个问题。

当您尝试 running-difference([Revenue]) 时会发生什么?