Variable library¶
The variable library defines the formulas Autory evaluates for each projection node. Each row assigns a variable to a variable set. The entry points then decide which variable set is used for each hierarchy node and valuation type.
Required columns¶
In an Excel model workbook, Autory reads variable formulas from these tables:
userVarLibmasterVarLibGlobalProjectionVariables
The user and master variable library tables need these columns:
VariableSetName- The name of the variable set that contains the formula.
VarName- The name of the variable being defined.
Formula- The formula to evaluate for that variable.
A minimal variable library looks like this:
| VariableSetName | VarName | Formula |
|---|---|---|
| Pricing | Premium | 100 |
| Pricing | Commission | Premium * 0.1 |
| Pricing | NetPremium | Premium - Commission |
Variable settings¶
The Variables table stores settings for variables, including:
VarName- The variable name.
VarType- The dimensionality of the variable. Common values are
TimeVectorandScalar. Format- The output formatting to use in result workbooks.
ResolveAggregation- The aggregation method used when a variable is calculated over multiple
loopTableiterations. SeeloopTable.
If a variable is used in userVarLib or masterVarLib but is missing from the Variables table,
Autory treats it as a TimeVector and logs a warning.
Python-Julia dimensionality validation¶
A Scalar formula must produce one value and must not depend on the time axis. The Python-Julia engine validates all
effective variable sets before compiling the model. If one or more scalar formulas produce time vectors, the Julia run
stops once with a report containing every invalid formula found. This validation does not change Python-Excel engine
behaviour.
The report gives complete repair alternatives:
- Change the destination variables to
TimeVector. The reported list includes downstream scalar variables that would also become time-dependent. - Keep the destinations scalar and change the complete transitive source chain to
Scalar. The reported list follows every formula variant and identifies indexed references that must also be changed because scalars cannot be indexed. - Keep the declared dimensions and make the formula explicitly scalar with an aggregation or a fixed scalar index.
For example, given ScalarA = VectorA, VectorA = VectorB, and VectorB = 1, Autory reports both complete type-change
options: change ScalarA to TimeVector, or change both VectorA and VectorB to Scalar.
An index such as VectorA[1] is scalar when period 1 is intentionally required. An expression such as VectorA[t]
is time-dependent and therefore cannot define a scalar. Projection lookup timeShift also applies only to time-vector
sources; it does not select a period from a scalar.
Master and user libraries¶
Autory reads the user library before the master library.
If the same VariableSetName and VarName pair appears in both places, the userVarLib row is used.
This lets a model override selected formulas without copying the whole master library.
Variable set inheritance¶
Variable sets can inherit formulas from other variable sets. Autory reads inheritance from these tables:
userVariableSetInheritancemasterVariableSetInheritance
The tables use these columns:
VariableSet- The child variable set.
InheritFrom- The parent variable set.
For example:
| VariableSet | InheritFrom |
|---|---|
| Pricing | Common |
The Pricing variable set receives formulas from Common, unless Pricing defines the same variable itself.
Every variable set also inherits from the built-in global variable set.