10 Replies Latest reply: May 15, 2014 9:58 AM by PeteMurph _ RSS

    Template problem

    PeteMurph _

      I am trying to use the LSPLT function for a calculated field.

       

        Every field that I need to perform this on has the characters"L:" that I want to split on, so I would like to set up my LSPLIT like this:

       

                  LSPLIT(owner_bank,2,"L:",1).

      [/EMAIL] 

      Monarch does not like the colon ( smile.gif[/img]  in the function and will only accept a function of:

                    

                  LSPLIT(owner_bank,2,"L",1). 

       

      This works somewhat, but I have to do a lot of editing.

       

      Does anybody know how I could incoporare the : into my formula or why Monarch will not accept the colon as part of a function?

       

      Thank you.

        • Template problem
          Data Kruncher

          You may have run into a v6 problem. I've tested an LSplit with "L:" with v9, and it works just fine.

           

          This may have been addressed with the v7 or v8 upgrades.

           

          I'm not sure if the InStr function is available to you with v6, but if it is you can emulate the LSplit functionality by using a combination of the Left, SubStr, and/or Right functions in conjunction with the InStr function.

           

          I've often created expressions in this manner because I simply overlook the LSplit and RSplit functions and reinvent the wheel.    redface.gif[/img]  

           

          Not so much lately though; I think I finally[/b] have it in mind.   

           

          [size="1"][ October 11, 2007, 06:48 PM: Message edited by: Data Kruncher ][/size]

          • Template problem
            PeteMurph _

            Thank you.  Is there an online glossary on how tro use the different functions?

            • Template problem
              Data Kruncher

              You should find them all documented in your online Help, but you can also search the forum for samples.  [url="http://mails.datawatch.com/cgi-bin/ultimatebb.chi?ubb=get_topic;f=1;t=001618#000001"]Here's one.[/url]

              • Template problem
                Grant Perkins

                Pete,

                 

                Welcome to the forum.

                 

                When you define the formula do you get a message about use of an "Invalid Separator Character"?

                 

                You should find that "L" will work or ":" will work, but a 2 character separator is not possible in V6. Probably best to use the ":" and then, if you need the section before the ":" but without the "L" use one of the other functions to remove the L. There are probably several options available for that.

                 

                There is a Functions Reference Guide available form the main datawatch web site in the section that includes downloads. However it is currently at the Version 8 revision. That means that it will have all of the V6 functions, some may be slightly different, AND any added since V6. Still probably a useful document though especially if used in conjunction with the embedded help file to identify which functions are available to you in V6.

                 

                HTH.

                 

                 

                Grant

                 

                [size="1"][ October 11, 2007, 08:25 PM: Message edited by: Grant Perkins ][/size]

                • Template problem
                  PeteMurph _

                  thank you.  If I split on the :, I need to remove the last character on the right hand side.  I will try a RTRIM function.

                  • Template problem
                    PeteMurph _

                    that did not work.  Now I have a trailing "L" at the end of every record.  Any suggestions?

                     

                    Thanks in advance!

                    • Template problem
                      Data Kruncher

                      You can drop the last character ("L" in your case) with this expression:

                      [font="courier"]Left(MyField,Len(MyField)-1)  /font[/quote]You can do this with either an additional field as above, or include this type of logic in your existing expression.

                       

                      Kruncher

                      • Template problem
                        PeteMurph _

                        that worked Just curious, My existing expression is: LSPLIT(owner_bank,2,":",1) how would I incorporate: into that?

                         

                        Thanks for all your help everyone!

                        • Template problem
                          Data Kruncher

                          /size[quote]code:[/size]Left(LSPLIT(owner_bank,2,":",1),Len(LSPLIT(owner_bank,2,":",1))-1)  /QUOTEThat'll do it.

                          • Template problem
                            PeteMurph _

                            THANK YOU!!