The figure showing sample worksheet formulae in 6.5.3 Accessing results directly demonstrates four different worksheet functions, implemented by the add-in, which use
stemres.dll
to access STEM results directly from the results files (.smr) stored by the model engine.
From the formula shown in this figure, you will see that the
StemGetResult()
function has four parameters: the first is given as the named range
StemModel, referring to the model given on the configuration template; whilst the remainder are cell references for the scenario, element and result respectively. Constructing the formula in this way allows you to retrieve additional results and construct custom results tables simply by copying results rows and entering new results names in the left-hand column.
Note: The sample period and results formulae are entered as array formulae, as indicated by the curly braces in the formula bar. If you alter these formulae, they must be re-entered as array formulae by pressing <Ctrl+Shift+Enter>.
Function and parameters |
Description |
StemGetPeriods
(model, scenario)
|
Returns an array of labels describing the model run periods, as displayed in STEM. |
StemGetPeriodLengths
(model, scenario) |
Returns an array of numbers measuring the lengths of the model run periods in days. |
StemGetResult
(model, scenario, element, result [, consolidation]) |
Returns a time-series for the given scenario, element and result, with option to show consolidated values: Annual, Quarterly or Monthly
|
StemGetResultsStatus
(model, close, after) |
Returns the .dll
status and optionally closes the model results after evaluating any other formulae in the specified range. |
STEM worksheet functions