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

# AsOfDate

Download sample file: [as\_of\_date.csv](./csv/as_of_date.csv)

The as\_of\_date.csv file sets the AsOfDate of Atoti Limits. Atoti Limits uses a single AsOfDate. With the default setup, clients roll the AsOfDate by sending a new as\_of\_date.csv file at the start of each business day.

Atoti Limits uses the AsOfDate to evaluate limits against the business cubes. It first queries the valid limits, where StartDate \<= AsOfDate \<= EndDate, then builds the MDX queries on the business cubes for the AsOfDate.

## What does the as-of-date file contain?

<table><thead><tr><th>Column Name</th><th>Description</th><th>Required</th><th>Value Example</th></tr></thead><tbody><tr><td>AsOfDate</td><td>AsOfDate</td><td>Y</td><td>2020-01-01</td></tr></tbody></table>

Atoti Limits reads the file that matches the `limits.initial-load.file-path-matchers.as-of-date` pattern. When several dates are read, the latest one becomes the AsOfDate.

## How does Atoti Limits choose the initial AsOfDate?

The as\_of\_date.csv file is optional. The `limits.as-of-date.initial-provider` property, or a custom `ILimitsInitialAsOfDateProvider` bean, decides whether Atoti Limits reads the as-of-date file, and where the AsOfDate comes from when the file provides no date:

<table><thead><tr><th>Value</th><th>As-of-date file read</th><th>Initial AsOfDate</th><th>File generated</th></tr></thead><tbody><tr><td>`file` (default)</td><td>Yes</td><td>The current date, in the default time zone of the server. At startup, if the as\_of\_date.csv file does not exist in `limits.initial-load.root-dir`, Atoti Limits creates it with this date. Later restarts read this file, so the AsOfDate stays the date of the first startup.</td><td>Yes</td></tr><tr><td>`utc-time`</td><td>No</td><td>The current UTC date, at each startup.</td><td>No</td></tr><tr><td>`none`</td><td>No</td><td>None. The AsOfDate must come from a custom `ILimitsInitialAsOfDateProvider` bean. Without a custom bean and without an AsOfDate already set, the data load fails with a `LimitsRuntimeException`.</td><td>No</td></tr></tbody></table>

The `file` value matches the behavior of previous versions of Atoti Limits, which generated the file at startup.

A custom `ILimitsInitialAsOfDateProvider` bean replaces the provider selected by the property, whatever its value. With a custom bean, Atoti Limits does not read the as-of-date file. For details, see [How to choose the initial as-of-date](https://docs.activeviam.com/atoti-intelligence/workflows/limits/6.2/dev/dev-extensions/custom-data-loading.md#how-to-choose-the-initial-as-of-date).

On each data load, Atoti Limits resolves the AsOfDate in this order:

1. With `file` and no custom bean, the latest date in the as-of-date file.
2. Otherwise, the AsOfDate already set, if any, for example through the [`/asOfDate/set` REST endpoint](../../dev/date-roll#trigger-a-date-roll-via-rest).
3. Otherwise, the date from the provider: the current UTC date with `utc-time`, or the date returned by the custom bean.
4. If none of these gives a date, the data load fails with a `LimitsRuntimeException`.

> [!NOTE]
>
> With `utc-time`, `none`, or a custom `ILimitsInitialAsOfDateProvider` bean, Atoti Limits ignores the as-of-date file, even a file generated by an earlier `file` setup. Deleting that file is not required.

> [!NOTE]
>
> The AsOfDate does not roll automatically when the day changes. To roll it, call the `/asOfDate/set` REST endpoint. With `file` and no custom bean, providing a new as\_of\_date.csv file also rolls it.
