1 Reply Latest reply on Dec 5, 2012 1:55 PM by raybaudi

    Indicate if characters in string match

    Terri

      Title

      Indicate if characters in string match

      Post

           Hi,
           First, FMPro 11 Advanced.
           Second, Mac.
            
           Field 1 contents: 

                62408426834FH2012

                 

                Field 2 contents:

                 

                426834

                 

                Field 1 is a calculation field of PC & Style Number & Season & Season Year

                Field 2 is the style number

                 

                I need a calculation that tells me if the style number part of Field 1 matches the style number of Field 2.

                Tip - there are always 6 characters after the style number.

                Tricky part - the style number is not always 6 characters long, it can be anywhere from 3-6 characters long.

                 

                Help?

                 

                Thanks!

            

        • 1. Re: Indicate if characters in string match
          raybaudi

               Hi

                

               this calculation returns 1 if they match:
                
               Let([
               start = Length ( Field1 ) - 5 - Length ( Field2 )  ; 
               end = Length ( Field1 ) - 5
               ];
               Middle ( Field1 ; start ; end - start ) = Field2
               )