7 Replies Latest reply: Jan 17, 2017 4:05 PM by Yeo Poh sai RSS

    Henric Cronström load multiple raw data using 1 script , ApplyMap how to add ?

    Yeo Poh sai

      Hi All

      Below code given by Henric Cronström , working fine , able to make use of only 1 script below loading 2 set of raw data Singapore and Malaysia :-


      For each vFileName in FileList('$(vRAWPath)\*.txt')


      LOAD left(FileBaseName(), 4) AS Report5_pay,

        FileBaseName() as SOURCE,

        @1:9T as [cust_id],

        @10:38T as [company_pay],

         ApplyMap('MapGroup',GROUP_CLASS,'OTHERS') as [GROUP_CLASS_]

      FROM "$(vFileName)" (ansi, fix, no labels, header is 0, record is line);

      Next vFileName


      Now the above ApplyMap only can recode :-

      if load Singapore or Malaysia raw data G1 it will recode G1-SG


      I like to know for the above Mapping recode , does it allow add condition ?

      if load Singapore raw data G1 it will recode to G1-SG

      if load Malaysia raw data G1 it will recode G1-MY


      Can some one tell me it is possible ?