> For the complete documentation index, see [llms.txt](https://docs.wiclax.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wiclax.com/en/other-features/calculated-fields.md).

# Calculated fields

A custom data defined on the event can become an automatically calculated value.

This calculation is obtained by entering the formula associated with the field:&#x20;

<figure><img src="/files/JyEGrS53llfVU2ATvTO9" alt=""><figcaption></figcaption></figure>

## Application scope

The first thing to do is to specify the target for the data, which can be a combination of engagements/results/general ranking. In other words, on which grids the data will be useful. In the case of a calculated field, if the formula involves other result data, then the target will be the results grid only.

## Syntax

The general syntax used for formulas will be familiar to you if you've previously created similar formulas in Excel.

The editor allows you to both discover the functions and data available and to directly test the result of a calculation applied to a bib of your choice.

<figure><img src="/files/dHQ8bt7zZVmoAAmfMn9p" alt="" width="563"><figcaption><p>The expression editor</p></figcaption></figure>

A complete reference regarding the syntax and available functions can be found [here](https://devexpress.github.io/dotnet-eud/interface-elements-for-desktop/articles/expression-editor.html). Note the `Concat()` or `IIF()` functions among the most useful.

## Time data

Time values ​​in Wiclax are stored with a specific format, therefore it is not possible to use native functions of the *Date/Time* section or simple operators like + and - for calculation operations. Instead, you must use the following specific functions:&#x20;

*`TimeToMs()`*, *`MsToTime()`*, *`AddTimes()`* et *`SubTimes()`*

## The WXVAR function

Another important function is `WxVar`. You can use it to get any variable to calculate in the context of the operated data row (commitment or result). These variables are the same as those available for custom export formats.&#x20;

A complete reference of these variables can be consulted [here](/en/other-features/export-variables.md).

{% hint style="info" %}
Note that to use the result of a WxVar function in another function, it may be necessary to ensure that the value is treated as numeric, for example by using the `ToInt()` function in addition.
{% endhint %}

{% hint style="warning" %}
Using this function or more broadly calculated fields in your file may impact program performance. It is also recommended to use existing data fields in the grid where appropriate, rather than their equivalent provided by a variable.
{% endhint %}

## Event Variables

The above example involves an event variable, obtained in the formula using the WXVAR function and defined in this way:

<figure><img src="/files/cLuT2kD2K9CihkL41eGR" alt=""><figcaption></figcaption></figure>

The evaluation of the formula is always done according to the context of a competitor's data record (either a registration row or a result row). Consequently, the value taken for the variable D+ climb may depend on the competitor's race:

<figure><img src="/files/jPjfSIIgDmuXbIjN997d" alt="" width="336"><figcaption></figcaption></figure>

## Automatic calculation

A calculated field will be updated automatically whenever any data about the competitor itself is changed - whether it is result or registration data.

In case the formula includes a general value - for example the number of finishers for the race - doing this update would have a massive impact when acquiring results. For these particular scenarios it will therefore be necessary to request a recalculation by a manual action (right-click on the column header, Recalculate menu).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.wiclax.com/en/other-features/calculated-fields.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
