Parameters and variables both provide dynamic values, but they are used in different places.
Parameters
A parameter belongs to a semantic layer measure.
Use ASTRATO.PARAMETER when you want to override a named measure parameter for one formula call.
Example:
=ASTRATO.TABLE("Sales", ASTRATO.PARAMETER("Factor", 2))
This tells the query to use 2 for the semantic layer parameter named Factor.
If the measure does not define a parameter with that name, the formula returns an error.
Variables
A variable belongs to the workbook.
Use variables when a dataset setting is mapped to a named workbook value, often a cell or range.
Example:
=ASTRATO.TABLE("Sales", ASTRATO.VARIABLE("Color", "Blue"))
This tells the query to use Blue for the workbook variable named Color in this formula call.
The Key Difference
Feature | Parameter | Variable |
Defined in | Astrato semantic layer measure | Excel workbook add-in |
Used for | Measure parameters | Dataset settings mapped to variables |
Formula helper |
|
|
Example name |
|
|
When a Variable Is Mapped to a Parameter
There is an important edge case:
A dataset uses a semantic layer parameter.
That parameter value is mapped to a workbook variable.
A formula overrides both the variable and the parameter.
In that case, the parameter override wins.
Example:
=ASTRATO.TABLE(
"Sales",
ASTRATO.VARIABLE("FactorVariable", 2),
ASTRATO.PARAMETER("Factor", 3)
)
If FactorVariable is mapped to the semantic layer parameter Factor, the final parameter value is 3.
Reason: variables are resolved into the dataset definition first. Parameter overrides are applied after that and are more specific to the final query.
Practical Rule
Use variables for workbook-driven controls and reusable dataset logic.
Use parameters when you need a formula-specific override of a semantic layer measure parameter.
If both affect the same final parameter, the formula parameter override is the final value.
