> ## 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.

# Post-processors

Atoti Server includes a key feature called *post-processing*, which
provides the ability to evaluate business logic for each request to
aggregated data. It is defined on the server side using Java code.

It is extremely flexible and can use the following types of data to
compute its value:

* Pre-aggregated data
* Custom aggregations
* Other post-processor results
* External resources (e.g. share prices, FOREX)

User-defined aggregation functions and post-processors allow you to
configure the exact data sets to be visualized for your business goals.
Post-processor advantages include the following:

* You don’t need to know if a measure is post-processed or
  pre-processed.
* Written in Java, this allows post-processors to use many external
  systems and provides a lot more flexibility over MDX calculated
  measures.
* Post-processing offers infinite possibilities for aggregation. It is
  very easy for Atoti Server’s post-processor to accurately compute the
  PnL of a trade, using real-time data streams, such as share prices and
  FOREX.
* The results of any such computations can be aggregated across any
  dimension.
* Post-processors are more flexible than traditional database-stored
  procedures.
* They always have a value and this value can depend on the query
  context.

## Post-processed measures

Some of the common business cases dealt with using post-processors are:

* Simple arithmetic operations (e.g. calculating a ratio between
  levels)
* Currency conversions (e.g. using external data to convert a trade’s
  currency to a common currency)
* Presentation effects (e.g. hiding meaningless values from users)
* Displays of market data (e.g. show the market data used in a
  currency conversion)
* Running totals (e.g. showing how cash flows accumulate over a time)
* Computing non-aggregating values (e.g.VaR)
* Real-time market data updates (e.g. FX and P\&L)

## post-processors in Atoti Market Risk

The available post-processors are found in the \*-lib modules, `calculations` packages. The resulting folders follow the pattern:
`/mr-*-lib/src/main/java/com/activeviam/mr/*/calculations/postprocessors/`

The following table describes the post-processors available in Atoti Market Risk.

<table><thead><tr><th>Post-processor</th><th>Description</th></tr></thead><tbody><tr><td>DynamicTenorsAndMaturitiesPostProcessor</td><td>Dynamically buckets from an input tenor and maturity to the appropriate destination tenors and maturities. Can be configured to bucket on a single dimension (either tenors or maturities).</td></tr><tr><td>AppendD2DDiffPostProcessor</td><td>Appends the day-to-day difference value to a measure.</td></tr><tr><td>AsOfDateNeighbourValuePostProcessor</td><td>Extension of the NeighborValue post-processor, which uses a day-to-day analysis hierarchy to select the AsOfDate to shift to. By default, it removes the cube filtering.</td></tr><tr><td>CoPPerPostProcessor</td><td>Helper class containing definitions of CoPPer API measures to be wired into the Cube definition by the Starter module.</td></tr><tr><td>ConstantZeroPostProcessor</td><td>Returns zero at any location, to allow usage as an underlying measure for analysis hierarchy post-processors.</td></tr><tr><td>DoubleDifferencePostProcessor</td><td>Computes the difference between two double values. Used over a basic Formula post-processor to allow for null checks.</td></tr><tr><td>DynamicTenorsAndMaturitiesPostProcessor</td><td>Post-processor that dynamically buckets from an input tenor and maturity to the appropriate destination tenors and maturities. Can be configured to bucket on a single dimension (either tenors or maturities).</td></tr><tr><td>ESIndicesPostProcessor</td><td>Computes expected shortfall, the average of losses greater than the VaR of a given position.</td></tr><tr><td>FxConverterMarketDataPostProcessor</td><td>Provides dynamic aggregation of values in multiple currencies, with conversion into a contextual reference currency.</td></tr><tr><td>FxVectorConverterMarketDataPostProcessor</td><td>Provides dynamic aggregation of values in multiple currencies, with conversion into a contextual reference currency. Applied to vectors.</td></tr><tr><td>IncrementalVaRPostProcessor</td><td>Computes incremental VaR, a measure of the change in the VaR of a parent portfolio should a sub-portfolio be removed from it.</td></tr><tr><td>ScenarioNamePostProcessor</td><td>Queries the datastore and returns the scenario names for an array of indices.</td></tr><tr><td>TenorAndMaturityExpand</td><td>Add-ons. These are Var and ES Sign-off adjustments applied at predefined levels in the hierarchies, for example, book / risk.</td></tr><tr><td>TenorExpand</td><td>Expands a sensitivity measure along the tenor hierarchy.</td></tr><tr><td>UnderlyingMeasureSelectorPostProcessor</td><td>Returns the valid Delta at the given location, between the aggregated vector, the tenor expansion, or the dynamically bucketed value.</td></tr><tr><td>VaRIndicesPostProcessor</td><td>Computes the VaR index (or indices if we are interpolating) for a given PnL vector and confidence level.</td></tr><tr><td>VaRPostProcessor</td><td>Computes the VaR for a given PnL vector and confidence level.</td></tr><tr><td>VectorAggregationPostProcessor</td><td>Aggregates a vector.</td></tr></tbody></table>
