7 Replies Latest reply: Jul 23, 2012 8:51 AM by Roland Kunle RSS

    Error in ApplyMap

      Attahed is the Sample application. Applymap is not working as required.

       

      as in my application, my cleared no should be 2345 / 3456 and Cleared Amount should be 20 and 13 respectively.. which is not happening.. I need only the values below

       

      234520 
      345613

       

      the remaining values should not reflect.

        • Re: Error in ApplyMap

          In order to use the "ApplyMap" function, this function can be defined (is this case the table is not created, can't be dropped):

           

          Monthly:

          Mapping LOAD No as M_No,

          ID,

               Amt as M_Amt

          FROM

          Monthly.xlsx

          (ooxml, embedded labels, table is Sheet1);

           

          Master:

          LOAD No as O_No,

          ID,

               Amt as O_Amt

          FROM

          Master.xlsx

          (ooxml, embedded labels, table is Sheet1);

           

          Collected_Final:

          Load *,

          if (isnull (ApplyMap ('Monthly', O_No)), O_No) as Cleared_No ,

          if (isnull (ApplyMap ('Monthly', O_No)), O_Amt) as Cleared_Amt

          Resident Master;

          Drop Table Master;

          • Re: Error in ApplyMap

            Hi Shipa,

            as far as I can see, your script should work with the use of the keyword "Mapping" like Enrique told in the first answer.

             

            Monthly:

            Mapping        // <------- use the keyword "mapping" to identify the following table as a mapping table !!

            LOAD

                No as M_No,    

                ID,

                Amt as M_Amt

            FROM

            Monthly.xlsx

            (ooxml, embedded labels, table is Sheet1);

             

             

            Note:

            The function Applymap() doesn't raise unfortunally any error if it can't find a fitting mapping table (in your case "Monthy")

            HtH

            Roland