> For the complete documentation index, see [llms.txt](https://docs.datacake.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datacake.de/device/database/fields/formulas.md).

# Formulas

## What is a Formula?

Formulas can be used to perform basic mathematical operations and derive measurements based on the current values of other fields.

At the moment, the supported operations are `+`, `-`, `*` and `/`.

You can use both static expressions as well as other fields in your formula. For example, to calculate a measurement in celsius based on another field that holds the value in Fahrenheit, you would use the formula `(TEMPERATURE_F - 32) * (5/0)`, where `TEMPERATURE_F` is the field identifier of the Fahrenheit-field.

## Creating a Formula

Defining a formula is very simple. Simply select one or more fields from the "Available Placeholders" list that should provide measured values for the conversion. Use this line also to enter the operations.

![](/files/-M-LAkTqnzbLbRfUrY7U)

## Examples

### Combining multiple fields into a single one

You can use a formula to combine the measured values of different fields and perform calculations based on these values. This is suitable, for example, for setting up compound values or conditions, where the processing of several measured values is required.

![](/files/-M5xH1H0JyYll0aImDSX)

### Converting Celsius to Fahrenheit

The following screenshot shows a newly created field and its configuration dialog including the formula for the conversion of a Celsius output value of another field into the unit Fahrenheit.

![](/files/-M-L9BQulRhn5FWGlYh3)

Each time a new value is being recorded to the `TEMPERATURE` field, the formula is executed and the result (temperature in Fahrenheit) is written to the `TEMPERATURE_F` field.


---

# 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.datacake.de/device/database/fields/formulas.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.
