getFormulaFromConfig¶
Get a formula snippet from a config table and inject it into the current formula.
getFormulaFromConfig(
TableName,
RowLookup="dynamicRowLookup",
ColumnLookup=varName,
errIgnore=FALSE,
valueOnError=0
)
Arguments¶
TableName- Name of the config table range. If this is a direct reference, it has to be in quotation marks (e.g.
"t_Inputs"). RowLookup- Lookup string to determine the appropriate row index.
Defaults to
"dynamicRowLookup", which is explained here. ColumnLookup- Lookup string to determine the appropriate column index. Defaults to the name of the variable that uses this function.
errIgnore- Whether to ignore a missing column or row lookup. If
FALSE, a runtime error will be raised for the missing lookup. The default is to raise an error for missing lookups. valueOnError- The value to return if the column is missing.
Examples¶
To get the value of the Formula column of the t_Formulae table:
getFormulaFromConfig("t_Formulae",,"Formula")
The result can be used inside other formulas:
10 * getFormulaFromConfig("t_Formulae",,"Formula") + 1
You can also use it multiple times in the same formula:
csvToTable(
getFormulaFromConfig("t_PROPHET_TEXT_OUTPUT",,"Path"),
getFormulaFromConfig("t_PROPHET_TEXT_OUTPUT",,"Query"),
…
)
These formulas can get very long and unwieldy. They can be shortened by using runFromConfig
and confFormula.