1 Reply Latest reply: Mar 15, 2012 12:57 PM by Brandon Apperson RSS

    Calculated Field using 2 Tables

      Hello All,

       

      I am trying to create a calculated field in my script using 2 fields in 2 different tables. I know it's something simple but I would appreciate some help.

        • Re: Calculated Field using 2 Tables

          I don't know if this will help you but here's a simple example:

           

          test:

          LOAD * INLINE [

          ARTNBR, NUMBER1

          3154, 1000

          3154, 857

          3169, 455

          3169, 3542

          ]

          ;

           

          inner join

           

          LOAD * INLINE [

          ARTNBR, NUMBER2

          3154, 50

          3169, 222

          ];

           

           

          test2:

          LOAD *,

          NUMBER1 - NUMBER2 as NUMBER_DIFFERENCE

          Resident test;

           

          drop table test;

           

          NUMBER_DIFFERENCE is a calculated field using 2 fields in 2 different tables.  I also attached a qvw for additional help if you need it.

           

          Hope this helps!