# Formula basics
URL: https://docs.valsight.ai/formula-basics/
Description: Formulas define how a node is calculated in a model. They combine node references, operators, and functions to calculate values across time and other business dimensions.
Formulas define how a node is calculated in a model. They combine **node references, operators, and functions** to calculate values across time and other business dimensions.

Learn the core syntax here before diving into the full [Operators](/operators/) reference and the [Function catalog](/function-catalog/).

## The building blocks

| Term                                    | Definition                                                                                                                                                                                                                                                                |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Node references                         | Wrap node names in single quotes: `'Revenue'`. Typing a `'` in the Function Editor lists the available nodes, including nodes from submodels.                                                                                                                             |
| Constants                               | Write numbers directly in formulas: `0`, `1.2`, `100000`. Numbers have no dimensions; they are a single value.                                                                                                                                                            |
| Operators                               | Arithmetic `+`, `-`, `*`, `/`; comparisons `=`, `!=`, `<`, `<=`, `>`, `>=`; and boolean logic `AND`, `NOT`, `OR`, `XOR`, `TRUE`, `FALSE`. [Operators](/operators/) can be nested and combined with functions.                                                             |
| Functions                               | [Functions](/function-catalog/) are named operations that transform, filter, or compare values. Names are case-sensitive and written in uppercase, for example `EXPAND`, `FILTER`, `IF`, take comma-separated arguments inside parentheses, and are evaluated inside out. |
| Dimensions, levels,<br>and level values | [Dimensions and levels](/dimensions/) describe which business axes a value is defined on and at what detail. Use double quotes for dimension names, level names, and level values: `"Time"`, `"Year"`, `"2026"`.                                                          |
| Value lists                             | Use square brackets for lists of values: `["EMEA", "APAC"]`.                                                                                                                                                                                                              |
| Project variables                       | Use [project variables](/project-variables/) as placeholders in functions. Type `$` to select a variable from the list, for example `$FORECAST_START`.                                                                                                                    |
| Comments                                | Use `#` to add comments in the function field.                                                                                                                                                                                                                            |

## Common formula shapes

| Name              | What it does                                                         | Formula                                       |
| ----------------- | -------------------------------------------------------------------- | --------------------------------------------- |
| Arithmetic        | Combine node values directly with operators.                         | `'Revenue' - 'COGS'`                          |
| Data reference    | Pull uploaded or source data into a node.                            | `DATA("ERP", "Actuals", "Volume")`            |
| Reshaping         | Add dimensional detail with one or more levels.                      | `EXPAND('Sales', "Product")`                  |
| Filtering         | Keep only the rows that match a set of level values.                 | `FILTER('Sales', "Region", ["EMEA", "APAC"])` |
| Conditional logic | Return one value where a condition holds, another where it does not. | `IF('Margin' < 0, 0, 'Margin')`               |

## Related

* [Operators](/operators/): arithmetic, comparisons, and boolean logic used in formulas
* [Function catalog](/function-catalog/): all functions (A-Z and browse by category)
* [Troubleshooting guide](/troubleshooting-guide/): wrong shape, missing values, and common pitfalls
