Formula Results

Formula Results do not save a time, but instead they calculate a time from other results or other data in your event file. Formula results are used for many use cases, for example calculating sector times, calculating points, adding times and penalties, etc.

If you do not select a timing point for a result in Main Window->Results, the formula can be entered in the Calculation column. Any Expression that returns a number can be used here. Note that if the expression returns nothing (null) or a string, the result will be not filled (null) which is different from time 0:00:00.

To make it easier to set up formula results, a wizard can be accessed through the hand icon :

This wizard offers the following options:

Time Difference

Via Time Difference you can simply calculate the difference between two times, for example start and finish time (returns the net time) or sector times (e.g. time needed from km 10 to km 20). When you close the window by clicking OK, a formula like T2-T1 will be created. Tx represents the result with ID x.

Similarly, you can use TRx instead of Tx which returns the rounded time value. Thus, TR2-TR1 calculates the difference between the rounded time value in result 1 and 2.

Note that the operators (plus, minus, etc.) can only be evaluated if both operands exist. For example, the formula T2-T1 can only be calculated if the participant has a time in both result 1 and result 2. If one of the times is missing, the participant will not have a time in the formula result either. If non-existing results shall be considered as 0, you can use the nz function.

Table

Using a Table you can look up values in a table. The table has 4 indexes (in most cases you will need only one) which you can select through the fields Index1 to Index4. Assume, you would like to calculate points as follows: first place: 100 points, second pace: 50 points, third place: 30 points, other: 0 points. In that case the table can look like this:



Index 1 represents the rank and the other indexes are not used. Thus, select Rank1 as index 1 in the formula wizard and enter 0 for the other indexes:



If the value to be calculated also depends on other values, for example gender and contest, you can use additional indexes accordingly.

Note that you should only use a table, if you cannot calculate the points with a closed formula. For example, if would like to double the value of result 1, you can simply define the individual formula 2*T1 instead of setting up a table which converts 1 to 2, 2 to 4, 3 to 6 and so on.

Aggregation

There are several options to aggregate times, i.e. to calculate the sum, average, minimum, maximum or determine the number of times entered or the last or first time.

For the first aggregation option, simply select which results are to be considered (of the results ... through...) and how to aggregate these results. Note that First and Last return the first/last existing result (ordered by the ID). When selecting e.g. Minimum (ID), the ID of the result holding the minimum value will be returned (instead of the minimum time).
Also note that the aggregation function will always return a value, i.e. the formula TSum(1;4) is equivalent to nz(T1)+nz(T2)+nz(T3)+nz(T4). In contrast, T1+T2+T3+T4 will be calculated only if the participant has a time in all four results.

When using the second aggregation option, you can additionally reduce the results that are considered. If you enter of the best results 1 through 4, then only the best four times will be considered (assume you have a series with 6 races and you would like to sum the best four results). If you would like to consider the highest values as best values (e.g. points), you can enable the option Descending.

Individual Formula

If none of these concepts fits the requirements for your formula, you can also define an Individual Formula using an expression like this:

T1-2*T2+iif([Sex]="f";10;5)