> For the complete documentation index, see [llms.txt](https://docs.auditboardanalytics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.auditboardanalytics.com/workflows/expression-builder.md).

# Expression Builder

Auditors are experts at writing formulas, crafting them in spreadsheet tools, most days of the week. Analytics Expression Builder works on the exact same principles.

Remember that while there are common principles across different data tools, Analytics may differ in terms of the syntax and [functions available](/workflows/expression-builder/functions.md).

<figure><img src="https://1817223046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5mI0ilekQtcGTXKGQ2EF%2Fuploads%2Fc0aqSISCrc7qtMaL1nwL%2FEB%202%2C0.gif?alt=media&amp;token=1894ecd2-9189-45e3-b23e-c244069faa34" alt=""><figcaption></figcaption></figure>

### **Formulas**

In Analytics, a formula is a statement that's created to calculate new values or modify existing values in your data. It's commonly used in the [Add Columns](/tools/transform/add-columns.md) tool, which allows you to create new columns by defining an expression or series of expressions.

For instance, a formula in Analytics could be `IF [Sales] > 1000 THEN 'High' ELSE 'Low' ENDIF`, which would return "High" for sales over 1000 and "Low" for all other sales.

### **Expressions**

An expression in Analytics is a combination of functions, operators, constants, fields (or columns), and the logical connections between them. These are used to perform calculations, manipulate data, or evaluate conditions.

Expressions are used inside formulas to perform specific operations. For instance, `[Sales] > 1000` is an expression that evaluates whether the "Sales" field is greater than 1000.

### **Constants**

A constant in Analytics is a fixed value that doesn't change. Constants can be numeric (`2`, `3.14`), string (`'Hello'`, `'West'`), or boolean (`True`, `False`). For example, in the expression `[Sales] * 1.05`, `1.05` is a numeric constant.

Constants can be swapped out, when configured as a [Parameter](/workflows/parameters.md).

### **Operators**

Operators in Analytics are symbols or keywords used within expressions to perform operations. [See all operators](/workflows/expression-builder/expression-operators.md) with syntax.

They include mathematical operators (`+`, `-`, `*`, `/`), comparison operators (`==`, `!=`, `>`, `<`, `>=`, `<=`), and logical operators (`AND`, `OR`, `NOT`).

For example, in the expression `[Sales] > 1000`, the `>` is a comparison operator.

### **Functions**

A function in Analytics is a predefined command that performs a specific operation or set of data tasks. Functions take certain inputs (known as arguments) and produce a result. See all [functions available](/workflows/expression-builder/functions.md).

Analytics includes over 150 functions for different purposes, including [aggregation](/workflows/expression-builder/functions/aggregate.md), [conversion](/workflows/expression-builder/functions/conversion.md), [date/time calculations](/workflows/expression-builder/functions/date-time.md), [logical arguments](/workflows/expression-builder/functions/logical.md), [math calculation](/workflows/expression-builder/functions/math.md), [table manipulation](/workflows/expression-builder/functions/table.md), and [text manipulation](/workflows/expression-builder/functions/text.md).

An example of a function is `LEFT([Name], 3)`, which extracts the first three characters from the "Name" field.

### **Error Highlighting**&#x20;

When writing an expression, you may encounter errors. These errors are highlighted with a red underline—similar to how misspelled words are marked in a word processor. This visual cue helps you quickly identify and locate issues within your expression.\
\ <img src="https://1817223046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5mI0ilekQtcGTXKGQ2EF%2Fuploads%2FeLgB0ELyuVW3Ui23MQAf%2FError%20EB%202.0.png?alt=media&amp;token=07d1051b-8c38-42d8-a884-1330c61daf50" alt="" data-size="original"><br>


---

# 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.auditboardanalytics.com/workflows/expression-builder.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.
