> For the complete documentation index, see [llms.txt](https://docs.marpledata.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.marpledata.com/docs/marple-insight/user-manuals/analysis/functions/custom-functions.md).

# Custom functions

The syntax for writing custom calculations in Marple Insight depends on the database it is connected to. For example, if the connected database is Marple DB, the correct syntax to use is PostgreSQL.

For convenience, you can search for signals on the right side and click on their names to insert them directly into your formula. When writing your custom formula, make sure to enclose signal names in **brackets and quotes** (e.g., `['SignalName']`).

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

You will see a preview of the function signal displayed in <mark style="color:red;">**red**</mark> in the preview window.

On the right side, you can add more settings to your function:

* Name
* Description
* Unit
* Resample the time base of the input signal. This feature allows you to combine signals with different time bases into the same function. See [Resampling](/docs/marple-insight/user-manuals/analysis/resampling.md) for more details.
* Flag with a star. By default, when opening the function library, a user will see his own functions and all starred functions. Add a star to functions that are relevant for all users in your workspace.

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

Any function that is available in the query language of your underlying database can be used. However, some Building blocks are added to make your life easier.

Click on the wanted building block, and fill in the signals/expressions.

<figure><img src="/files/9FSvzjTgifVRjGWafchw" alt=""><figcaption></figcaption></figure>

## Discover Building Blocks in 1 minute

{% embed url="<https://www.youtube.com/watch?index=21&list=PLtVuqpI9QpJAFtUEvuS23Z47XGHrRc_P9&v=-BUblzgLVyM>" %}

Want to discover more Marple features in 1 minute? Check out other [1 Minute Marple videos](/docs/other-resources/1-minute-marple-videos.md)


---

# 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:

```
GET https://docs.marpledata.com/docs/marple-insight/user-manuals/analysis/functions/custom-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
