4 Replies Latest reply on Nov 6, 2009 1:56 AM by jonas_1

    GetRepetition by content

    jonas_1

      Title

      GetRepetition by content

      Post

      Unfortunately the line below does not work as the second argument of GetRepetition should be a number. 

       

      GetRepetition (Text::content ;Text::language["Swedish"] )

       

      How do I find the number reference to the Text::language repetetion containing "Swedish", (if present)?

        • 1. Re: GetRepetition by content
          raybaudi
            

          Hi jonas

           

          If there are NOT empty values into reps before the rep containing "Swedish" and if there are NOT accented initials, you can try:

           

          Let(
          rep = YourRepeatingFieldName;
          Position ( Filter ( Proper ( Substitute ( List ( rep ) ; "Swedish" ; "§" ) ) ; "ABCDEFGHJKILMNOPQRSTUVWXYZ§" ) ; "§" ; 1 ; 1 )
          )

          • 2. Re: GetRepetition by content
            philmodjunk
              

            Very clever Daniele,

             

            I was intriqued enough to play with this calculation. For some reason, it wouldn't update each time I modified which repetition held the target text until I made the calculation unstored. Also, Substitute is case sensitive so SWEDISH or swedish won't be replaced with § without further modifications to your expression.

             

            A small re-arrangement of the functions can handle the case sensitivity:

             

            rep = NameReps;
            Position ( Filter (  Substitute ( Proper ( List ( rep ) ); "Swedish" ; "§" ) ; "ABCDEFGHJKILMNOPQRSTUVWXYZ§" ) ; "§" ; 1 ; 1 )
            )

            • 3. Re: GetRepetition by content
              raybaudi
                

              PhilModJunk wrote:

               

              For some reason, it wouldn't update each time I modified which repetition held the target text until I made the calculation unstored.


              No need to let it unstored IF you set it directly ( w/o the Let ( ) function ):

               

              Position ( Filter (  Substitute ( Proper ( List ( YourRepaetingFieldName ) ); "Swedish" ; "§" ) ; "ABCDEFGHJKILMNOPQRSTUVWXYZ§" ) ; "§" ; 1 ; 1 )

              • 4. Re: GetRepetition by content
                jonas_1
                  

                Very clever indeed! Thank you both!

                best regards

                Jonas