17 Replies Latest reply: Jun 9, 2014 10:02 AM by Srikanth P RSS

    Using ApplyMap but getting Field not Found Error

      I am using applymap to add UserID, Region and UserName. Usually I would join but I read the blogs and found out ApplyMap would work on this and would save processing time. I keep getting the Field Not Found error, however, even though the table name is listed and spelled correctly and when I use the debugger, the mapping load is done correctly. I wonder if it is my SQL syntax because that is where I get the error but I reviewed the previously asked questions and followed the examples in the blogs and I do not understand why this error persists. Any help in explaining why I got the error would be beneficial to my growing knowledge.


      //***Poster ID table****//
      PosterID:
      Mapping LOAD
       
      AUDNAME,
       
      AUDUID;
      SQL SELECT "AUDNAME",
      "AUDUID"
      FROM FR_OPR_PRO.TBLMAPAUDITOR;

      //***Region Name table***//
      Region:
      Mapping LOAD
      MGR,
      REG;
      SQL SELECT "MGR",
      "REG"
      FROM FR_OPR_PRO.TBLMAPAUDITOR;

      //***Poster Name table***//
      PosterName:
      Mapping LOAD
      AUDUID,
      AUDNAME;
      SQL SELECT "AUDUID",
      "AUDNAME"
      FROM FR_OPR_PRO.TBLMAPAUDITOR;


      //***Deposit Summary & Checks Table with Region and User Info***//
      Deposits:
      LOAD *,
         
      if(Age <=7,'0 - 7',
         
      if(Age >7 and Age <=14,'8 - 14',
         
      if(Age >14 and Age <=21,'15 - 21',
         
      if(Age >21 and Age <=28,'22 - 28',
         
      if(Age >28 and Age <=35,'29 - 35',
         
      if(Age >35 and Age <=42,'36 - 42',
         
      if(Age >42 and Age <=49,'43 - 49',
         
      if(Age >49 and Age <=56,'50 - 56',
         
      if(Age >=57,'57+'))))))))) as AgeCat;
          
      LOAD "CHECK_SOURCE" as CheckSrc,
         
      "DEPOSIT_DATE" as DepositDate,
         
      "NUMBER_CHECKS" as NumberChecks,
         
      "VALIDATOR_ID" as ValidatorID,
         
      Interval(Today()-DEPOSIT_DATE,'DD') as Age,
         
      "CHECK_AMT" as CheckAmt,
         
      "CHECK_DATE" as CheckDate,
         
      "CHECK_ID" as CheckID,
         
      "APPLIED_AMT" as AppliedAmt,
          (
      CHECK_AMT - APPLIED_AMT)>0 as Unapplied_Amt,
      ApplyMap('PosterID',AUDUID)as UserID,
      ApplyMap('Region',REG) as Region,
      ApplyMap('PosterName',AUDNAME) as UserName;
      SQL SELECT *
      FROM HUM.TFNDPBH,
      HUM.TFNDPCK;