Swim Time Percentage

This Output accesses data of other participants, showing different ways that could be achieved. 

The first thing we need to calculate the percentage is the Swim Time of the Gender winner, this could be called with 3 different fields and must be returned as a Deimcal value for our percentage calculation. 

Finish.Gender.Top.Swim - This uses the Gender Split rank at the Finish Split, and returns the Swim time of the top participant of the same Contest and Gender.

Rank2.Top.Swim / GenderRank.Top.Swim  - Uses the GenderRank setup in our Rankings, and returns the Swim time of the top participant in the same group.

DFirst("[Swim]";"[GenderRank]=1 AND [Gender]="""&[Gender]&"""") - Uses the Aggregate function DFirst() to return the Swim time of the first person who meets the filter. Here we filter by GenderRank = 1 and the Gender must be the same as the participant we are looking at. The double escape of quotes is also used in the Closest to Run Average solution. This filter does not consider Contest but could be expanded in the same way. 

Percentage for each participant is calculated by dividing their Swim time as a decimal by the average we have already called, we used the Split Rank method for this, and multiplied by 100. 

The result of this is formatted as "s.k" since the value is returned with up to 12 decimal places otherwise. 

format(([Swim.Decimal]/[Finish.Gender.Top.Swim.Decimal])*100;"s.k") & "%"

Within the Output we Group by both Contest.Name and MaleFemale then sort by the value of the division of Swim time and Winner's Swim time. 

To make it clearer in the display we also highlight the winner in green, this is done using the additional details for all fields and dynamic formatting, setting the background where Finish.Gender = 1.