Grand Total Issue in Cross Table of Spotfire

北城以北 提交于 2019-12-05 20:36:30

Short answer, yes if you want the Grand Total to be a summation of your data. Applying a grand total to a different aggregation will have different results.

  • AVG will average the averages of your Category Axis
  • MAX will take the MAX of the Max for each category
  • Cumulative Sum will take the "Last" value in your Category since it doesn't have any additional values to SUM up.
  • Product will take the Product of Products
  • First and Last you are already aware of.

Long Answer:

You actually CAN sum the first value of a column from a column grouping.

For example, consider the following data set.

[Grouping] [Food] [Color] [Weight]
Fruit Apple Yellow 4
Fruit Apple Green 2
Fruit Apple Red 4
Fruit Banana Yellow 5
Fruit Banana Brown 2
Fruit Orange Orange 3
Vegetable Carrot Orange 4

If, in your custom expression, you put

Sum(if(RankReal([Grouping], "ties.method=first", [Food]) = 1, [Weight], 0))

it will find the first instance of each food in your data set, so regardless of how you group the left, your results, subtotals, and grand totals will sum only the first instance of each food.

So you will be able to see the following:

Fruit     Apple        4
            Banana     5
            Orange     3
            Subtotal:  12
Vegetable Carrot  4
            Subtotal:   4
Grand Total:        16

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!