3 Replies Latest reply on Oct 29, 2013 7:50 AM by Jonathan Drummey

    How to have different scopes for a table calculation within one calculation?

    Alan Treanor

      I'm trying to produce a graphic like this:

       

      http://www.nytimes.com/interactive/2009/11/26/us/20091126-search-graphic.html

       

      I've produced an example using the Superstore dataset (attached). The steps I need to go through are:

       

      1. For a given category, calculate the proportion of searches from each country that were for that category (orders for this [category, country] divided by all orders for that country)

      2. For a given category, calculate the proportion of searches from all countries that were for that country (total orders for this category divided by total orders for all categories)

      3. Calculate the % difference between 1 and 2

       

      I'm currently stuck on calculation 2 because I can't see how to use two different scopes in one Table Calculation. I need to calculate:

           (total orders for the category set in the page) / (total orders)

      and have that displayed in each row. The value should be 5.09%, as shown in the Grand Total for the column.

       

      Any assistance would be greatly appreciated. I'm guessing there must be a better way of approaching this.

       

      Thanks,

       

      Alan