Global Scalars¶
These scalar variables are available in every projection node.
Unlike the global time vectors, these variables are available to functions that affect the
structure of the model, like mapProjectionValues
, etc..
Provided¶
The template workbook for Autory models includes some useful global scalars which you may modify as needed.
There are also a few provided variables which cannot be changed. They are listed below.
Model-scoped¶
These variables are the same for all projection nodes in the model.
RunDate
¶
The run date is the valuation date for the first projection node in the dependency tree.
Not to be confused with ProjectionStartDate
or ValnDate
.
For Excel models, this is specified in the RunControl
sheet.
For JSON models, this is specified under the run_control
key:
{
"run_control": [
{
"name": "RunDate",
"formula": "DATE(2018,12,31)"
}
]
}
Variable-scoped¶
The values of these variables depend on the variable containing the formula in which they are used.
VarName
¶
This resolves to the name of the variable that contains the formula in which VarName
is used.
This is only available in the variable library.
Projection-node-scoped¶
These variables depend on the projection node in which they are used.
ProjectionStartDate
¶
The date of the first period (time step t=1
) in the results of the current projection node.
This is the earliest valuation date found in this projection node and all of its dependencies.
ValnDate
¶
The intended starting date of the valuation for the current projection node.
Not to be confused with ProjectionStartDate
, which may be the same or earlier as this date.
hLevel
¶
The hierarchy level of the hierarchy node associated with the current projection node.
ValnType
¶
The valuation type of the current projection node.
ProjMonths
¶
The number of periods (time steps) in the current projection node.
Time-step-scoped¶
These variables depend on the specific time step of the projection node in which they are used.
ProjYear
¶
The year of the current time step in the current projection node. Shorthand for YEAR(Date)
.
ProjDateYYYYMM
¶
The date of the current time step in the current projection node, formatted as "YYYYMM".
Shorthand for TEXT(Date,"YYYYMM")
.
Add your own¶
You may add your own global scalars.
Using an Excel model¶
Add a row to the GlobalVariables
table. For each variable, provide a value or a formula, but not both.
Variable | Value | Formula | Description | DataType |
---|---|---|---|---|
GlobalScalar1 | 2022/12/31 | Remember to document your variables here. | Date | |
GlobalScalar2 | YEAR(RunDate) | Shortly state the purpose of the variable. | Date |
Using a JSON model¶
In the JSON model, you always use a formula.
{
"globals": [
{
"name": "GlobalScalar1",
"formula": "DATE(2022,12,31)"
},
{
"name": "GlobalScalar2",
"formula": "YEAR(RunDate)"
}
]
}