3 Replies Latest reply: Apr 24, 2012 11:17 AM by Uday Kumar RSS

    Calculating Share giving problem

    Uday Kumar

      Hi,

       

      i have calculated share using the expression,

       

      =sum(Volume) / sum(total<MONTH_NAME,MARKET_NAME> Volume)

       

      the table shows the share for all the products in the market.

      when i select some products, then share calculated among those selected products for a given month and given market.

      i dont want it to calculate share among those products, i want share to be calculated for all the products.

      ex;

       

      Product Name
      Share
      Hum60%
      Enb20%
      Ste-
      Sim20%

       

       

      so if i unselect Enb from the product list, the share should show like this

      Hum-60%

      Sim-20%

      Ste- -,

       

      It should not show like this

      Hum-70%

      Sim-30%

      Ste--

       

      so how to change the expression, so that i will get like this

      Hum-60%

      Sim-20%

      Ste- -,

        • Re: Calculating Share giving problem
          I think the expression should look something like this: sum(volume/sum(total {<product=>} volume). See example below. You should be able to add in the month if need be. I believe this logic is covered in "set modifiers" in the reference manual. You can set the value of product to be a specific value or to be all values, regardless of selections. Examples would be: sum(volume/sum(total {<product={'a'}>} volume) or the one above.
          • Calculating Share giving problem
            jagan mohan rao appala

            Hi,

             

            Can you attach sample file that you are working. 

             

            Try calculating the Total and store it in variable and use this variable in expression like this.

             

            your variable should be

             

            vTotalValue = Sum({1} Volume)

             

            So, now total is calculated, this value is used in expression like this

             

            =sum(Volume)/vTotalValue

             

            Now you will get the result as you expected.

             

            Hope this helps you.

             

            Regards,

            Jagan.