2 Replies Latest reply: Feb 20, 2016 10:59 AM by Christian Flood RSS

    WildMatch function

    Christian Flood

      Hi I have a column with strings in it.

       

      The format of the strings are following

       

      1.01.01.02 CAPITAL LETTERS

      1.01.01.02-01 First letter capital the rest is lower case

      1.01.01.03 CAPITAL LETTERS

      1.01.01.02-01 The first letter will be capital again, sometimes there might be a capital within aswell

      1.01.02.01 CAPITAL LETTERS SOMETIMES HAS-A DASH


      What I want to do is to collect all strings that has capital letters in a new field, same for the others


      One way to filter would be that if #-# would exist the save to new field


      This if statement is close but won't do because it will map on HAS-A DASH aswell:

      If(WildMatch(Field, '*-*') = 1, [Field]) AS [NewField],


      I tried this aswell but it doesn't work

      If(WildMatch(Field, '*#-#*') = 1, [Field]) AS [NewField],


      Is there a way to catch number-number but not letter-letter?


      Br

      Christian

        • Re: WildMatch function
          Sunny Talwar

          Are you looking for this?

           

          Capture.PNG

           

          May be this:

           

          Table:

          LOAD Field,

            If(Len(Trim(KeepChar(Field, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))) > 1, Field) as Field1,

            If(Len(Trim(KeepChar(Field, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))) < 2, Field) as Field2;

          LOAD * Inline [

          Field

          1.01.01.02 CAPITAL LETTERS

          1.01.01.02-01 First letter capital the rest is lower case

          1.01.01.03 CAPITAL LETTERS

          1.01.01.02-01 The first letter will be capital again, sometimes there might be a capital within aswell

          1.01.02.01 CAPITAL LETTERS SOMETIMES HAS-A DASH

          ];

            • Re: WildMatch function
              Christian Flood

              Hi Sunny T,

               

              I got the same result doing it like this:

               

              If(WildMatch([Field],'*-0*','*-1*','*-2*','*-3*','*-4*','*-5*','*-6*','*-7*','*-8*','*-9*') >= 1, [Field]) AS [Field 1],
              If(WildMatch([Field],'*-0*','*-1*','*-2*','*-3*','*-4*','*-5*','*-6*','*-7*','*-8*','*-9*') = 0, [Field]) AS [Field2],

               

              But thanks alot for your help!