已知各年度销售额的直方图如下所示:

Spotfire调试经验——环比的动态计算(Dynamic moving data calculation in Spotfire visualization)

问题:如何展现出销售额在各年度间的变化?

解决方案:单击图标左侧Y轴销售额,编辑公式为“Sum([Sales Total]) - Sum([Sales Total]) Over (Previous([Axis.X]))”,即可实现用户所选择的各年度环比动态计算。

Spotfire调试经验——环比的动态计算(Dynamic moving data calculation in Spotfire visualization)

 

------------------------------------------------------------------------------------------------------------------

以下内容节选自官方文档:

The OVER functions are used to determine how data should be sliced, for example, relative to time periods. For more information, see OVER in Custom Expressions and Advanced Custom Expressions. 
Option: Previous()

Uses the previous node on the same level as the current node to compare the result of the current node with the previous one. If there is no previous node, that is, if the current node is the first node for the current level, the resulting subset will not contain any rows.

An optional second argument can be used to specify the number of steps to navigate. The second argument must be an integer (can also be 0 or negative). 

Example:

Sum([Sales]) - Sum([Sales]) OVER (Previous([Axis.X]))


Count() OVER Previous([Axis.X], 2)

以下内容为培训资料中的说明:

The Previous() method will look for data with the Previous value compared to the value in the slice currently being evaluated.
A good example of the Previous function is a plot that shows change over time.

相关文章:

  • 2021-07-28
  • 2021-09-16
  • 2021-08-06
  • 2021-10-09
  • 2021-09-15
  • 2021-09-03
  • 2021-06-29
  • 2021-04-30
猜你喜欢
  • 2021-05-15
  • 2021-04-15
  • 2021-12-12
  • 2021-07-30
  • 2021-05-10
  • 2021-12-17
  • 2022-01-12
相关资源
相似解决方案