6 Replies Latest reply: Mar 31, 2014 8:55 AM by Chirag Patil RSS

    Wildcard when ApplyMap

      Hi!

       

      I'm mapping serial numbers to a description and I just wonder if there are any way to create a sequence with a wildcard?

      Six digits and the seventh is 0-9.

       

      This is what I have now:

       

      mytable:
      Mapping LOAD * INLINE [
      QLKRTP, QLDESC_OWN
      4263870,Lorem ipsum
      4263871,Lorem ipsum
      4263872,Lorem ipsum
      4263873,Lorem ipsum
      4263874,Lorem ipsum
      4263875,Lorem ipsum
      4263876,Lorem ipsum
      4263877,Lorem ipsum
      4263878,Lorem ipsum
      4263879,Lorem ipsum 
      4263880,Dolor sit amet
      4263881,Dolor sit amet
      4263882,Dolor sit amet
      4263883,Dolor sit amet
      4263884,Dolor sit amet
      4263885,Dolor sit amet
      4263886,Dolor sit amet
      4263887,Dolor sit amet
      4263888,Dolor sit amet
      4263889,Dolor sit amet
      ];
      
      
      
      

       

      But I want:

       

      mytable:
      Mapping LOAD * INLINE [
      QLKRTP, QLDESC_OWN
      426387*,Lorem ipsum 
      426388*,Dolor sit amet
      ];
      
      
      
      

       

      Possible?

       

      regd

      thomas

        • Wildcard when ApplyMap
          Stefan Wühl

          Define your map table like

          mytable:
          Mapping LOAD * INLINE [
          QLKRTP, QLDESC_OWN
          426387,Lorem ipsum
          426388,Dolor sit amet
          ];

           

           

          and then use

          applymap('mytable', left(FIELD,6) )


          in your load

            • Wildcard when ApplyMap

              Hi!

              Need

              applymap('mytable', left(FIELD,7) ) and that's why I need 0-9 on every possible 6-digit number.

              Sometimes , when certain conditions is met, I need to do a deeper investigation and look in a different mapping table.

               

              rgds

              thomas

                • Wildcard when ApplyMap
                  Stefan Wühl

                  Thomas,

                   

                  I understood that you have a field with a 7 digit number, but only the first 6 are significant for your lookup.

                  So I suggest that you look only at your first 6 digits and look those up in your mapping table.

                   

                  I quite don't understand when you are saying:

                  Need applymap('mytable', left(FIELD,7) ) and that's why I need 0-9 on every possible 6-digit number.

                   

                  or why my suggestion should not solve your problem. Could you maybe give an example where my suggested code doesn't give you the expected result?

              • Re: Wildcard when ApplyMap

                If I understand you maybe this can help you:

                 

                map_table:

                Mapping

                LOAD  '|' & QLKRTP as QLKRTP_Map, QLDESC_OWN as QLDESC_OWN_Map INLINE [

                QLKRTP, QLDESC_OWN

                426387,Lorem ipsum

                426388,Dolor sit amet

                ];

                 

                DATA:

                LOAD purgechar(mapsubstring('map_table','|' & ID),'0123456789') as MappedField, * INLINE [

                ID, VALUE

                426387023432,TypeA

                426387123232,TypeA

                426387229564,TypeA

                426388102932,TypeB

                426388923983,TypeB

                ];

                Regards