5 Replies Latest reply on Apr 5, 2012 2:29 AM by Malcolm

    Lists of indices

    pantarhei

      This must be a rather stupid and elementary question, but here it goes!

       

      Is there a better and easier way to generate a list of a field index than sorting, subsummarizing and exporting?

       

      Background: I have a bunch of virgin users, who enter values via Value Lists. At some stage I will need to normalize the entries and disallow "Other values" and "Edit Value List" -functionalities and create a fixed Custom list instead of the index-based lists.

       

      Available skill level: mediocre FMP 3 to FMP 6.

        • 1. Re: Lists of indices
          Mike Duncan

          Create a value list that uses the values from a field. The you can access those values in a calculation like so

           

          ValueListItems ( Get ( FileName ) ; "your_value_list_name" )

           

          Is this what you're looking for? I wan't sure based on background you provide, it seems you already are onto this.

          • 2. Re: Lists of indices
            pantarhei

            Thank you, logicurio: works like a gem!

             

            Created a separate table for the indices.

            • 3. Re: Lists of indices
              brsamuel

              Another way that is more flexible - in case there are several fields (indices) that need to be worked upon:

               

              Use the List function across a relationship together with a Custom Function that removes duplicates from a list of values.  The advantage being reusability since you would not need to hard-code value lists.

              • 4. Re: Lists of indices
                mbraendle

                Yes, using ValueListItems is the usual way. However, it may run into heavy performance problems and also limits if the database (i.e. the field index) is very large. Remember also that a variable can store at maximum 1 billion Unicode characters (or 2 GB).

                 

                At least until FM 11, performance when looking up the index with Cmd-I was slow for large indexes, especially in a hosted environment, where it could take several seconds to minutes depending on network bandwidth.

                This has changed with FM 12, AFAIK; e.g. type-ahead and looking up index values should run faster since FM now just delivers the chunks required by the user. However, I'm afraid that with ValueListItems, again the whole index must be sent.

                • 5. Re: Lists of indices
                  Malcolm

                  This has changed with FM 12, AFAIK; e.g. type-ahead and looking up index values should run faster since FM now just delivers the chunks required by the user.

                   

                  We'll have to see how this performs in practice. The notes I read this morning said that value lists would deliver the first 100 items and then provide a "show more" link. When the user chooses to show more the full list is delivered.

                   

                  Also, type ahead does not work with Go.

                   

                  Malcolm