4 Replies Latest reply: Sep 30, 2016 4:19 AM by Mike Seisbye RSS

    Mapping load error

    Mike Seisbye

      Hi Guys

       

      What am i Doing wrong here?   I have created 2 mappings. which i would like to use in my load.

       

      I have an Industrycode on all my customers. This industry code can then "reveal" a sector code.  There are 2 rules to use here.

      If it has a value, then "lookup" the value in MAP_CAT_CODE.  This fails, and tells me the field [Industry code] dosn't exist?

       

      IF blank(here we use dot).  then i need to look in the MAP_CHANNEL.  The map channel needs to look up the channel value of the customer. so get the correct value. Is this correct made? I haven't gotten this fare since it's fails. so I thought I could just as well to a double question while at it.

       

      Thanks

       

       

      MAP_CAT_CODE:

      LOAD     [Industry Code],

              [CAT CODE 26]

      FROM

      [O:\Rapportering\QV\Sector Change\industrycode_sector_load.xlsx]

      (ooxml, embedded labels, table is [Industrial Codes]);

       

       

      MAP_CHANNEL:

      Mapping LOAD

           A,

           B

      FROM

      [O:\Rapportering\QV\Sector Change\IND_IAU.xlsx]

      (ooxml, no labels, table is Sheet1);

       

       

      LOAD

             Customer as SellToCustomer,

            Channel as A,

             Industry,

             If(Industry <> '.' , ApplyMap('MAP_CAT_CODE', [Industry Code], 'IA BLANK'), ApplyMap('MAP_CHANNEL', A, 'IA BLANK' )) as JDE_SECTOR,

             SectorDesc as JDE_SECTOR_DESCRIPTION

       

      FROM

      [O:\Rapportering\QV\Sector Change\JDE SECTOR - Daily feed.xlsx]

      (ooxml, embedded labels, table is Sheet1);

        • Re: Mapping load error
          Sunny Talwar

          I think you forgot to add the keyword Mapping in your first table:

           

          MAP_CAT_CODE:

          Mapping

          LOAD     [Industry Code],

                  [CAT CODE 26]

          FROM

          [O:\Rapportering\QV\Sector Change\industrycode_sector_load.xlsx]

          (ooxml, embedded labels, table is [Industrial Codes]);

            • Re: Mapping load error
              Sunny Talwar

              Also you need to use the actual field name instead of the new field name here:

               

              LOAD Customer as SellToCustomer,

                        Channel as A,

                        Industry,

                        If(Industry <> '.' , ApplyMap('MAP_CAT_CODE', [Industry Code], 'IA BLANK'), ApplyMap('MAP_CHANNEL', Channel, 'IA BLANK' )) as JDE_SECTOR,

                        SectorDesc as JDE_SECTOR_DESCRIPTION

              FROM

              [O:\Rapportering\QV\Sector Change\JDE SECTOR - Daily feed.xlsx]

              (ooxml, embedded labels, table is Sheet1);

            • Re: Mapping load error
              Mike Seisbye

              Thank you both..

               

              The missing mapping, where because I "cleaned" the code with all the company names etc.  and i removed to much.

               

              It's was as you both suggested the Reference in the Applymap I had misunderstood.  I though i should you the name from the mapping column.  And when i used the field names from the actual load It worked perfect.

               

              PS. What does it take to be able to post in real time? Really annoying you sometimes have to wait several hours before it's approved.