各季度销售额的直方图如下所示:

Spotfire调试经验——同比的动态计算(Dynamic parallel period compare in Spotfire visualization)

问题:如何展现出销售额的同比变化(如,与上一年度同一季度的进行比较)?

解决方案:单击图标左侧Y轴销售额,编辑公式为“Sum([Sales Total]) - Sum([Sales Total])OVER (ParallelPeriod([Axis.X]))”,即可实现该需求。


Spotfire调试经验——同比的动态计算(Dynamic parallel period compare in Spotfire visualization)

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

The OVER functions areused to determine how data should be sliced, for example, relative to timeperiods. For more information, see OVER in Custom Expressions and AdvancedCustom Expressions.

Option: Parallel Period

Uses the previousparallel node with the same value on the same level as the current node. Forexample, this can be used to compare sales results for each month with thecorresponding months the previous year.

 

Example:

 

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

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

The ParallelPeriod() method is handy because itperforms a set of common node navigations at once.  From your currentnode, the method traverses up one level of the hierarchy, then navigates to oneprevious node at the parent level, and then descends back down the hierarchy tothe original level to find the mode value that matches the starting point.

*Note that the expression does not need to take the colorproperty into consideration with an All() method.  This is because coloris slicing by quarter, and ultimately we are constraining our navigation to thesame quarter value.  The color was added simply to make it easier toverify and interpret the results.

相关文章:

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