7 Replies Latest reply on May 4, 2015 3:26 AM by Satyen Verma

    Header value in fact to be summed once per header

    Mamdouh Tawfik

      I have two table, one containing information about the produced quantity and the other containing information about the ingredients used to produce such quantity (in the header), what I need is to display the produced quantity beside each ingredient, this works fine, but when I exclude the ingredient the number is multiplied by the number of ingredients I have for each header

      SAMPLE DATA:

      HEADER TABLE

      HEADER_ID PRODUCT_ID QUANTITY

      1                    1                         5

       

      DETAIL TABLE

      LINE_ID HEADER ID INGREDIENT_ID QUANTITY

      1               1                    2                         10

      2               1                    3                         15

       

      SAMPLE REPORT

      PRODUCT QUANTITY

      1                    5

      But the result I get is 10 because there are two lines of details, what I want is to calculate the quantity once for each header then sum otherwise, any ideas?