Funciones

Las funciones añaden cierta funcionalidad a las expressions. Después del nombre de la función, siguen los parámetros separados por punto y coma entre paréntesis:

 

FunctionName(parameter1; parameter2; parameter3; ...)

 

Funciones de control

if()

La función if (o iif ) tiene tres parámetros: si el primer parámetro no es 0/true, se devolverá el segundo parámetro, en caso contrario el tercero. Por ejemplo:

if([ZJN2];"si";"no")

Si el campo adicional sí/no está marcado, la expresión devuelve sí y no en caso contrario.
El tercer parámetro también puede omitirse. Entonces, la función devuelve cero en el caso falso.

switch()

switch tiene un número arbitrario de parámetros, que alternan una condición y un resultado. Si el primer parámetro es verdadero, se devolverá el resultado del segundo parámetro. En caso contrario, si el tercer parámetro es verdadero, se devolverá el resultado del cuarto parámetro, y así sucesivamente. Por ejemplo:
 

switch([Dorsal]<100;"A";[Dorsal]<200;"B";[Dorsal]<300;"C")

Si el número de dorsal es inferior a 100, se devolverá A. Si el número de dorsal es inferior a 200 (pero mayor o igual a 100), se devolverá B. Si el número de dorsal es menor que 300 (pero mayor o igual que 200), se devolverá C. Si el número de dorsal es mayor o igual a 300, se devolverá cero.

 

choose()

choose tiene un número arbitrario de resultados. El primer parámetro es un número entero que es el índice del parámetro que se devolverá. Por ejemplo:

 

choose(4;"A";"B";"C";"D";"E") - devuelve el cuarto parámetro después del índice: D

 

Este ejemplo convierte el estado de los participantes (codificado como número) en un texto:

choose([Status]+1;"regular";"o.o.c.";"DSQ";"DNF";"DNS";"n/a") 

String Functions

left()

left() tiene dos parámetros, una cadena y un número n, y devuelve los primeros n caracteres de la cadena. Por ejemplo:

 

left("race result";4) - returns race

 

left([LastName];1) - returns the first character of the last name

right()

right has two paramters, a string and a number n, and returns the last n characters of the string. For example:
right("race result";4) - returns sult
right([LastName];1) - returns the last character of the last name

mid()

mid has three parameters, a text and two numbers m and n. It returns n characters of the string, beginning at the m-th character. For example:
mid("race result"; 6; 3) - returns res

instr()

instr returns the position of the first occurence of a substring in a string. The first parameters determines where to start searching.
instr(1;"race result";" ") - returns 5
instr(2;"ab";"a") - returns 0, since there is no a if searching from the second character on.

instr2()

instr2 is similar to instr(), but considers áàä etc. as a, éèê etc. as e, and so on
instr2(1;"ráce result";"a") - returns 2

SplitString()

SplitString takes 3 parameters - a string, a delimeter and a number n.

The string is split at each occurence of the delimeter, then the nth object is returned, for example:

SplitString("a,b,c,d"; ","; 3) returns c

val()

val converts a string into a number. For example, this function can be used to sort numerically by the values in an additional text field.
val([ATF1]) - can be used for numerical sorting by ATF1
val("3")<val("20") - returns 1 (true)
"3"<"20" - returns 0 (false due to text comparison)

len()

len returns the length of a text.
len("race result") - returns 11.
len([LastName]) - returns the length of the last name

lcase()

The function LCase converts all characters to lower case.
UCase([LastName]) & ", " & LCase([FirstName]) - returns for example DOE, john

ucase()

The function UCase converts all characters to upper case.
UCase([LastName]) & ", " & LCase([FirstName]) - returns for example DOE, john

trim()

trim removes white spaces at the beginning and end of a text and returns the remaining string:
trim(" Hello World   ") - returns "Hello World"

string()

string has two parameters, a number n and a text. It repeats the text n times.
string(3; "Run! ") - return "Run! Run! Run! ".

replace()

replace replaces parts of a text by another text.
replace("race result"; " "; "-") - returns "race-result".

reduceChars()

reduceChars has two strings a and b as parameters and returns only those characters of a that are part of b:

 

reduceChars("race result 12 software 2020"; "0123456789") - returns 122020

 

removeAccents()

removeAccents removes accents from any letter:
removeAccents("Café au Lait") - returns "Cafe au Lait"

chr()

