1 Reply Latest reply on May 22, 2012 10:19 PM by Dimitri.B

    Applying weights in table calculations

    James Pacey

      Hi All,

       

      I’m working on a bit of a tricky one at the moment.

      Working with some call centre satisfaction survey data and creating a chart that reports the % of respondents replying with each of the 3 possible responses to a question:

       

      Eg

      Dimension          Measure
      Choice A              50%
      Choice B                25%
      Choice C               25%

       

      Simple enough so far. However, the survey has been asked across multiple call centres and there has been a request to weight these figures to reflect the volume of calls handled at each site.

      I have calculated these weights and added them to my data so each record has the weight associated with its call centre field.


      Eg:

      Call Centre          Weight                 Survey Response

      1                              0.5                          A
      1                              0.5                          B
      2                              0.3                          C
      3                              0.2                          B
      2                              0.3                          A
      3                              0.2                          B

       

      My question is how do I update my table calculation to produce the weighted scores?

       

      SUM([Survey Response]) / TOTAL(COUNT([Survey Response]))

       

      My first thought was to try:

       

      ((SUM([Survey Response]))*[Weight]) / TOTAL(COUNT([Survey Response]))

       

      but Tableau gives an error because aggregate and non-aggregate values are mixed.

       

      Anyone have any ideas of the top of their head?

      I’ll try to construct an example with some sample data when I have a few minutes.

       

      Thanks