7 Replies Latest reply: Jan 6, 2017 10:00 PM by Sunny Talwar RSS

    load two tables: first with data and second with + or - sign

    Giuliano Beltramello

      Hello everybody,

      I have this scenario:

      two tables

      1) the first is a list of description each one with the relative sign (it's about the description of movements of goods)


      10buy with order+
      20sell with order-
      22returned from customer+

      internal load

      71internal unload-


      as you see when I buy a product the quantities in the warehouse increase ( + ) as well as when a customer return a product, while when I sell a product the quantities decrease;


      2) in the second table I have all the movements that interested my warehouse,




      where CDARMM is the article of the product bought or sold, DTOPMM is the date of selling of buying, CAMOMM is the description in table one and QTMOMM is the quantity bought or sold.


      NOW, the thing I need to do is to load the above data with a script so that I obtain a table where, for each article, I have the item (CDARMM), year,  the total ingoing quantity ( + ) and the total outgoing quantity ( - ) ; furthermore while summing the quantities I have to exclude the movements that came with certain CAMOMM (in my case I have to ignore CAMOMM = 70 or 71)


      I'll have several years of data to load, each year is in a different file, while le first above mentioned table is always the same (see the first point).


      I tried several solution, but I'm not able to find the solution

      someone can help me?