3 Replies Latest reply: May 15, 2014 10:09 AM by TMERRYMAN _ RSS

    The LSplit function

    TMERRYMAN _

      I am having a bit of trouble trying to create calculated fields that will split one of my fields into 3 seperate fields.  I decided to try using the Mid_XL function along with the LSplit function, however, it isn't working as expected.  I am not sure what the problem is.  It seemed to work on the first part I wanted to pull out, but not the second and third.

       

      Here is the field I want to split:

       

      CustomerTaxCode

      X CODE:  TX  n Date: 11/01/2010  TM R Date: 11/01/2010   STOMER NO:  0005716 -


      X CODE:  TX VIC X CODE:  TX VICVIC -


      /CODE

       

      I would like to split it where the "x code:" falls in the field, resulting in 3 parts.  I'll need to pull specific data from each of these parts, but I can work on that later.  I can't seem to get the split right.  With the formula I am using, no data is pulling into the new field. 

       

      Here is my formula for the calculated field to extract the second part:

       

      lsplit(,3,"x code:",2)

       

      Any help would be greatly appreciated!

       

      Teresa

        • The LSplit function
          Nick Osdale-Popa

          I am having a bit of trouble trying to create calculated fields that will split one of my fields into 3 seperate fields.  I decided to try using the Mid_XL function along with the LSplit function, however, it isn't working as expected.  I am not sure what the problem is.  It seemed to work on the first part I wanted to pull out, but not the second and third.

           

          Here is the field I want to split:

           

          CustomerTaxCode

          X CODE:  TX  n Date: 11/01/2010  TM R Date: 11/01/2010   STOMER NO:  0005716 -


          X CODE:  TX VIC X CODE:  TX VICVIC -


          /CODE

           

          I would like to split it where the "x code:" falls in the field, resulting in 3 parts.  I'll need to pull specific data from each of these parts, but I can work on that later.  I can't seem to get the split right.  With the formula I am using, no data is pulling into the new field. 

           

          Here is my formula for the calculated field to extract the second part:

           

          lsplit(,3,"x code:",2)

           

          Any help would be greatly appreciated!

           

          Teresa[/QUOTE]

           

          if your input field () is all CAPS, change your separator to "X CODE:" or change the formula to:

          lsplit(Upper(),3,"X CODE:",2)