11 Replies Latest reply: Feb 17, 2010 9:14 AM by Neil Southern RSS

    How to do a calculation in the script between 2 fields from 2 diff tables?

    Igor Alcantara

      Hello all.

      I have 2 tables:

      Table T1:
      Columns: A, B and C

       

      Table T2:
      Columns A, D and E

       

      The link between T1 and T2 is made by column A.

      I need in the script to join both tables in one single logic table and also calculate the result of C * E.

      Join the tables is easy, I am doing this:

       

      myTable:
      Load A, B, C From T1;
      INNER JOIN Load A, D, E From T2;

       

      However, how to calculate C * E?

      If I try this:


      myTable:
      Load *, C * E;
      Load A, B, C From T1;
      INNER JOIN Load A, D, E From T2;

       

      It says column E is unknown because the preceding load does not read T2. So, how can I do what I need to do?