Chr has one parameter and converts an ASCII code to the corresponding character.
chr(65) - returns "A"

asc()

Asc has one parameter and returns the ASCII code of the first character of the parameter.
 asc("A") - returns 65.

ordinal()

ordinal returns English ordinal numbers:
ordinal(1) - returns "1st"
ordinal(3) - returns "3rd"
ordinal(15) - returns "15th"

similarity()

The function similarity returns the similarity of two strings as value between 0 and 1.
similarity("Hansaplast";"HansPlasta") - returns 0.625
similarity([LastName];[LastName]) - returns 1

CorrectSpelling()

La función CorrectSpelling convierte los caracteres del nombre/apellido en mayúsculas y minúsculas como se espera: el primer carácter estará en mayúsculas, todos los demás caracteres en minúsculas. Las palabras "de", "der", "und", "van", "von" y "zu" estarán siempre en minúsculas.

CorrectSpelling("max VON uNd zu mustERMann") - devuelve Max von und zu Mustermann

stringCount()

stringCount takes two strings a and b. It returns how often b appears in a

 

stringCount("race result 12"; "r") - returns 2

 

Mathematical Functions

int()

int returns the integer part of a number, for example
int(6.7) - returns 6

sqrt()

sqrt returns the square root of a number, for example:
sqrt(9) - returns 3

quersumme()

quersumme returns the cross sum of a number, for example:
quersumme(423) - returns 9

abs()

abs returns the absolute value of a result or a calculation, by converting negative numbers to positive numbers:

 

abs(-9) - returns 9

 

abs(18) - returns 18

Example:

in a regularity race where rankings are based on the precision of each participant in a specific timing point based on a specific time-table, you may want to calculate the absolute difference between the theoretical time and the real time and then rank participants from the more precise to the less precise.

By using abs(), negative times are treated as positive, and this makes it easy to evaluate the best performance of each athlete.

 

round()

The round functions rounds a number. The second parameter is optional and defines how many decimal places shall remain:
round(3.149) - returns 3
round(3.149;2) - returns 3.15

speed()

La función Speed() calcula la velocidad en km/h (unidades métricas) o mph (unidades imperiales) según las unidades de medida en su configuración básica, por ejemplo.

speed([Time10.Decimal])

Si la distancia no es la duración de la competencia, se puede agregar como un segundo parámetro, esto utilizará la unidad de la configuración de la competencia.

El tercer parámetro es opcionalmente la unidad como:
metros - "m"
kilometros - "km"
millas - "miles"

Por Ejemplo:

speed([Time10.Decimal]; 5)
speed([Time10.Decimal]; 5000; "m")

Usando la funcion format se le puede dar formato al output facilmente:

format(speed([Time10.Decimal]); "s.k") & " mph"

pace()

The function pace calculates the pace in minutes per kilometer (metric units) or minutes per mile (imperial units), according to the units of measurement in your basic settings, for example

pace([Time10.Decimal])

If the distance shall not be the length of the contest, it can be added as a second paramter, this will use the unit from your contest settings.

The third parameter is optionally the unit as either:
meters - "m"
kilometers - "km"
miles - "miles"

For example

pace([Time10.Decimal]; 5)
pace([Time10.Decimal]; 5000; "m")

Using the format function the output can be formatted easily:

format(pace([Time10.Decimal]); "m:ss") & " min/mile"

Funciones de Resultados

Las Funciones de Resultados se utilizan para comparar resultados de participantes individuales.

La mayoría utiliza el formato TFunction(a;b) en donde a y b definen el rango de los IDs de los resultados que se desean considerar. 

por ejemplo: TMin(1;10) - devuelve el tiempo mínimo de los resultados con ID de 1 a 10

Algunas funciones cuentan con parámetros adicionales, los cuales se explican con la función. Hay además variaciones adicionales de cada función, las cuales también están explicadas en la función.

TCount()

TCount(a;b) cuenta cuántos tiempos se ingresaron en los resultados con ID de a a b.

por ejemplo: TCount(1;10) - devuelve el número de tiempos que se ingresaron en los resultados con ID de 1 a 10.

TSum()

The function TSum(a;b) calculates the sum of the times in the results with IDs a to b.

TSum(10;12) - equivalent to nz(T10)+nz(T11)+nz(T12)

The function TSum(a;b;c;d) retrieves all times in the results with IDs a to b, sorts them from smallest to largest and then calculates the sum of the best results from positions c to d.

