2 Replies Latest reply on Oct 1, 2014 11:42 AM by briancrockett

    Finding an arbitrary number of records



      Finding an arbitrary number of records


      As part of a more complicated workflow, I need to take a list of 250k items and split them up in 250 lists of 1000 items each. So how do you 'find' an arbitrary number of records? Is it possible to say find me the first thousand records that fit this other criteria (would likely have a marker field set to 1 for all records that have already been handled). 

      I can't even find anything close to get me started. 

        • 1. Re: Finding an arbitrary number of records

          The following can be done by hand or in a script:

          Perform your find to find all records matching specified criteria

          Sort your records if the order is significant

          Go to record number 1001. Use Omit Multiple Records to omit that record and all records after it. In a script you can use Get ( FoundCount ) to specify a number that will always be greater than the total you need to omit.

          • 2. Re: Finding an arbitrary number of records

            Depending on your needs I might create a script to loop through them.

            Set var $Count1 = 1
            Set var $Count2 = 1

            goto first record

                Set field segment = $Count2
                goto next record, exit after last
                Set var $Count1 = $Count1 + 1  //increment counter
                If $Count1 > 1000
                    Set var $Count1 = 1  //reset counter
                    Set var $Count2 = $Count2 + 1 //increment segment
                End If
            End Loop

            This would allow you to search by field segment and bring up any of the 250 sets.

            How you would handle new and deleted records depends on what your requirements are.