2 Replies Latest reply on May 20, 2017 5:36 PM by dws

    Track & Field heats and lane assignments

    dws

      I am trying to create a 100 m semi-finals heats report. In my database I have a record for each athlete. From the 100 m preliminary heats, the field of sprinters is narrowed down to 16 and times are captured and then entered into the database. I can sort the times and then generate a semi-final heats sheet. Doing it this way, the fastest runner would be assigned lane 1, the second fastest runner lane 2 and so on. However, in the 100 m, lane assignment rules apply. Semi-finals lane assignments for both heats are as follows:

      Heat 1

      1st (fastest) lane 4

      4th -- lane 5

      5th -- lane 3

      8th -- lane 6

      9th -- lane 2

      12th -- lane 7

      13th -- lane 1

      16th -- lane 8

      Heat 2

      2nd -- lane 4

      3rd -- lane 5

      6th -- lane 3

      7th -- lane 6

      10th -- lane 2

      11th -- lane 7

      14th -- lane 1

      15th -- lane 8

       

      Based on the preliminary times, the 16 records need to be put in the following order to generate a semi-final report with proper lane assignments: 13th, 9th, 5th, 1st, 4th, 8th, 12th, 16th, 14th, 10th, 6th, 2nd, 3rd, 7th, 11th, and 15th. How can I sort the 16 records so that they are arranged in the above order? Thanks for any ideas!

        • 1. Re: Track & Field heats and lane assignments
          erolst

          Try this:

           

          Create a number field in the Results table, say, laneNumberHeat.

          After finding the 16 results by time, execute this script:

           

          Sort Records [ Results::time ]

           

          Replace Field Contents [

           

          target field:

          Results::laneNumberHeat ;

           

          calculated result:

          Let ( [

            ranking = "13¶9¶5¶1¶4¶8¶12¶16¶14¶10¶6¶2¶3¶7¶11¶15" ;

            result = ¶ & Get ( RecordNumber ) &

            ] ;

            ValueCount ( Left ( ranking ; Position ( ranking ; result ; 1 ; 1 ) ) )

          )

           

          ]

           

          Sort Records [ Results::laneNumberHeat ]

          1 of 1 people found this helpful
          • 2. Re: Track & Field heats and lane assignments
            dws

            Thank you so much! You made my day!

            Your code worked perfectly. Based on your code, I was then able to make a 100 m Finals Sheet taking the 16 runners in the two heats to make the Final heat of 8.

            Thanks again!