4 Replies Latest reply on Nov 9, 2012 10:05 AM by philmodjunk

    Filter or Case

    bookalaka_1

      Title

      Filter or Case

      Post

           Have not been able to figure a solution have tried a few things unsuccessfully. How would I elimintate the left word in a string. I want to eliminate the space, comma and word to the left of the word in bold. This is an example the number of characters will always change.  

           1.La Fiorita, Brunello di Montalcino, D.O.C.G. 

           2. Soter, Pinot Noir, 'MSR' Mineral Springs Ranch, Yamhill-Carlton

           Thanks for help.

        • 1. Re: Filter or Case
          schamblee

               Calculation

                

               Let([totlength=Length(TheText);
                    llength=Position ( TheText ; "," ; 1 ; 1 )+1;
                    tlength=totlength-llength];
                    Right(TheText;tlength)

               )

          • 2. Re: Filter or Case
            bookalaka_1

                 Wow! Can you explain this.. I have never scene the use of "llength" is the extra "l" for let length? and ( TheText ; "," ; 1 ; 1 )+1;

                 does this mean the space after the comma, then the word +1?

                 Thanks for the solution.

            • 3. Re: Filter or Case
              schamblee

                   totlength,llength,tlength are all variables and can be anything. .  Totlength is the total length of the field,  llenght is the characters left of the comma,+1 accounts for the space pass the comma, tlength stand for the length of the return text.     You can use any variables you desire, I try to use something to help me remember what each part does.   You write 10,000 lines of code / script and then come back two years later and track down a bug or add a new feature.  (I also  add comments to my code)

              • 4. Re: Filter or Case
                philmodjunk

                     You can also use this simpler expression:

                     RightWords ( YourText ; WordCount (yourText ) - 1 )