15 Replies Latest reply: Jul 17, 2015 7:22 AM by Espen Lutken RSS

    New field - filled in with complete info

    Espen Lutken

      Hi all,

       

      I am facing a problem with my script regarding invoicing. Each invoice has several lines, but only one of the lines state an Account_Number. It is important to note that the Account_Number is not necessarily on Line 1.

       

      For certain operations I need the Account_Number field the way it is, but for others I need all lines filled in with whatever account number was relevant for that invoice. Basically what I need is a new field (Account_Number2) where all lines are
      filled in. Also some indication on where in my script I put this would be helpful. Should it be in the original table Load statement, or should it be a separate Join, etc.? Can anyone help with this? Thanks!

        • Re: New field - filled in with complete info
          Espen Lutken

          Some more visual explanation. What I need is basically this final column:

           

          Doc   Line    Account_Number     Account_Number2

          001    01      00010-123-0006      00010-123-0006

          001    02                                      00010-123-0006

          002    01                                      00010-124-0001

          002    02                                      00010-124-0001

          002    03      00010-124-0001      00010-124-0001

          002    04                                      00010-124-0001

          • Re: New field - filled in with complete info
            Espen Lutken

            So I finally got a solution to this problem using an earlier script and a variation of the Len shown above. Thanks for all your guys' help.

             

            I wrote the following script:

             

             

            Left Join
            Load
            %DocKey,
            LIFNR as LIFNR2
            Resident ReadyTable
            Where Len(Trim(LIFNR)) >0;