TSum(10;15;1;2) - sums the two best times of the results 10 to 15.
TSum(10;15;3;3) - returns the third best time of the results 10-15.

TSum(a;b;c;d;1) corresponds to TSum(a;b;c;d), but sorts the times in descending order.

TMin()

TMin(a;b) devuelve el tiempo o valor mínimo de los resultados con ID de a hasta b.

por ejemplo: TMin(1;10) - devuelve el tiempo mínimo de los resultados con ID de 1 a 10 

TAvg()

Tavg(a;b) calcula el promedio de los tiempos en los resultados con ID de a hasta b

por ejemplo: TAvg(1;10) - devuelve el tiempo promedio de los resultados con ID de 1 al 10

TMax()

TMax(a;b) devuelve el tiempo o valor máximo de los resultados con ID de a hasta b.

por ejemplo: TMax(1;10) - devuelve el tiempo máximo de los resultados con ID de 1 a 10

TFirst()

TFirst(a;b) escanea los resultados a a b y devuelve la primera vez introducida (ID más bajo).

e.g. TFirst(1;10) - devuelve el tiempo del resultado con el ID más bajo de Resultados con ID de 1 a 10

La funciónTFirst(a;b;c;d) Recupera todas las veces en los resultadoscon los IDs b y los ordena de menor a mayor.
A continuación, solo considera el  cth mejor para dth mejor resultado y devuelve la primera vez de estos (= ID mas bajo).

e.g. TFirst(1;10;1;3)  - Devuelve el resultado con el ID más bajo de las tres veces mas pequeñas de los resultados IDs  1-10

TFirst(a;b;c;d;1) corresponde a TFirst(a;b;c;d), pero ordena los tiempos en orden decendente.

TFirst(a;b;0;0;0;c) escanea los resultados a a b y devuelve la cth vez introducida.

e.g. TFirst(1;10;0;0;0;3)  - Devuelve el resultado del 3er resultado (segundo los IDs de los resultados) que se han introducido desde los datos de resultados 1-10

TLast()

TLast(a;b) analiza los resultados a a b y devuelve la última vez introducida (ID más alto).

e.g. TLast(1;10) - devuelve el resultado con el ID más alto de Resultados con ID de 1 a 10

La función TLast(a;b;c;d) recupera todas las veces en los resultados con los IDs a b y los ordena de menor a mayor. A continuación solo considera el cth mejor para dth mejor resultado y devuelve la última vez de estos (=ID más alto).

e.g. TLast(1;10;1;3)  - Devuelve el resultado con el ID más alto de los 3 tiempos mas pequeños del resultado IDs 1-10

TLast(a;b;c;d;1) corresponde a TLast(a;b;c;d), pero ordena los tiempos en orden descendente.

TLast(a;b;0;0;0;c)  escanea los resultados a a b y devuelve la cth la ultima vez introducida.

e.g. TLast(1;10;0;0;0;3)  - Devuelve del 3er resultado del último resultado (de acuerdo con el ID de resultado) que se ha introducido en los datos de resultados IDs 1-10

T()

T(x) devuelve el valor en el resultado x como valor decimal.

evite usar la función T() para Formula Results - crea graves dependencias dentro de su archirvo!

También ver TR(), TText(), TName().

DMaxMin()

DMaxMin(a;b;c) escanea los resultados a a b y devuelve el maximo de veces menor que c, donde c es un valor de tiempo introducido como segundos.

e.g. DMaxMin(1;10;3600)  - Devuelve el tiempo maximo de resultados 1-10 lo cual es menos que 3600s (1 hora)

Conversion Functions

urlencode()

urlencode encodes a string as URL.

urlencode("race result") - returns race%20result

NumberToWords()

NumberToWords(a;b;c) converts a number into English words. b will be added after the integer part, c will be added after the decimal digits.

NumberToWords([EntryFee];"Euro";"Cent") - returns the entry fee in words, e.g. eighteen Euro and twenty Cent

ZahlInWort()

ZahlInWort(a;b;c) converts a number into German words. b will be added after the integer part, c will be added after the decimal digits.

ZahlInWort([EntryFee];"Euro";"Cent") - returns the entry fee in words, e.g. achtzehn Euro und zwanzig Cent

TimeFromString()

The function TimeFromString is the counterpart of the format() function. It converts a time string into a number presenting the number of seconds:

TimeFromString("0:02:03,4") - returns 123.4

