> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

# calculations

> Lists the calculations defined in the query.

A list of calculations defined in the query.

## Syntax

```yaml theme={null}
query:
  calculations:
    <calculation_name>:
      sql: ${<view_name>.<field_name>} <OMNI SQL TABLE FUNCTION>
      label: <string>
```

## Properties

<ParamField path="query" type="object[]">
  An object containing the individual parameters that make up a query view's query definition. See [`query`](/modeling/query-views/parameters/query) for more information.

  <Expandable title="query properties" defaultOpen="true">
    <ParamField path="calculations" type="object">
      A list of calculation definitions.

      <Expandable title="calculations properties" defaultOpen="true">
        <ParamField path="calculation_name" type="object">
          The name of the calculation.

          <Expandable title="calculation_name properties" defaultOpen="true">
            <ParamField path="sql" type="string">
              An [Omni calculation expression](/analyze-explore/calculations/all). Specify fields using `${view_name.field_name}` syntax.
            </ParamField>

            <ParamField path="label" type="string">
              Display name for the calculation.
            </ParamField>
          </Expandable>
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

## Examples

```yaml title="Calculation that adds 2 to users.age" theme={null}
query:
  fields:
    users.age: age
    users.created_at[year]: created_at_year
    age_calc: age_plus_two
  calculations:
    age_calc:
      sql: ${users.age} OMNI_FX_PLUS 2
```

```yaml title="Calculation that creates a link" theme={null}
query:
  fields:
    issues.id: id
    issues.number: number
    issue_link: link
  calculations:
    issue_link:
      sql: CONCAT('https://blobsrus.com/issues/', ${issues.number.id})
```
