4 Replies Latest reply: Aug 5, 2016 4:21 AM by S�lvia Ganh�o RSS

    Get associate field of selection

    S�lvia Ganh�o

      Hi,

       

      Imagine I have this table:

       

      Category          Product          Quantity

           A                         1                    10

           A                         2                    20    

           A                         3                    30

           B                         4                    40

           B                         5                    50        

           B                         6                    60


      I choose Product 1, so the category related to product is A, with the value 10 for Quantity.


      I would like to now the percentage of product 1 that was selled in the category A.

       

      So I want Sum of quantity for the product I selected

       

      And then I want Sum of quantity of all products related to the same category that product 1:

           So I want quantity of product 1, 2 and 3, all belonging to category A: 10+20+30 = 60

       

      The question is that the only thing I have selected is Product = 1

       

      bottom of line I want something like:

       

          Sum quantity where product = PRODUCT SELECTED  / Sum quantity where category = category of PRODUCT SELECTED

       

      How can I achieve this ?

      It may be something simple but I'm not getting there.

       

      I will give you more information if this is not enough.

       

      Thanks in advance.

       

      Regards,

      Sílvia