md5()

md5(x) calculates the MD5 hash value.

md5("race result") - returns "02185E816175C3FC6255140D2BE222C3"

crc7()

The CRC7 check is required for communication with a number of third-party devices. 

The result of the crc7() function is returned as a decimal value. 

crc7(2) - returns 34

 

Time and Date Functions

format()

Las funciones de format formatean un número (primer parámetro) según un time format  (segundo parámetro). Ejemplo:

format(123.45; "h:mm:ss,k") - devuelve 0:02:03,4

date()

date() returns the current date for calculations:

[Event.Date]-[Date]  - returns the number of days to the date of the event

date(a) returns the current date formatted according to a:

date("dd/mm/yyyy") - returns for example 01/07/2014

date(a;b) returns the date b formatted according to a:

date("mm/yyyy"; [DateOfBirth]) - could return for example 05/1970

the function can be used to also extract dates / times from a datetime string such as the [Created] or [Modified] fields. 

Date Formats:

d Day of Month (without leading zeroes)
dd Day of Month (with leading zeroes)
ddd Day of Month as Ordinal value
m Month (without leading zeroes)
mm Month (with leading zeroes)
mmm Month as short text (English & German only)
mmmm Month as long text (English & German only)
yy 2-digit Year
yyyy 4-digit Year
e Day of Week as number (1-7)
ee

Day of Week as short text (English & German only)

eee Day of Week as long text (English & German only)
a Day of Year
ww Week number
isoweek

Year and Week number

Time Formats:

hh Hours
nn Minutes
ss Seconds

now()

now() returns the current date and time for calculations:

now()-[Created]  - returns the number of days ago the participant has been created.

ElapsedTime()

ElapsedTime(time; format) crea una cadena especial que generará un tiempo de ejecución en las listas que muestra el tiempo transcurrido desde la hora.

Si no se indica el formato, se utilizará HH:mm:ss.

Si el formato se expresa con un signo "-", ElapsedTime mostrará una cuenta regresiva hasta el tiempo.

ElapsedTime no funcionará para eventos de varios días en los que el tiempo supere las 24 horas. 

AgeOnDate()

AgeOnDate(yyyy;mm;dd) returns a participant's age on a specified date entered with 3 parameters; year month and day..

Check Functions

inRange()

inRange(a;b) returns 1 if the number a is within the number range b, e.g. "1-10;15".

inRange([Bib];"1-10;15") - returns 1 if the bib number is between 1 and 10 or equal 15.

isNumeric()

isNumeric checks if a string contains only the characters 0,1,2,3,4,5,6,7,8,9:

isNumeric("12323") - returns true

isNumeric("12W44") - returns false

isAlpha()

isAlpha checks if a string only contains the characters A-Z/a-z:

isAlpha("ASKdeo") - returns true

isAlpha("Ström") - returns false
isAlpha("K3") - returns false

hasChip()

hasChip(transponder) returns 1 if the given transponder code is assigned to the participant, and 0 otherwise.

hasChip("NUSPW44") - returns 1 or 0

The transponder can be assigned by the fields Transponder1, Transponder2 or by the Chip File.

ChipFileHas()

 ChipFileHas(transponder) returns 1 if the given transponder code is present in the Chip File, and 0 otherwise. 

ChipFileHas("ZABCD12") - returns 1 or 0

search()

search(a;b) returns 1, if all words of b occur in a.

search("This is a string with race and result"; "race result") - returns 1

search("the first three characters of the alphabet do not occur in this text"; "abc") - returns 0

isUCICode()

isUCICode checks if the first parameter is a valid UCI code:

isUCICode("GER19810312") - returns true

isUCICode("Ger13333") - returns false

isUCIID()

isUCIID() checks if the first parameter is a valid UCI ID:

isUCIID("98387437864") - returns true

 

isUCIID("ABCD123") - returns false

 

hasEntryFee(entryFeeID)

hasEntryFee(entryFeeID) returns 1 if the given EntryFeeID is applied to the participant, and 0 otherwise.

hasEntryFee(1) - returns 1 or 0

You can find the EntryFeeID under Main Window > Entry Fees.

This function can be used for example as a filter in Output lists, to see which participants a particular Entry Fee has been applied to.

isEligible()

IsEligible(a;b;c) returns 1 if the participant is eligible for the contest according to the date of birth ranges and, optionally, gender, and 0 otherwise. 

