1 Reply Latest reply on Dec 15, 2016 11:14 AM by Ivan Young

    Sum of weighted Average

    michelle.smith.2

      Hi.  I need to create a calculation that is a sum of weighted sales based on a dimension I do not want to show in the viz.  In the superstore example (using an example I found in Tableau knowledge), I want to create a weighted sum of sales with the order quantity being the weight.  I created the weight as

      weight =  sum([Order Quantity])/window_sum(sum([Order Quantity]),First(),Last()).  When I add this to the viz with product sub-category in the rows, I get the correct weight and then I create a second calculated field  that is just sum of sales * weight to get weighted sum of sales. What I want is to not show the product sub category and to just show the sum of the weighted sum of sales, which should be $30,106. 

          

       

      Any help is appreciated!!