3 Replies Latest reply: Feb 17, 2015 11:31 AM by Massimo Grossi RSS

    Calculation of field from 2 tables

    Adrian Buzer

      Hi

       

      I have one table (called 'Sales') which has sales data by product e.g.

       

      Product,Amount

      AAA,100

      BBB,200

      CCC,150

      DDD,300

       

      and I have another table (called 'Costs') which has standard costs by product e.g

       

      Product,Cost

      AAA,0.05

      BBB,0.01

      CCC,0.025

      DDD,0.035

       

      In the script how can I produce another table which has total costs by product (I want to multiply Amount by Cost for each product)

      This is a very simplistic example, my tables in reality are much more complicated but this is a good example to get me started.

      Thanks