isEligible("01/01/2000") - checks whether the date 01/01/2000 is eligible for the current contest of the participant. 

The function can also take a year instead of date. 

isEligible(2000) - checks whether the year of birth 2000 would be eligible for the current contest of the particpant.

The second parameter is optional and can be used to also check whether the gender is eligible for the contest. 

isEligible([DateOfBirth];"m") - checks whether the current date of birth and the gender Male is eligible for the current contest of the participant. 

The third optional parameter can be used to define the contest ID. 

isEligible([DateOfBirth];[Gender];2) - checks whether the participant is eligible for contest ID 2. 

This function is useful for registration of relay teams where additional team members information may be stored in additional fields, but you still need to confirm their eligibility to compete. 

isValidEmail()

IsValidEmail() Devuelve 1 si la cadena representa una dirección de correo electrónico válida y 0 en caso contrario.

isValidEmail("john.doe@gmail.com") - Controla si john.doe@gmail.com es técnicamente una dirección de correo válida (no necesariamente una existente).

Inter-Record Functions

BunchTime()

BunchTime(rankID;resultID;offset) calcula el tiempo de un grupo de corredores en eventos de ciclismo. Todos los ciclistas que se encuetran en un grupo reciben el tiempo del primer lugar del grupo, si la distancia (en segundos) entre ellos es igual o menor al offset (intervalo) entre los ciclistas. Si la distancia entre dos cilcistas en un grupo es mayor que el offset, se creará un nuevo grupo con un tiempo de grupo (Bunch Time) nuevo.

BunchTime(1;11;1) 

GapTimeTop()

GapTimeTop(resultID;rankID;text first;time format) calcula el tiempo de diferencia entre un participante y el primer participante. El resultID determina qué resultado se debe considerar; el rankID determina quién es el primer atleta; text first es el texto que se debe mostrar para el primer atleta; y time format especifica cómo formatear el tiempo de desfase. Por ejemplo:

GapTimeTop(1;2;"--";"+m:ss,kk") 

Utilizando los resultados por defecto (ID de resultado 1 = tiempo de llegada) y los rangos (ID de rango 2 = MFRank) esto devolvería el tiempo de retraso del ganador del género basado en el tiempo de llegada.

Los parámetros tercero y cuarto pueden omitirse. "-" y "+HH:MM:ss,kk" son los valores por defecto.

GapTimePrev()

GapTimePrev(resultID;rankID;text first;time format) calcula el tiempo de diferencia entre un participante y el anterior. El resultID determina qué resultado se debe considerar; el rankID determina quién es el atleta anterior; text first es el texto que se debe mostrar para el primer atleta; y time format especifica cómo formatear el tiempo de diferencia. Por ejemplo:

GapTimePrev(1;3;"--";"+m:ss,kk") 

Utilizando los resultados por defecto (ID de resultado 1 = tiempo de llegada) y los rangos (ID de rango 3 = AGRank) esto devolvería el tiempo de retraso del corredor anterior, en el mismo grupo de edad, basado en el tiempo de llegada.

Los parámetros tercero y cuarto pueden omitirse. "-" y "+HH:MM:ss,kk" son los valores por defecto.

GapTimeLast()

GapTimeLast(resultID;rankID;text last;time format) calculates the gap time between a participant and the last participant (max rank at the time of calculation). The resultID determines which result to consider; the rankID determines who is the last athlete; text last is the text to show for the last athlete; and time format specifies how to format the gap time. For example:

GapTimeLast(1;2;"--";"+m:ss,kk") 

Using the default Results (Result ID 1 = Finish Time) and Ranks (Rank ID 2 = MFRank) this would return the time to the last athlete of the same gender based on finish time.

The third and fourth parameters can be omitted. "-" and "+HH:MM:ss,kk" are the default values.

GapTimeNext()

GapTimeNext(resultID;rankID;text last;time format) calculates the gap time between a participant and the next participant. The resultID determines which result to consider; the rankID determines who is the next athlete; text last is the text to show for the last athlete; and time format specifies how to format the gap time. For example:

GapTimeLast(1;3;"--";"+m:ss,kk") 

Using the default Results (Result ID 1 = Finish Time) and Ranks (Rank ID 3 = AGRank) this would return the time ahead of the next runner, in the same age group, based on finish time. 

The third and fourth parameters can be omitted. "-" and "+HH:MM:ss,kk" are the default values.

