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

# Reference Variables and Dimensions

> Reference current segments, named Dimension items, absolute values, duplicate names, and Date grains in a cfo.ai formula.

A formula can use other Variables as inputs. Write Variable names the same way they appear in cfo.ai.

## Plain references

A plain name reads the Variable in the current segment:

```text theme={null}
Revenue
```

If the formula is calculating a result for Sales, `Revenue` reads Sales Revenue. If it is calculating a result for West, it reads West Revenue.

These three forms read the same current-segment value:

```text theme={null}
Revenue
this.Revenue
Revenue[]
```

## Names with spaces or punctuation

Wrap a name in backticks when it contains spaces, punctuation, an operator, or a reserved word:

```text theme={null}
`Cost of Goods Sold`
```

Example:

```text theme={null}
Revenue - `Cost of Goods Sold`
```

## A specific segment

Use brackets to replace one part of the current segment:

```text theme={null}
Revenue[Region = "West"]
```

Other dimensions still follow the current segment.

## An absolute reference

Place `$` immediately after the Variable name when the lookup should not inherit the current segment:

```text theme={null}
Revenue$
```

You can combine an absolute reference with explicit filters:

```text theme={null}
Revenue$[Region = "West"]
```

Use absolute references carefully. Most formulas should follow the segment they are calculating.

## Duplicate names

If two Variables have the same name, cfo.ai adds a short disambiguator:

```text theme={null}
Revenue#a3f
```

Use the shortest disambiguator offered by the editor or Ari.

## Date granularity

Add a granularity to Date when the formula works with time buckets:

```text theme={null}
Date.Month
```

Supported grains are Day, Week, Month, Quarter, Half, and Year.

## Previous and next periods

Use a signed offset after a Variable to read a nearby period:

```text theme={null}
Revenue[-1]
Revenue[1]
```

At a monthly grain, `Revenue[-1]` reads the previous month. The same expression follows the current Date grain.

## Related

* [Filter by Dimension items](/formulas/formula-guides/filter-by-dimension-items)
* [Work with dates](/formulas/formula-guides/work-with-dates)
