3 Replies Latest reply on Mar 26, 2012 7:44 AM by Jonathan Drummey

    How to do Window_Sum on a specific Measure

    Pavan Tadepalli



      How do I calculate a Window_Sum on a specific measure? I have a table with Sales Growth % by each branch and by each distributor. Currently the dashboard I have is showing the growth % of each dealer within a branch. My question is How do I add the overall growth % of each branch to this...?


      Something like this..


      CompanyBranch 1DistributorGrowth %
      ABCLos AngelesA15%
      ABCLos AngelesB16%
      ABCLos AngelesC17%
      ABCLos AngelesABC Total6%



        • 1. Re: How to do Window_Sum on a specific Measure
          Jonathan Drummey

          I'm not clear on exactly where the growth % of is coming from and how you want to sum that up. However, setting up table calculations to do different aggregations of a given measure is very much possible, as in the attached packaged workbook. You need to be setting the Compute along/using to Advanced... and then put in all the dimensions except the one you want for partitioning. Here's an example using the Superstore Sales DB. I put the Category, Sub-Category, and Product Name hierarchy on the Rows shelf:




          Then I set up three table calcs on SUM(Sales) that all have the same basic Percent of Total formula. I set the Compute along/using to Category and Product Name for the % of Sub-Category Sales, so the calculation is partitioned (i.e. creates a different result for) for each Sub-Category.




          Then for the % of Category Sales, I set to Compute along/using to Sub-Category and Product Name. The % of All Sales I just left at the default Table (Down) partitioning, which works fine.


          If you haven't read this white paper yet, it's a good overview: http://www.tableausoftware.com/sites/default/files/pages/table_calcs_in_tableau_6.pdf

          And working your way through these calcs makes a good start at learning table calcs:



          Let me know if this helps!



          • 2. Re: How to do Window_Sum on a specific Measure
            Pavan Tadepalli

            Thanks Jonathan.


            I apologise. I should have been more clear. Here is how my source data looks. The excel bar chart below is what I am trying to show in Tableau. 

            I think Window_Sum function will help here. But I am not sure how to do Window_sum for each Distributor and for each product category? Thanks for your help again.





            • 3. Re: How to do Window_Sum on a specific Measure
              Jonathan Drummey

              Hi Pavan,


              Can you post a packaged workbook with some sample data? I think that would be easier to work with than trying to interpret your data and then generate calculations that you could implement, which is what I tried in my prior post. That way I could show you more exactly what you want.