TeamGapTimeTop()

TeamGapTimeTop(ResultNo;TeamScoreID; text first; time format) calculates the gap time between the time of a team and the first team. The ResultNo determines which result to consider (1 to 4); the TeamScoreID determines which team score will be considered; text first is the text to show for the first team; and time format specifies how to format the gap time. For example:

TeamGapTimeTop(2;1;"--";"+m:ss,kk") 

This would return the gap time of the second result in team score 1.

The third and fourth parameters can be omitted. "-" and "+HH:MM:ss,kk" are the default values.

TeamGapTimePrev()

TeamGapTimePrev(ResultNo;TeamScoreID; text first; time format) calculates the gap time between the time of a team and the previous team. The ResultNo determines which result to consider (1 to 4); the TeamScoreID determines which team score will be considered; text first is the text to show for the first team; and time format specifies how to format the gap time. For example:

TeamGapTimePrev(2;1;"--";"+m:ss,kk") 

This would return the gap time of the second result in team score 1.

The third and fourth parameters can be omitted. "-" and "+HH:MM:ss,kk" are the default values.

DCount()

DCount counts the number of participants fulfilling a filter (first parameter):

DCount("[Finished]") - returns the number of finishers
DCount("T101>0 AND [Contest]=1") - returns the number of participants registered in Contest 1, who have a result in Result 101

If your filter contains text values, you need to escape the quotes with more quotes. Examples:

