# Formula Functions

ValQ supports many traditional user-friendly functions that allow you to create complex models. You can use these functions under **Configuration** in the Model Tab while writing formulae for the **Formula** type nodes to build/edit the models.

A formula can contain functions, expressions, references and constants.

1. Function takes in one or more values and performs a defined operation to return a result. Every function is defined with a keyword and a specific syntax that is to be followed.&#x20;
2. Expressions are node names with logical or mathematical operators that specify the operation to be performed.
3. References are the node names that refer to the nodes from the model and contain those values.
4. Constant refers to a value or a number that does not change.

Let us first see the logical, mathematical and other operators.

## Logical Operators

<table><thead><tr><th width="264">OPERATORS</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td>&#x26;&#x26;</td><td>Logical AND</td></tr><tr><td>||</td><td>Logical OR</td></tr></tbody></table>

## Mathematical and Other Operators

<table><thead><tr><th width="265">OPERATORS</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td>()</td><td>Parenthesis</td></tr><tr><td>+, -</td><td>plus, minus(-1) sign</td></tr><tr><td>*, /</td><td>Multiplication, Division</td></tr><tr><td>+, -</td><td>Addition, Subtraction</td></tr><tr><td>==, !=</td><td>Equal to, Not equal to</td></tr><tr><td>>, >=</td><td>Greater than, Greater than or equal to</td></tr><tr><td>&#x3C;, &#x3C;=</td><td>Less than, Less than or equal to</td></tr></tbody></table>

In the upcoming sections, we'll explore the different functions along with relevant examples for a better understanding.

{% hint style="info" %}
**Note:**

1. The arguments with a ? in the function syntax are optional arguments based on the use-case. When there is no optional argument, a function performs according to its default settings.
2. In function syntax, **- > number** refers to the numerical result of the performed function.
3. **valueN?** refers to the unlimited 'N' number of arguments that a function can accept.
4. Node references have been enclosed within square brackets, and each node is shown in a different color scheme for easy comprehension.

&#x20;      e.g. *Sales* node is represented as <mark style="color:purple;">\[Sales]</mark> and so on. In ValQ, along with colour scheme, the complete lineage of nodes are displayed when you choose them from the pop-up.

5. Text in blue represents the keywords in formula functions of ValQ.
   {% endhint %}


---

# Agent Instructions: 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.valq.com/model/formula-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.
