1

I am trying to find the percentage contribution of each cell in a cross table in spotfire.

The table looks like this

Group     Name     Score
1         Andy     80
          Bill     70
          Charlie  90
2         Andre    100
          Bob      60
          Clint    70

I want to make the table to show something like this

Group     Name     Score   Percentage
1         Andy     80      33%
          Bill     70      29%
          Charlie  90      38%
2         Andre    100     43%
          Bob      60      26%
          Clint    70      30%

Where each percentage is the score of each person divided by the total of the score in each group so for Andy = 80 / (80+70+90) = 33%

My code so far is this

Count([Score]) / Count([Score]) OVER (Intersect(Parent([Group]),All([Name])))

I am not sure which part I get wrong. Please help.

newb
  • 77
  • 1
  • 2
  • 8

1 Answers1

6

After I try few combinations I have found the answer myself. I'll leave my method here so anyone who also trying to fix similar problem might be able to get a clue

Count([Score]) / Count([Score]) OVER (Intersect(Parent([Axis.Rows]),All([Axis.Rows])))
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
newb
  • 77
  • 1
  • 2
  • 8
  • Also, feel free to come back after 48 hours and accept your own answer if you feel it is the best solution for your issue (which it looks like it is). – clesiemo3 Jun 18 '15 at 14:18