DCount("[Gender]=""f""") - Returns the number of female participants
DCount("[Gender]="""  & [Gender] & """") - Returns the number of participants who are of the same gender as the considered participant.

Note that the aggregation functions are not very fast and should be used rarely.

DSum()

DSum sums up the values of a field (first parameter) of those participants fulfilling a filter (second parameter):

DSum("[Age]"; "[Finished]") - returns the sum of the ages of all finishers

Why the double quotes around the field names? Because the parameter is the name of the field that the function shall analyze!

Note that the aggregation functions are not very fast and should be used rarely.

DMin()

DMin determines the minimum of the values of a field (first parameter) of those participants fulfilling a filter (second parameter):

DMin("[Age]"; "[Finished]") - returns the minimum age of all finishers

Why the double quotes around the field names? Because the parameter is the name of the field that the function shall analyze!

Note that the aggregation functions are not very fast and should be used rarely.

DAvg()

DAvg calculates the average of the values of a field (first parameter) of those participants fulfilling a filter (second parameter):

DAvg("[Age]"; "[Finished]") - returns the average age of all finishers

Why the double quotes around the field names? Because the parameter is the name of the field that the function shall analyze!

Note that the aggregation functions are not very fast and should be used rarely.

DMax()

DMax determines the maximum of the values of a field (first parameter) of those participants fulfilling a filter (second parameter):

DMax("[Age]"; "[Finished]") - returns the maximum age of all finishers

Why the double quotes around the field names? Because the parameter is the name of the field that the function shall analyze!

Note that the aggregation functions are not very fast and should be used rarely.

DFirst()

DFirst returns the value of a field (first parameter) of the first participant fulfilling a filter (second parameter):

DFirst("[Lastname]"; "[Bib]=1") - returns the last name of the participant with bib number 1

Why the double quotes around the field names? Because the parameter is the name of the field that the function shall analyze!

Note that the aggregation functions are not very fast and should be used rarely.

DLast()

DLast returns the value of a field (first parameter) of the last participant fulfilling a filter (second parameter):

DLast("[Lastname]"; "[Bib]=1") - returns the last name of the participant with bib number 1

Why the double quotes around the field names? Because the parameter is the name of the field that the function shall analyze!

Note that the aggregation functions are not very fast and should be used rarely.

DConcat()

DConcat concats the (string) values of a field (first parameter) of those participants fulfilling a filter (second parameter).

DConcat can then be used for example to list all the participants with the same last name:

DConcat("#[FirstName] [LastName] [crlf]"; "[LastName]=""" & [LastName] & """")

DQuantile()

DQuantile calculates a quantile of the values of a field (first parameter) of those participants fulfilling a filter (second parameter):

DQuantile("[Time1.Decimal]"; "[Time1.Positive]"; 25) - calculates the 25%-quantile of the times in result 1.

Note that the aggregation functions are not very fast and should be used rarely.

DFunctions() explanation

DFunctions() can be tricky to write due to the escaped quotation marks in the function. The parameters used must be written as text strings, but then comparing participants in groups requires calling the field value in to the string. Below is an explanation of how to write DFunctions and how the quotation marks are escaped or how to write it using a full-text expression.

Standard Text String

The below function will return the count of all participants whose Gender and Contest match the considered participant.

DCount("[Contest]=" & [Contest] & " AND [Gender]=""" & [Gender] & """")
  • The first yellow quote opens a string of text and the second yellow quote closes it.
  • An ampersand is used to concatenate the yellow string of text with the value of [Contest].
  • Since the value of [Contest] is a number and NOT a string of text, we do not need to surround the value with quotes. The resulting concatenated string is shown below if, for example, the considered participant was in contest 1.
[Contest]=1
  • The first orange quote opens a new string of text and the second orange quote closes it.
  • The first green quote escapes the second green quote leaving a single quote within the orange quote string. When evaluated, the resulting string between the orange quotes looks like this. (note, there is a space in front of AND)
 AND [Gender]="
  • An ampersand is used to concatenate the orange string of text with the value of [Gender]. The resulting concatenated string is shown below if, for example, the considered participant's gender was male.
 AND [Gender]="m
  • The first red quote opens a new string and the second red quote closes it.
  • The first blue quote escapes the second blue quote leaving a single quote within the red quote string.
  • When evaluated, the second green quote is paired with the second blue quote which encloses the value of [Gender]. The use of quotes around [Gender] is necessary because the value of [Gender] is a string and NOT a number.
  • Once all strings are concatenated and the function is evaluated, the resulting string of text within the DCount() function would be this.
[Contest]=1 AND [Gender]="m"

 

Other Functions

nz()

nz sirve principalmente para Formula Results. Operator Las expresiones solo se evaluarán si todos los operandos están disponibles (no son NULL). Por ejemplo la fórmula T2-T1 solo se evaluará si el participante tiene ambos tiempos T1 y T2. Si desea evaluar una expresión de operador cuando los operandos no están disponibles, necesitará la función nz que devuelve 0 si su parámetro no existe (es NULL). Por ejemplo, en el caso del tiempo neto, es posible que desee calcular el tiempo neto incluso si la hora de inicio no existe. Para esto puedes utilizar la siguiente expresión:

T2-nz(T1)

min()

min can have an arbitrary number of parameters and returns the minimum value of them.

min(2;3;1;5;6) - returns 1

 

min([YearOfBirth];[Bib]) - returns the minimum of year of birth and bib number

max()

max has an arbitrary number of parameters and returns the maximum of them

max(2;3;1;5;6) - returns 6

 

max([YearOfBirth];[Bib]) - returns the maximum of year of birth and bib number

first()

first() takes an arbitrary number of parameters and returns the first parameter (according to the sequence they are listed) which is not null. 

first(T11;T12;T0) - returns T0 if both T11 and T12 are zero or will return the first result which is not null.

last()

last() takes an arbitrary number of parameters and returns the last parameter (according to the sequence they are listed) which is not null. 

last(T11;T12;T0) - will return T0 even if T11 and T12 are not null. 

table()

The table function when used in Formula Results returns a value from the table. The parameters are the four table indexes, for example:

table([Rank1];0;0;0) - may return some point values from the table

Setting()

The first and only paramter of the Setting function is the name of a setting. The function will return the value of the setting. This can now be done by entering fields directly from Event Data Fields.

Setting("EventName") - returns the name of the event

GetSex()

GetSex returns the sex entry from the data base of first names:

GetSex("Frank") - returns m 

GetSex("Susan") - returns f 
GetSex("Andrea") - returns f/m (mostly female, in Italian male)

translate()

translate serves to translate the gender of a participant to a word in another language. If the first parameter is 'f' ('m', 'a'), the second (third, fourth) parameter will be returned. If the first parameter is neither 'f' nor 'm' nor 'a', the first parameter will be returned. You can use this expression:

translate([Sex];"Women";"Men";"Agender")

Translate is equivalent to:

translate(a; b; c; d) := switch([a]="f";[b]; [a]="m";[c]; [a]="a";[d]; 1;[a])

Rank()

Rank(x) can be used to call the place of the participant according to the ranking definition for X where X can be a calculation formula. RankP(x) can also be used to return the rank with a period after.

For example:

Rank(TLastID(a;b)) - Returns the value for the Rank with the ID which matches the value for TLastID(a;b).

 

RankMax()

RankMax(x) returns the number of participants who have been ranked in the same group according to the ranking definition for X where X can be a calculation formula. 

e.g. 

RankMax(TLastID(a;b)) - Returns the number of participants who have been ranked in the same group for the Rank with the ID which matches the value for TLastID(a;b).

Text()

To display the value of a field (e.g. [Contest.Name] or [Event.Name]) in the correct language in Output Lists, e-mails/sms, Certificates etc. use the Text() function.

Text([Field];"language code")

The corresponding field will be displayed in the selected language, e.g. Text([Contest.Name];"en") returns the English Contest name, whereas Text([Contest.Name];"de") returns the German Contest name.

Click here for more information where to use the Text() function and a list of available language codes.

ChangeLink()

The ChangeLink() function is used with Registration Forms of the self-service type to generate the unique URL for each participant to access their self-service. 

This URL will contain the form name, a unique key for the form, an ID for the participant and a key unique to the participant. 

The form name is passed as a parameter, by default the URL and self-service form will be hosted on the my.raceresult page for the event. 

ChangeLink("SelfService") - returns the unique URL for the self-service registration form SelfService

If your registration forms are sorted in to groups then the form name must contain the complete location with both the group name and form name separated by a vertical bar. 

ChangeLink("Group 1|SelfService") - returns the URL for the form SelfService inside Group 1

A second parameter can optionally be passed to change the destination URL, this can be used to create your own custom URL for embedding the self-service form. 

ChangeLink("SelfService"; "my") - returns the default my.raceresult URL

ChangeLink("SelfService"; "events") - returns a URL which directs to the events.raceresult server

ChangeLink("SelfService"; "www.mywebsite.com/event/reg") - returns a URL with the specified URL, the query parameters will be appended directly after, including the "?"

When using your own website destination, you must also ensure to embed the registration form using the Website Integration

 

 

 

Scoring Functions

2015 Age Graded Functions

For new events, it is recommended to use the 2020 Age Graded Functions. The 2015 functions will still be supported for legacy events.

2020 Age Graded Functions

Functions Reference

Type  

 

   
Arithmetic Operators + (addition) - (subtraction) * (multiplication) / (division)
  \ (integer division) % (remainder) ^ (exponentiation) : (time operator)
         
Comparison Operators < (less than) > (greater than) = (equal to) <> (not equal to)
  <= (less than or equal to) >= (greater than or equal to)    
         
Logical Operators OR  XOR (one or the other) AND  
         
Array Operators  IN NIN (not in)    

 

       
Control Functions if() switch() choose()  
         
String Functions left() right() mid() instr()
  instr2() val() len() lcase()
  ucase() trim() string() replace()
  reduceChars() removeAccents() chr() asc()
  ordinal() similarity() CorrectSpelling() stringCount()
  SplitString()      
         
Mathematical Functions int() sqrt() quersumme() abs()
  round() speed() pace()  
         
Result Functions TCount() TCountIf() TSum() TRSum()
  TMin() TRMin() TMinID() TMinName()
  TAvg() TRAvg() TMax() TRMax()
  TMaxID() TMaxName() TFirst() TRFirst()
  TFirstName() TFirstID() TLast() TRLast()
  TLastID() TLastName() T() TR()
  TName() TText() TPrev() DMaxMin()
  TMinIf() TMaxIf() TMinIfID() TMaxIfID()
         
Conversion Functions urlencode() NumberToWords() ZahlInWort() TimeFromString()
  md5() crc7()    
         
Time and Date Functions format() date() now() ElapsedTime()
  AgeOnDate()      
         
Check Functions inRange() isNumeric() isAlpha() hasChip()
  search() isUCICode() isUCIID() hasEntryFee(entryFeeID)
  isEligible() isValidEmail()    
         
Inter-Record Functions BunchTime() GapTimeTop() GapTimePrev() TeamGapTimeTop()
  TeamGapTimePrev() DCount() DSum() DMin()
  DAvg() DMax() DFirst() DLast()
  DConcat() DQuantile()    
         
Other Functions nz() min() max() first()
  last() table() Setting()     GetSex()    
  translate() rank(x) Text() ChangeLink()
         
Scoring Functions AgeGradedOC2015() AgeGradedLevel2015() AgeGradedFactor2015()  
  AgeGradedOC2020() AgeGradedLevel2020() AgeGradedFactor2020()