4 Replies Latest reply: Mar 8, 2012 4:45 AM by Celambarasan Adhimulam RSS

    Mapping load : search for record with latest date

    andries Bos

      I do have a tabel containing all invoice prices for articles;

       

      I would like to combine this 'latest/current price' in my main tabel containing all articles. This in the script, not in my presentation layer.

       

      I use a 'mapping load' where I an searching on article number and returning the price. However this would return the first available record for this article.

       

      How could I use a mapping where a 'date' parameter should also be applied  : search on 'latest'

       

      in code:

       

      mapLatestPrice

      mapping Load

            Article_ID

           Price

      resident Invoices;

       

      mapLatestDate

      mapping Load

            Article_ID

           Price

      resident Invoices;

       

      ApplyMap ('mapLatestPrice',Article,'0') AS Articel.LatestPrice,

      ApplyMap ('mapLatestDate',Article,'') AS Articel.LatestDate,

       

       

       

       

       

       

      the invoices table:

       

      articlePricedate
      100212,51-1-2012
      100213,531-1-2012
      10021030-6-2011

       

      the second record should obvious be the result and not the first record.